| View previous topic :: View next topic |
| Author |
Message |
Wiw3K Grandmaster Cheater
Reputation: 0
Joined: 09 Jul 2006 Posts: 762 Location: Poland.
|
Posted: Tue Dec 16, 2008 1:38 am Post subject: [VB6]help Hook, knowledge. (nvm) |
|
|
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? 
Last edited by Wiw3K on Tue Dec 16, 2008 3:19 pm; edited 1 time in total |
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Tue Dec 16, 2008 12:35 pm Post subject: |
|
|
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 |
|
 |
Wiw3K Grandmaster Cheater
Reputation: 0
Joined: 09 Jul 2006 Posts: 762 Location: Poland.
|
Posted: Tue Dec 16, 2008 3:14 pm Post subject: |
|
|
| 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 now i am figuring out ReadProcessMemory / WriteProcessMemory , so my main language will be C#, anyway thanks for knowledge i know how it works. |
|
| Back to top |
|
 |
|