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 


API Hooking With Cheat Engine

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials
View previous topic :: View next topic  
Author Message
Programmer
Cheater
Reputation: 0

Joined: 02 Sep 2007
Posts: 48

PostPosted: Thu Sep 20, 2007 9:20 am    Post subject: API Hooking With Cheat Engine Reply with quote

I just did this because i had nothing better to do & my internet connection died.



Anyway, I found that API hooking is made simple with Cheat Engine. Even more so that CTRL + G can take you straight to the API's address.

This means doing something like:

Code:

Sleep:
nop


Would effectively destroy the program if it uses the Sleep API. Anyhow, I didn't want to destroy it, i wanted to hook it, so heres my hook in AA:

Code:

[enable]
alloc(hook,2048)
alloc(sleeptime, 128)
label(returnhere)
registersymbol(hook)
registersymbol(sleeptime)

sleeptime:
add [eax], al  // Sleeptime, edit on CT

hook:
mov edi,edi
push ebp
mov ebp,esp
pushf

// Do whatever dumping now //

mov eax, [ebp+08]
mov edx, hook
add edx, 40
mov [edx], eax

// Stop //
popf

// Change Params //
mov [ebp+08], 5000 // Second param is sleep time
jmp returnhere


// Hook Sleep //
Sleep:
jmp hook
returnhere:
////////////////

[disable]
dealloc(hook)
dealloc(sleeptime)
Sleep:
mov edi,edi
push ebp
mov ebp,esp


This tells us the first param passed to Sleep by dumping the value to address hook+40, you can view the value by adding that as an address to your CT.

Thats all, i can't be arsed writing anymore so just mess around nad have fun.


PS. If anyone knows how to write a dynamic IAT hook, let me know Wink

_________________
Back to top
View user's profile Send private message
hakkairu
Legendary
Reputation: 0

Joined: 02 Dec 2006
Posts: 1301

PostPosted: Fri Oct 12, 2007 9:34 pm    Post subject: Reply with quote

B00tifel =]
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials 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