Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › C++/C Programming › [CoD4] COPY PASTE INSIDE K?

[CoD4] COPY PASTE INSIDE K?

Posts 1–11 of 11 · Page 1 of 1
Hell_Demon
Hell_Demon
[CoD4] COPY PASTE INSIDE K?
Bored, have fun
Did not test the toggles ingame yet, they worked fine before I added toggles.
I know GetAsyncKeyState is not the way to go, its just a quick edit of this old code(that me and couch made when 1.7 patch was first released)

dectected

main.cpp:
Code:
#include <windows.h>
#include "patch.h"

bool bWallHack=false;
bool bNoRecoil=false;
bool bXHair=false;
bool bNameTags=false;

unsigned char *playerFlag = (unsigned char*)0x00445480;
unsigned char xwallhackpatch[2] = { 0x6a, 0x12 }; // push 12, patched
unsigned char owallhackpatch[2];// copy unpatched

unsigned long *fireRecoil = (unsigned long*)0x00457D2E;
unsigned char oRecoilPatch[5];

unsigned long *xHair = (unsigned long*)0x00430B50;
unsigned char oXHairPatch[10];

unsigned long *xTeamcheck = (unsigned long*)0x0042E1AC; //Orig 0x0F 0x85 0xCE 0x00 0x00 0x00
unsigned long *xVisible = (unsigned long*)0x0042E1CE; //Orig 0x74 0x25
unsigned char oTeamCheckPatch[6] = { 0x0F, 0x85, 0xCE, 0x00, 0x00, 0x00 };
unsigned char oVisiblePatch[2] = { 0x74, 0x25 };

void doWallhack(void)
{
	unsigned long orig;
	if(bWallHack==false)
	{
		VirtualProtect(playerFlag, sizeof(xwallhackpatch), PAGE_EXECUTE_READWRITE, &orig);
		memcpy(playerFlag, &xwallhackpatch, sizeof(xwallhackpatch));
		VirtualProtect(playerFlag, sizeof(xwallhackpatch), orig, &orig);
		bWallHack=true;
	}
	else
	{
		VirtualProtect(playerFlag, sizeof(owallhackpatch), PAGE_EXECUTE_READWRITE, &orig);
		memcpy(playerFlag, &owallhackpatch, sizeof(owallhackpatch));
		VirtualProtect(playerFlag, sizeof(owallhackpatch), orig, &orig);
		bWallHack=false;
	}
}

// recoil offset + patch

void doNoRecoil(void)
{
	unsigned long orig;
	if(bNoRecoil==false)
	{
		writeNOP(fireRecoil, 5);
		bNoRecoil=true;
	}
	else
	{
		VirtualProtect(fireRecoil, sizeof(oRecoilPatch), PAGE_EXECUTE_READWRITE, &orig);
		memcpy(fireRecoil, &oRecoilPatch, sizeof(oRecoilPatch));
		VirtualProtect(fireRecoil, sizeof(oRecoilPatch), orig, &orig);
		bNoRecoil=false;
	}
}

// xhair offset + patch

void doXHair(void)
{
	unsigned long orig;
	if(bXHair==false)
	{
		writeNOP(xHair, 10); // nop padding to prevent overwriting bytes
		changeBYTEPTR(0xB8, xHair); //mov eax,
		changeDWORDPTR(0x1, (unsigned long*)(xHair + 1)); // 1
		changeBYTEPTR(0xC3, (unsigned long*)(xHair + 6)); //ret
		bXHair=true;
	}
	else
	{
		VirtualProtect(xHair, sizeof(oXHairPatch), PAGE_EXECUTE_READWRITE, &orig);
		memcpy(xHair, &oXHairPatch, sizeof(oXHairPatch));
		VirtualProtect(xHair, sizeof(oXHairPatch), orig, &orig);
		bXHair=false;
	}
}

void doNametags(void)
{
	unsigned long orig;
	if(bNameTags==false)
	{
		writeNOP(xTeamcheck, 6);
		writeNOP(xVisible, 2);
		bNameTags=true;
	}
	else
	{
		VirtualProtect(xTeamcheck, sizeof(oTeamCheckPatch), PAGE_EXECUTE_READWRITE, &orig);
		memcpy(xTeamcheck, &oTeamCheckPatch, sizeof(oTeamCheckPatch));
		VirtualProtect(xTeamcheck, sizeof(oTeamCheckPatch), orig, &orig);
		VirtualProtect(xVisible, sizeof(oVisiblePatch), PAGE_EXECUTE_READWRITE, &orig);
		memcpy(xVisible, &oVisiblePatch, sizeof(oVisiblePatch));
		VirtualProtect(xVisible, sizeof(oVisiblePatch), orig, &orig);
		bNameTags=false;
	}
}

