Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 10-20-2011, 03:09
Newbie_Cracker's Avatar
Newbie_Cracker Newbie_Cracker is offline
VIP
 
Join Date: Jan 2005
Posts: 227
Rept. Given: 75
Rept. Rcvd 26 Times in 12 Posts
Thanks Given: 42
Thanks Rcvd at 23 Times in 17 Posts
Newbie_Cracker Reputation: 26
How create Static Library (lib) in delphi?

Hello everybody.


I have a delphi DLL code and want to create a LIB for it to use the code directly in my EXE in VC++. I don't want to have separate DLL file.

I searched the net and could not find anything useful. Do you know the solution?

I know there is a program named DLL2LIB, but I don't want to use it, as it's shareware (but cracked by myself).

Best regards.
__________________
In memory of UnREal RCE...
Reply With Quote
  #2  
Old 10-20-2011, 04:37
Kerlingen Kerlingen is offline
VIP
 
Join Date: Feb 2011
Posts: 306
Rept. Given: 0
Rept. Rcvd 274 Times in 97 Posts
Thanks Given: 0
Thanks Rcvd at 264 Times in 81 Posts
Kerlingen Reputation: 200-299 Kerlingen Reputation: 200-299 Kerlingen Reputation: 200-299
Delphi cannot create *.LIB files. The only way to do something similar is to tell Delphi to generate C++ compatible *.OBJ files (check the "-J" command line switches) and link them. Delphi can only output to OMF format, not COFF. The best choice is probably to use C++ Builder instead of Visual C++.

Why don't you want to use DLLs? They don't have a real disadvantage and there are many programs available which "bundle" DLLs with the EXE files.
Reply With Quote
The Following User Gave Reputation+1 to Kerlingen For This Useful Post:
Newbie_Cracker (10-20-2011)
  #3  
Old 10-20-2011, 14:19
Newbie_Cracker's Avatar
Newbie_Cracker Newbie_Cracker is offline
VIP
 
Join Date: Jan 2005
Posts: 227
Rept. Given: 75
Rept. Rcvd 26 Times in 12 Posts
Thanks Given: 42
Thanks Rcvd at 23 Times in 17 Posts
Newbie_Cracker Reputation: 26
Quote:
Originally Posted by Kerlingen View Post
Why don't you want to use DLLs?
To minimize dependencies.

Assume that your patcher needs a DLL to play a chiptone!!
It's so crazy to release a DLL and EXE for something like this.
__________________
In memory of UnREal RCE...
Reply With Quote
  #4  
Old 10-20-2011, 15:46
Nacho_dj's Avatar
Nacho_dj Nacho_dj is offline
Lo*eXeTools*rd
 
Join Date: Mar 2005
Posts: 198
Rept. Given: 12
Rept. Rcvd 172 Times in 32 Posts
Thanks Given: 37
Thanks Rcvd at 91 Times in 30 Posts
Nacho_dj Reputation: 100-199 Nacho_dj Reputation: 100-199
You'd rather use DLL2LIB. That's the way condzero is using the Delphi code of ARImpRec.dll (Delphi dll) in Armageddon (VC++) by the use of a .lib file generated by the tool, and this works fine.

Btw, to give compatibility to your exported functions in the Delphi dll, you have to give this name to all of them:
<NameOfExportedFunction>@<NumberOfBytesInParameters>

That is, if your function uses for instance 4 parameters of size dword, the number must be: SizeOf(dword) * 4 --> 16

So, the name of your exported function would be this:

[email protected]


Good luck with this!

Nacho_dj
__________________
http://arteam.accessroot.com
Reply With Quote
The Following User Gave Reputation+1 to Nacho_dj For This Useful Post:
Newbie_Cracker (10-20-2011)
  #5  
Old 10-20-2011, 20:35
SLV SLV is offline
Friend
 
Join Date: May 2005
Posts: 62
Rept. Given: 3
Rept. Rcvd 4 Times in 3 Posts
Thanks Given: 5
Thanks Rcvd at 2 Times in 2 Posts
SLV Reputation: 4
> Btw, to give compatibility to your exported functions in the Delphi dll, you have to give this name to all of them:
Don't forget that delphi compiles routines as fastcall, so it's better to set stdcall to all exports. I\m not sure that delphi fastcall == cl.exe fastcall.
Reply With Quote
  #6  
Old 10-21-2011, 23:39
oVERfLOW oVERfLOW is offline
Family
 
Join Date: Jan 2005
Location: Tehran
Posts: 117
Rept. Given: 127
Rept. Rcvd 42 Times in 19 Posts
Thanks Given: 1
Thanks Rcvd at 5 Times in 5 Posts
oVERfLOW Reputation: 42
Look at this old topic that may help you

or if being able to contact magic_h2001 and ask him about complete steps needed
Code:
http://forum.exetools.com/showthread.php?t=11019
Edit
here is his website
you may find his E-Mail address at the bottom of page
Reply With Quote
  #7  
Old 10-22-2011, 00:43
TQN TQN is offline
VIP
 
Join Date: Apr 2003
Location: Vietnam
Posts: 283
Rept. Given: 123
Rept. Rcvd 10 Times in 8 Posts
Thanks Given: 55
Thanks Rcvd at 22 Times in 10 Posts
TQN Reputation: 10
You can embedded your dll to resource section or data section, and use the MemoryModule to dynamic load it to memory, don't need to extract to a temp file.
MemoryModule here: https://github.com/fancycode/MemoryModule

If someone uses Delphi, search for BTMemoryModule, a Delphi port form MemoryModule above.
Reply With Quote
The Following User Gave Reputation+1 to TQN For This Useful Post:
zementmischer (10-22-2011)
  #8  
Old 10-26-2011, 22:33
Newbie_Cracker's Avatar
Newbie_Cracker Newbie_Cracker is offline
VIP
 
Join Date: Jan 2005
Posts: 227
Rept. Given: 75
Rept. Rcvd 26 Times in 12 Posts
Thanks Given: 42
Thanks Rcvd at 23 Times in 17 Posts
Newbie_Cracker Reputation: 26
Quote:
Originally Posted by TQN View Post
You can embedded your dll to resource section or data section, and use the MemoryModule to dynamic load it to memory, don't need to extract to a temp file.
MemoryModule here: https://github.com/fancycode/MemoryModule

If someone uses Delphi, search for BTMemoryModule, a Delphi port form MemoryModule above.
Some AVs don't like this. I don't want to have false+.
__________________
In memory of UnREal RCE...
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
One Time API Redirection Library in Delphi (x86) chessgod101 Source Code 0 11-23-2020 00:56
Static linking of Bassmod in Delphi Sn!per X Source Code 0 01-13-2016 22:12
Base Encoding Library for Delphi XorRanger Source Code 0 04-30-2015 15:37
Delphi Hook Library Sir.V65j Source Code 0 09-08-2014 22:27


All times are GMT +8. The time now is 10:53.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX
( 1998 - 2021 )