The MASM Forum

General => The Campus => Topic started by: xandaz on November 17, 2021, 04:42:22 AM

Title: How does one make an app Dependent of a Dynamin Link Library?
Post by: xandaz on November 17, 2021, 04:42:22 AM
    Hello fellows. I removed some of the procedures in this app i'm working on and put it on a .LIB. Then I transformed it into a .DLL. No matter if it's there ore not makes no difference. The procedures are inside the app. How do i make it depend on it? Thanks in advance!
Title: Re: How does one make an app Dependent of a Dynamin Link Library?
Post by: HSE on November 17, 2021, 04:46:30 AM
\masm32\examples\dll
Title: Re: How does one make an app Dependent of a Dynamin Link Library?
Post by: xandaz on November 17, 2021, 05:40:04 AM
   thanks. i forgot to look into the examples.
Title: Re: How does one make an app Dependent of a Dynamin Link Library?
Post by: xandaz on November 17, 2021, 05:43:45 AM
    I see the example but isn't there a way without using LoadLibrary? All those libraries that are in the LIB directory of Masm32 use the same system? Do the procedures in those LIBs get embeded in the application? I use OllyDbg and it shows the modules.
Title: Re: How does one make an app Dependent of a Dynamin Link Library?
Post by: TimoVJL on November 17, 2021, 06:13:19 AM
Creating DLL using MASM32 (https://stackoverflow.com/questions/14317477/creating-dll-using-masm32)

.model flat, stdcall
.code
_DllMainCRTStartup PROC instance:DWORD,reason:DWORD,unused:DWORD
mov eax, 1
ret
_DllMainCRTStartup ENDP

foo PROC export
ret
foo ENDP

END
ml.exe test_dll.asm -link -dll -out:test_foo.dll...
includelib test_foo.lib
...
Title: Re: How does one make an app Dependent of a Dynamin Link Library?
Post by: Vortex on November 17, 2021, 06:15:36 AM
Hi xandaz,

QuoteDo the procedures in those LIBs get embeded in the application?

You are probably referring to the import libraries. There is also masm32.lib ( static library )
Title: Re: How does one make an app Dependent of a Dynamin Link Library?
Post by: xandaz on November 17, 2021, 06:20:49 AM
   yes. the procedures get embeded in the app. how do i do this?
Title: Re: How does one make an app Dependent of a Dynamin Link Library?
Post by: Vortex on November 17, 2021, 06:25:17 AM
Hello,

You can prefer static libraries in your case.
Title: Re: How does one make an app Dependent of a Dynamin Link Library?
Post by: xandaz on November 17, 2021, 07:21:12 AM
    Thanks a lot. Problem solved. It was all about the .DEF file. It's all working fine. Thanks for the help.
Title: Re: How does one make an app Dependent of a Dynamin Link Library?
Post by: TimoVJL on November 17, 2021, 07:31:10 AM
A def-file is usually used for undecorated or alias names.