| View previous topic :: View next topic |
| Author |
Message |
boris semashko How do I cheat?
Reputation: 0
Joined: 28 Aug 2009 Posts: 7
|
Posted: Fri Aug 28, 2009 3:02 pm Post subject: [C++] Writing to process memory, calling a function |
|
|
Hello.
1. How can I write to process memory with C++ (of course I know adress) code?
In past I tried to do similiar thing with winapi, but I was able to only read process memory..
2. How can I find out a function address from running game and call it from C++ code? I already used "GetProcAddress" to get function from dll but its totally diffrent. For example I'd like to call game function that send message from external app, so I have to know how to transfer function arguments, etc... and of course how to get pointer to it.
Well, enough for start. Thanks for *any* replies.
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Fri Aug 28, 2009 3:55 pm Post subject: |
|
|
writeprocessmemory or if you're straight in there you can use * to dereference a pointer and write to that
for 2, if the function is not exported by the dll then you will have to do your own debugging to find out the function arguments, etc. and for address the best way is probably by AOB scanning
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Fri Aug 28, 2009 7:01 pm Post subject: |
|
|
| GetProcAddress is only for exports. If you want to find out the arguments, you can breakpoint on the prologue and check the stack. Slugsnack is right, searching for bytes is the best way, if the function you want to call isn't an export.
|
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Sat Aug 29, 2009 5:13 am Post subject: |
|
|
| And then for calling the external function: if it has zero or one arguments, you can use CreateRemoteThread. Otherwise you'll have to use WriteProcessMemory to write a little stub of code that will call the desired function for you, and then call CreateRemoteThread on that stub.
|
|
| Back to top |
|
 |
|