Solved Change bytes in a adress

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

r4z0r

Coder
Meme Tier VIP
Jul 21, 2016
246
1,678
13
I'm doing this to nop a function, but it crashes the soon as I press insert to turn it on. This is not how to do it?

C#:
DWORD weaponRemove[2] = { 0x89BE14140000, 0x909090909090 };
	while (1)
	{
		Player * localPlayer = (Player*)*(DWORD*)((DWORD)GetModuleHandle("server.dll") + 0x7B4C4C);
		Player * localPlayer2 = (Player*)*(DWORD*)((DWORD)GetModuleHandle("server.dll") + 0x7B4C5C);
		Player * localPlayer3 = (Player*)*(DWORD*)((DWORD)GetModuleHandle("server.dll") + 0x7B4C6C);
		Player * localPlayer4 = (Player*)*(DWORD*)((DWORD)GetModuleHandle("server.dll") + 0x7B4C7C);
		DWORD * weaponRemoval = (DWORD*)((DWORD)GetModuleHandle("server.dll") + 0x3CC060);
		if (localPlayer != 0)
		{
			localPlayer->iHealth = 900;
			if (GetAsyncKeyState(VK_INSERT))
				*weaponRemoval = weaponRemove[1];
			if (GetAsyncKeyState(VK_HOME))
				*weaponRemoval = weaponRemove[0];
		}		
		Sleep(100);
	}
Ofc this is just the part that is crashing ;)
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,096
78,998
2,372
r4z0r is ("server.dll") + 0x3CC060 code or data?

The memory pages with code in them will not be writeable, so you'll have to change memory protection constant

Try

C++:
//internal patch
void Patch(char* dst, char* src, unsigned int size)
{
    DWORD oldprotect;
    VirtualProtect(dst, size, PAGE_READWRITE, &oldprotect);
    memcpy(dst, src, size);
    VirtualProtect(dst, size, oldprotect, &oldprotect);
}

//like dis
Patch(weaponRemoval, &weaponRemove[0], sizeo(weaponRemove[0]);
Do these tutorials:


 
Last edited:

r4z0r

Coder
Meme Tier VIP
Jul 21, 2016
246
1,678
13
It worked, but if I press home to return the original code it doesn't work... And I copied exactly the code in CE
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,096
78,998
2,372
try change from:
DWORD weaponRemove[2] = { 0x89BE14140000, 0x909090909090 };

to :

char * weaponremove0 = "\x89\xBE\x14\x14\x00\x00";
and use size/length = strlen(weaponremove0)

does that help?
 

r4z0r

Coder
Meme Tier VIP
Jul 21, 2016
246
1,678
13
Rake;44108 said:
try change from:
DWORD weaponRemove[2] = { 0x89BE14140000, 0x909090909090 };

to :

char * weaponremove0 = "\x89\xBE\x14\x14\x00\x00";
and use size/length = strlen(weaponremove0)

does that help?
It worked, thank you.
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods