Ok in this cutted source you will easily get the point how to use this way to NOP! If you dont get it ... pls dont post it and leave this thread!
Globals:
Code:
#define GLASSWALLS 0x57218A
#define PUSH 0x6A
#define NOP 0x90 //Only if you NOP something
#define GWLength 2 //The Bytelength of Glasswalls
BYTE gw_ON[WHLength] = {PUSH, 0x00}; //GW On
BYTE gw_OFF[WHLength] = {PUSH, 0x01}; //GW Off
void memoryediting(int address, BYTE *data, int length){
int protection;
VirtualProtect((void *)address, length, PAGE_READWRITE, (PDWORD)&protection);
memcpy((void *)address, (const void *)data, length);
VirtualProtect((void *)address, length, protection, 0);
}
Using it in a Hotkeyhack
Code:
if(GetAsyncKeyState(VK_F12)<0){
if(gw){
Sleep(200);
memoryediting(GLASSWALLS, gw_OFF, GWLength);
gw = false;
}else{
Sleep(200);
memoryediting(GLASSWALLS, gw_ON, GWLength);
gw = true;
}
}
Have fun =)