void InitBackups(void)
{
	unsigned long orig;
	VirtualProtect(playerFlag, sizeof(owallhackpatch), PAGE_EXECUTE_READWRITE, &orig);
	memcpy(owallhackpatch, playerFlag, sizeof(owallhackpatch));
	VirtualProtect(playerFlag, sizeof(owallhackpatch), orig, &orig);

	VirtualProtect(fireRecoil, sizeof(oRecoilPatch), PAGE_EXECUTE_READWRITE, &orig);
	memcpy(oRecoilPatch, fireRecoil, sizeof(oRecoilPatch));
	VirtualProtect(fireRecoil, sizeof(oRecoilPatch), orig, &orig);

	VirtualProtect(xHair, sizeof(oXHairPatch), PAGE_EXECUTE_READWRITE, &orig);
	memcpy(oXHairPatch, xHair, sizeof(oXHairPatch));
	VirtualProtect(xHair, sizeof(oXHairPatch), orig, &orig);
}

void DisableAll(void)
{
	unsigned long orig;
	//wallhack
	VirtualProtect(playerFlag, sizeof(owallhackpatch), PAGE_EXECUTE_READWRITE, &orig);
	memcpy(playerFlag, &owallhackpatch, sizeof(owallhackpatch));
	VirtualProtect(playerFlag, sizeof(owallhackpatch), orig, &orig);
	bWallHack=false;
	
	//recoil
	VirtualProtect(fireRecoil, sizeof(oRecoilPatch), PAGE_EXECUTE_READWRITE, &orig);
	memcpy(fireRecoil, &oRecoilPatch, sizeof(oRecoilPatch));
	VirtualProtect(fireRecoil, sizeof(oRecoilPatch), orig, &orig);
	bNoRecoil=false;

	//crosshair
	VirtualProtect(xHair, sizeof(oXHairPatch), PAGE_EXECUTE_READWRITE, &orig);
	memcpy(xHair, &oXHairPatch, sizeof(oXHairPatch));
	VirtualProtect(xHair, sizeof(oXHairPatch), orig, &orig);
	bXHair=false;

	//nametags
	VirtualProtect(xTeamcheck, sizeof(oTeamCheckPatch), PAGE_EXECUTE_READWRITE, &orig);
	memcpy(xTeamcheck, &oTeamCheckPatch, sizeof(oTeamCheckPatch));
	VirtualProtect(xTeamcheck, sizeof(oTeamCheckPatch), orig, &orig);
	VirtualProtect(xVisible, sizeof(oVisiblePatch), PAGE_EXECUTE_READWRITE, &orig);
	memcpy(xVisible, &oVisiblePatch, sizeof(oVisiblePatch));
	VirtualProtect(xVisible, sizeof(oVisiblePatch), orig, &orig);

}

void HackThread(void)
{
	InitBackups();
	while(1)
	{
		if(GetAsyncKeyState(VK_NUMPAD0)&1) // Panic key
		{
			DisableAll();
		}
		if(GetAsyncKeyState(VK_NUMPAD1)&1)
		{
			doWallhack();
		}
		if(GetAsyncKeyState(VK_NUMPAD2)&1)
		{
			doNametags();
		}
		if(GetAsyncKeyState(VK_NUMPAD3)&1)
		{
			doNoRecoil();
		}
		if(GetAsyncKeyState(VK_NUMPAD4)&1)
		{
			doXHair();
		}
		Sleep(1);
	}
}

BOOL __stdcall DllMain(HMODULE hinst, DWORD reason, void *useless)
{
	DisableThreadLibraryCalls(hinst);
	if(reason == 1)
	{
		CreateThread(0, 0, (LPTHREAD_START_ROUTINE)HackThread, 0, 0, 0);
	}
	return TRUE;
}
patch.cpp:
Code:
#include <windows.h>
/* Thanks NightGhost for the patch util's */

