![]() |
Do possible to generate c++ header file from dll export?
I got only dll file that come with application and it seem all function exported are very interresting .Do possible to generate all that exported function to c++ header file ?
I need to make some hooking on that function ,and i have to know about argument pass and return type:) TIA. |
No, you can not (unless you disassemble to see how many variable ar passed and so on).
|
You can get name of Export Functions by using TDUMP.EXE (From Borland) or DUMPBIN.EXE (From Microsoft), but you can not find the arguments & return values in this manner.
If the DLL uses from _stdcall calling convention, you can see the disassemly of functions. Then try to find the return point of the function, at this location (return point) you will see ret n instruction. n/4 is the number of arguments passed to the function. But if the DLL uses _cdecl calling convention, you should disassemble the application that calls these export functions. In this case, the no of pushes before function call or n/4 in the add esp,n after function call is the number of arguments. |
Additionally you have to know the types of the arguments.
Sometimes functions expect pointers to complex strucutures. In that case only disassembling will help. |
There is an app called dll2lib. It does created a static lib out of a dll and also the header files.
Sadly this does only work with simple dlls and fails on more complicated ones. At least this was the case for me some month ago... |
You could also try DLL2LIB, converts a DLL to a library file for static linking.
hxxp://www.binary-soft.com Also available on the Ftp Site. -bg |
You can read this
How To Create 32-bit Import Libraries Without .OBJs or Source hxxp://support.microsoft.com/kb/q131313/ and this hxxp://www.codeproject.com/cpp/libfromdll.asp I have used these methods to create a plugin for a program and used some dll from it. |
| All times are GMT +8. The time now is 10:37. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX