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 


[VB6]help Hook, knowledge. (nvm)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Wiw3K
Grandmaster Cheater
Reputation: 0

Joined: 09 Jul 2006
Posts: 762
Location: Poland.

PostPosted: Tue Dec 16, 2008 1:38 am    Post subject: [VB6]help Hook, knowledge. (nvm) Reply with quote

How to hook my program
eg. to notepad and when i type something in program and then click button, in notepad will appear typed message?

and how about functions like ReadWriteProcessMemory and AutoAttach, something like that, can someone give me knowledge about it? Wink


Last edited by Wiw3K on Tue Dec 16, 2008 3:19 pm; edited 1 time in total
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Tue Dec 16, 2008 12:35 pm    Post subject: Reply with quote

you need to find the function that handles the entered data and hook that. one method is detours, you can read about that. an example is let's say the info is entered via a dialogue. then the API to hook might be getdialogueitemtexta. to hook that the easiest method is to get its address (getmodulehandle/loadlibrary and getprocaddress). then do an inline patch on its first 5 bytes as a far jmp to your hook procedure. basically what you hook function will do is to read the pointer to the buffer off (one of the parameters that API takes) then you will fetch the info and send it to notepad (various methods for that, you could post WM_CHAR messages to the notepad window for example). then after you jmp back to the function at the place after you placed your hook (make sure in your hook function you rewrite the bytes you have overwritten).

readprocessmemory/writeprocessmemory are both kernel32.dll apis which can be called as normal functions given that you link and include their respective lib/inc/h files. what you wanna do is learn about API. learn how to use winapi first then try out hooks afterwards.
Back to top
View user's profile Send private message
Wiw3K
Grandmaster Cheater
Reputation: 0

Joined: 09 Jul 2006
Posts: 762
Location: Poland.

PostPosted: Tue Dec 16, 2008 3:14 pm    Post subject: Reply with quote

Slugsnack wrote:
you need to find the function that handles the entered data and hook that. one method is detours, you can read about that. an example is let's say the info is entered via a dialogue. then the API to hook might be getdialogueitemtexta. to hook that the easiest method is to get its address (getmodulehandle/loadlibrary and getprocaddress). then do an inline patch on its first 5 bytes as a far jmp to your hook procedure. basically what you hook function will do is to read the pointer to the buffer off (one of the parameters that API takes) then you will fetch the info and send it to notepad (various methods for that, you could post WM_CHAR messages to the notepad window for example). then after you jmp back to the function at the place after you placed your hook (make sure in your hook function you rewrite the bytes you have overwritten).

readprocessmemory/writeprocessmemory are both kernel32.dll apis which can be called as normal functions given that you link and include their respective lib/inc/h files. what you wanna do is learn about API. learn how to use winapi first then try out hooks afterwards.

I read about Easiest Programming Language and i found Visual C#, everyone says its the easiest so i tried and i was making stupid programs for now, learned basic stuff Wink now i am figuring out ReadProcessMemory / WriteProcessMemory , so my main language will be C#, anyway thanks for knowledge Smile i know how it works.
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 programming 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