| View previous topic :: View next topic |
| Author |
Message |
Corruptor Advanced Cheater
Reputation: 3
Joined: 10 Aug 2011 Posts: 82
|
Posted: Tue Jun 11, 2013 8:02 pm Post subject: Winapi List functions of a Module |
|
|
Well, so far i found out that you can list the loaded module handles (which practically are just their offsets cast to a HMODULE) using EnumProcessModules. Furthermore, i found out that GetProcAddress can be used to find a specific function inside of this module. At least, most of the time.
The problem is that i ran into a module where GetProcAddress seems to fail; it just doesnt find the functions i tell it to find, constantly returning ERROR_MOD_NOT_FOUND even though i am 100% sure that this function does exist (at least i can find it with cheat engine, so i highly assume that its there)
So i thought i might just list all the functions from that module and look what functions actually ARE there, just to find that i have absolutely no clue how to do that. I mean, it has to be possible somehow as cheat engine is obviously able to do that somehow, but i just can't seem to find anything about it. (Probably im just searching for the wrong terms).
long story short: how do i list them?
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Tue Jun 11, 2013 8:21 pm Post subject: |
|
|
GetProcAddress does not work remotely. It is specifically for the modules located in the process that is calling the function.
If you need to get the address of an export from a dll, load it into your memory space then call GetProcAddress on it when it is loaded inside your own process.
_________________
- Retired. |
|
| Back to top |
|
 |
Corruptor Advanced Cheater
Reputation: 3
Joined: 10 Aug 2011 Posts: 82
|
Posted: Wed Jun 12, 2013 6:08 am Post subject: |
|
|
In hindsight, i should have known, given the fact that GetProcAddress doesn't even take a process handle as a parameter
Also explains why it worked for the kernel.dll; afaik this one is always mapped to the exact same position.
However, as far as i know, both the position of the loaded dll as well as the position of their functions may vary every time someone loads the dll into his virtual memory, so if i loaded the dll and then used GetProcAddress on the newly loaded dll, wouldn't i get an address that is unique for my process?
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
| Back to top |
|
 |
Corruptor Advanced Cheater
Reputation: 3
Joined: 10 Aug 2011 Posts: 82
|
Posted: Wed Jun 12, 2013 3:55 pm Post subject: |
|
|
Works like a charm. Thanks a lot for your help
|
|
| Back to top |
|
 |
|