ulysse31 Master Cheater
Reputation: 2
Joined: 19 Mar 2015 Posts: 324 Location: Paris
|
Posted: Sun May 10, 2015 7:53 pm Post subject: Stealth edit c++ |
|
|
Hi,
While stealth edit plugin is good, 1°/ I often need to use a cheat engine table only for it (because i wrote my whole hack in c++) which is not so convenient.
The real problem is 2°/ It always stealthedits whole memory pages.
That is very often a problem because when it raises exceptions on codes that are very used (and 99.9% of the time not even closely related to the code i am actually interested in but just happens to be on the same page) it ends up eating my whole i7 and lowers my fps to 10 (that is rare, but it happens).
Therefore I would like to stealth edit only a few specific lines of code.
To this purpose I have taken a look at the cheat wiki source code concerning stealth edit, although it is written a language I didn't learn, it seems that it does this :
allocates memory, read the memory code we want to hack with a buffer that is in the newly allocated memory, then it updates all the jumps etc.. and finally when the new code is ready it raises exception with virtualprotexEx.
My c++ hack has already written the new code I wish to use in a code cave, I changed the memory access rights with this :
| Code: | DWORD oldprot(0);
int len(0x00000004);
DWORD lpAddress = 0x020FB70A;
void raiseException()
{
VirtualProtectEx(hProc, (void*)lpAddress, len, PAGE_READWRITE, &oldprot);
cout << oldprot << endl;
cout << hex << lpAddress << endl;
} |
But I have been struggling with the part in which I now tell the OS what to the to the game about the exception, Ie I don't know how to handle the exception when we raise it on a running game.
Any help would be greatly appreciated.
Thanks
|
|