how to retrieve dll function parameter variables?
-
hiho@ll what i have: a dll what i want: a list of every function available in the dll and the parameters each function needs (the return value would be cool too) seems like i need something like "function prototypes" from a dll the problem: to retrieve the function names i think i will use pexport program cause source is available (i have to read the source, didn't yet) but it only can read function names, but i need the parameters too question: 1. how can i read parameters of a dll function if i only have the dll? 2. is there something like a dll file format, or a documentation how a dll works (dll header, dll symbols etc. at which offset in the dll files can i find what ...) 3. is there a simple windows function to retrieve this stuff? thx@ll
-
hiho@ll what i have: a dll what i want: a list of every function available in the dll and the parameters each function needs (the return value would be cool too) seems like i need something like "function prototypes" from a dll the problem: to retrieve the function names i think i will use pexport program cause source is available (i have to read the source, didn't yet) but it only can read function names, but i need the parameters too question: 1. how can i read parameters of a dll function if i only have the dll? 2. is there something like a dll file format, or a documentation how a dll works (dll header, dll symbols etc. at which offset in the dll files can i find what ...) 3. is there a simple windows function to retrieve this stuff? thx@ll
ThinkingPrometheus wrote:
a list of every function available in the dll...
This can easily be obtained by examining the PE file format, specifically the .edata section.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
-
hiho@ll what i have: a dll what i want: a list of every function available in the dll and the parameters each function needs (the return value would be cool too) seems like i need something like "function prototypes" from a dll the problem: to retrieve the function names i think i will use pexport program cause source is available (i have to read the source, didn't yet) but it only can read function names, but i need the parameters too question: 1. how can i read parameters of a dll function if i only have the dll? 2. is there something like a dll file format, or a documentation how a dll works (dll header, dll symbols etc. at which offset in the dll files can i find what ...) 3. is there a simple windows function to retrieve this stuff? thx@ll
You can't necessarily get the function parameters - in general you can't. If the exported names are mangled (they will contain "funny" characters) then you can, see the
UnDecorateSymbolName
API. If the functions areextern "C"
d this information is lost. You can get this kind of information from the symbol file (.pdb) if you have one for your .EXE (or DLL). Steve -
hiho@ll what i have: a dll what i want: a list of every function available in the dll and the parameters each function needs (the return value would be cool too) seems like i need something like "function prototypes" from a dll the problem: to retrieve the function names i think i will use pexport program cause source is available (i have to read the source, didn't yet) but it only can read function names, but i need the parameters too question: 1. how can i read parameters of a dll function if i only have the dll? 2. is there something like a dll file format, or a documentation how a dll works (dll header, dll symbols etc. at which offset in the dll files can i find what ...) 3. is there a simple windows function to retrieve this stuff? thx@ll
Hi, I hope if you have release version of DLL(Only DLL file no others like lib,def etc), then you cannot see the funtions and paremeters of DLL. If your DLL is Debug version, then you have a chance to reengineering the DLL and get source code. Using this we can see what's inside the DLL. Best of luck regards Vallikumar A
-
You can't necessarily get the function parameters - in general you can't. If the exported names are mangled (they will contain "funny" characters) then you can, see the
UnDecorateSymbolName
API. If the functions areextern "C"
d this information is lost. You can get this kind of information from the symbol file (.pdb) if you have one for your .EXE (or DLL). Stevethe .pdb file does mean that i have a debug version of this file too? cause (i'm not sure if i'm right) i only know the .pdb from my projects (well it could be a realse version of the dll too, but it means i should have access to the source code otherwise it would be a bit difficult to get the pdb file, not?) thx
-
Hi, I hope if you have release version of DLL(Only DLL file no others like lib,def etc), then you cannot see the funtions and paremeters of DLL. If your DLL is Debug version, then you have a chance to reengineering the DLL and get source code. Using this we can see what's inside the DLL. Best of luck regards Vallikumar A
hmm what about disassembly? i just found pe explorer and it can disassemble every dll i tried (just to make it clear i don't really want to reengineer the code of the dll and hack something or such stuff, i don't even know how this works, but:) wouldn't it be possible if i disassemble a file, know the function names and the function entry points in the dll i could have a "clue" of the parameters if i have a look at "push" assembler commands before such a function is called? i mean if a pointer is pushed it could mean something like void* or a eax value is pushed it could mean int i know i can't be 100% sure, but with the above method (i don't even know how i could do this, but just for fun ;-) ) i can have a clue of the amount of parameters and a bit of the type it could be and i think it could be enough to not be wrong with this clue i mean, if i use void* altough the dll function expects a char*, it would be somthing like try and error but i can be sure its a pointer or an int ? or maybe i'm completely wrong? thx
-
the .pdb file does mean that i have a debug version of this file too? cause (i'm not sure if i'm right) i only know the .pdb from my projects (well it could be a realse version of the dll too, but it means i should have access to the source code otherwise it would be a bit difficult to get the pdb file, not?) thx
A .pdb file can be generated for a release or a debug build. The people who built the DLL would have had to setup their compiler to create one however (and you'd have to have a copy). As one of the other posters mentioned, if you know your x86 machine code you could disassemble the .DLL and figure out the parameters. Steve