Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 02-13-2005, 01:29
Teerayoot Teerayoot is offline
Friend
 
Join Date: Mar 2004
Location: ประเทศไทย
Posts: 83
Rept. Given: 0
Rept. Rcvd 3 Times in 2 Posts
Thanks Given: 2
Thanks Rcvd at 16 Times in 8 Posts
Teerayoot Reputation: 3
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.
Reply With Quote
  #2  
Old 02-13-2005, 02:10
visu
 
Posts: n/a
No, you can not (unless you disassemble to see how many variable ar passed and so on).
Reply With Quote
  #3  
Old 02-13-2005, 16:14
hajir
 
Posts: n/a
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.
Reply With Quote
  #4  
Old 02-13-2005, 17:04
ArC ArC is offline
VIP
 
Join Date: Jan 2003
Location: NTOSKRNL.EXE
Posts: 172
Rept. Given: 0
Rept. Rcvd 1 Time in 1 Post
Thanks Given: 5
Thanks Rcvd at 17 Times in 12 Posts
ArC Reputation: 1
Additionally you have to know the types of the arguments.
Sometimes functions expect pointers to complex strucutures. In that case only disassembling will help.
Reply With Quote
  #5  
Old 02-13-2005, 20:14
atzplzw atzplzw is offline
Friend
 
Join Date: Sep 2004
Posts: 33
Rept. Given: 1
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
atzplzw Reputation: 0
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...
Reply With Quote
  #6  
Old 02-13-2005, 22:53
bgrimm bgrimm is offline
Friend
 
Join Date: Jan 2004
Location: South of The North Pole
Posts: 66
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 3 Times in 3 Posts
bgrimm Reputation: 0
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
Reply With Quote
  #7  
Old 02-14-2005, 15:51
bearek
 
Posts: n/a
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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add export table to PE file? jonwil General Discussion 2 10-04-2021 04:01
generate a licence file for dvdvideosoft Michel Source Code 0 12-01-2014 05:34
ntdll.h header file missing? Teerayoot General Discussion 3 09-08-2004 03:34


All times are GMT +8. The time now is 15:22.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )