Programmer Cheater Reputation: 0
Joined: 02 Sep 2007 Posts: 48
|
Posted: Thu Sep 20, 2007 9:20 am Post subject: API Hooking With Cheat Engine |
|
|
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:
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
_________________
|
|