void writeNOP(unsigned long *orig, int len)
{
	int i = 0;
	unsigned long back;
	VirtualProtect((void*)orig, len, PAGE_READWRITE, &back);
	while(i < len) {
		*(unsigned char*)(orig + i) = 0x90;
		i++;
	}
	VirtualProtect((void*)orig, len, back, &back);
}

void changeDWORDPTR(unsigned long dest, unsigned long *orig)
{
	unsigned long back;
	VirtualProtect((void*)orig, 4, PAGE_READWRITE, &back);
	*(unsigned long*)(orig) = (unsigned long)(dest);
	VirtualProtect((void*)orig, 4, back, &back);
}

void changeBYTEPTR(unsigned char dest, unsigned long *orig)
{
	unsigned long back;
	VirtualProtect((void*)orig, 4, PAGE_READWRITE, &back);
	*(unsigned char*)(orig) = (unsigned char)(dest);
	VirtualProtect((void*)orig, 4, back, &back);
}
patch.h:
Code:
#ifndef _PATCH_H
#define _PATCH_H

void writeNOP(unsigned long *orig, int len);
void changeDWORDPTR(unsigned long dest, unsigned long *orig);
void changeBYTEPTR(unsigned char dest, unsigned long *orig);

#endif // _PATCH_H
Credits: Hell_Demon, Couch, NightGhost
#1 · 16y ago
Lolland
Lolland
I dont play COD4, but does detected mean patched. Just wondering because I was gonna post:

OMG DOESNT WORK
#2 · 16y ago
BO
BooYa
who cares, this is the c++ section and the source is to learn from, not to whine that the hack is detected when u copy and paste it
#3 · 16y ago
Lolland
Lolland
I dont whine. I imitate choobs. (It's how I am.)
What does detected mean? Someone explain because my degenerate mind cannot comprehend such high levels of vocabulary
#4 · 16y ago
why06
why06
Quote Originally Posted by lolland View Post
I dont whine. I imitate choobs. (It's how I am.)
What does detected mean? Someone explain because my degenerate mind cannot comprehend such high levels of vocabulary
Your kidding right? Oh and thanks for the code code HD. This will be nice to look at.
#5 · 16y ago
Matrix_NEO006
Matrix_NEO006
really nice code i can learn alot from it. btw try posting tuts about how to find the recoil or
w/e address u think its hard to find. for example how do u find the wall address to write a wallhack for it?
#6 · 16y ago
Hell_Demon
Hell_Demon
Quote Originally Posted by Matrix_NEO006 View Post
really nice code i can learn alot from it. btw try posting tuts about how to find the recoil or
w/e address u think its hard to find. for example how do u find the wall address to write a wallhack for it?
I leeched it like all other coders do =D
J/K, download the engine's SDK, check for strings(I believe the recoil one was something like cg_firerecoil), search for it with olly, start looking at the function, find out(by testing/etc) which one controls spread, then nop it out for nospread ^^
#7 · 16y ago
Matrix_NEO006
Matrix_NEO006
Quote Originally Posted by Hell_Demon View Post
I
download the engine's SDK
what?? wth is engines sdk
#8 · 16y ago
Hell_Demon
Hell_Demon
Quote Originally Posted by Matrix_NEO006 View Post
what?? wth is engines sdk
What engine does CoD4 use? starts with Q :P now go and look up the engine ^^
#9 · 16y ago
why06
why06
Quote Originally Posted by Hell_Demon View Post
What engine does CoD4 use? starts with Q :P now go and look up the engine ^^
Quake obviously...
#10 · 16y ago
Matrix_NEO006
Matrix_NEO006
i knew it :|||
#11 · 16y ago
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Similar Threads

  • [Help]Copy & Paste Textbox[Solved]By ViittO in Visual Basic Programming
    5Last post 16y ago
  • [Release] Speed Up Your Mass Crossmodding Program (Copy, Paste Rename Fast)!!By Scyntrus in Combat Arms Mods & Rez Modding
    43Last post 15y ago
  • Is there any way to copy/paste IN-GAME?By epshreeman5 in Suggestions, Requests & General Help
    3Last post 15y ago
  • Copy PasteBy rsousa98 in CrossFire Discussions
    21Last post 15y ago
  • Undetected Module - Copy And PasteBy prompbesj in WarRock - International Hacks
    7Last post 19y ago

Tags for this Thread

#cod4#copy#inside#paste