flat assembler
Message board for the users of flat assembler.

Index > Windows > Bundle DLLs(MSVCRT)

Author
Thread Post new topic Reply to topic
Aditya J



Joined: 17 Feb 2024
Posts: 6
Location: home
Aditya J 17 Feb 2024, 18:28
So like while imprting we do
Code:
section '.idata' import data readable writeable
library kernel, 'KERNEL32.DLL', \msvcrt, 'MSVCRT.DLL'
import kernel,\exit,'ExitProcess'
import msvcrt,\printf, 'printf'
    


Kernel32 and user32 are system dlls they will always be present on all windows systems

but MSVCRT is NOT preinstalled Crying or Very sad
this makes out .exe dependent on this DLL.
CAN WE PACKAGE THIS DLL INTO THE EXE MAKING THE EXE INDEPENDANT
Post 17 Feb 2024, 18:28
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20522
Location: In your JS exploiting you and your system
revolution 17 Feb 2024, 18:41
Technically: You can statically link MSVCRT if you want to. There are tools that will link DLLs into EXEs.

Legally: MS doesn't permit any alternate use of MSVCRT. Although some countries have different rules, might pay to check before you decide.
Post 17 Feb 2024, 18:41
View user's profile Send private message Visit poster's website Reply with quote
Aditya J



Joined: 17 Feb 2024
Posts: 6
Location: home
Aditya J 18 Feb 2024, 04:47
Wait dont all C++ Exes bundle runtime with them? How is that legal then?? cuz they dont require any such DLL

Alternatively can i use UCRTBASE.DLL as it is present on all systems
Post 18 Feb 2024, 04:47
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20522
Location: In your JS exploiting you and your system
revolution 18 Feb 2024, 08:33
Providing a separate DLL during installation is permitted by many licenses (that is the whole point of the DLL). Statically linking it into an exe in not permitted by many licenses. Check the license for each DLL to see what it allows.

Specifically for MSVCRT, MS doesn't allow static linking. But as mentioned above, your country (or the end user's country) might make it legal.
Post 18 Feb 2024, 08:33
View user's profile Send private message Visit poster's website Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1694
Location: Toronto, Canada
AsmGuru62 18 Feb 2024, 13:22
Interesting... so that "import" statement in FASM -- is it static linking or dynamic?
I use that for MSVCRT for, like, decades.
Post 18 Feb 2024, 13:22
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20522
Location: In your JS exploiting you and your system
revolution 18 Feb 2024, 13:29
"import" is dynamic linking. It links a DLL file at runtime.

Static linking doesn't need any import because the code is already linked in the exe at compile time.
Post 18 Feb 2024, 13:29
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.