I am memory editing a game called Assault Cube which can be found at: http://assault.cubers.net/
I'm not sure how to describe it, so I've made a video of me doing it: www.youtube.com/watch?v=SS1swxQIbDI
Notice that my ammo goes down before the edit. After the edit, the ammo stays constant. Basically, at 0x45B75F, I need to insert two NOPs.
I've found the following on the internet:
1.
BYTE NewBytes[] = { 0xXX, 0xXX, 0xXX, 0xXX, 0xXX };
*(PBYTE)0xXXXXXXXX[0] = NewBytes;
So I tried doing:
BYTE NewBytes[] = { 0x90, 0x90 };
*(PBYTE)0x45B75F[0] = NewBytes;
But I get this error: error C2109: subscript requires array or pointer type
2.
DWORD origProtect;
VirtualProtect( ( void* )0x77D142CF, 5, PAGE_EXECUTE_READWRITE, &origProtect );
memcpy( ( void* )0x77D142CF, "\x8B\xFF\x55\x8B\xEC", 5 );
VirtualProtect( ( void* )0x77D142CF, 5, origProtect, NULL );
I would prefer to not use memcpy or any method.
3.
char val = 0x48;
BOOL success = WriteProcessMemory(target, 0x10134CE0, &val, 1, NULL);
Again, I would prefer to not use a method.
4.
uint8_t* code = (uint8_t*)0x45B75F;
*code = 0x90;
The above gives me these errors:
error C2065: 'uint8_t' : undeclared identifier
error C2065: 'code' : undeclared identifier
error C2065: 'uint8_t' : undeclared identifier
error C2059: syntax error : ')'
error C2065: 'code' : undeclared identifier
5.
*(char*)0x45B75F = 0x90;
This results in a crash.