Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Stealth edit c++

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
ulysse31
Master Cheater
Reputation: 2

Joined: 19 Mar 2015
Posts: 324
Location: Paris

PostPosted: Sun May 10, 2015 7:53 pm    Post subject: Stealth edit c++ Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites