Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do dll's ever turn into machine code?

Just curious, I was told that with dll files, you can make modifications to the dll without recompiling the whole application that uses it. On the other hand .lib files need to be compiled so the code can linked to the application as one.

So I know that the .lib files are turned into machine code. but what about the dll's ?? Are they turned into machine code upon the execution of the application ??

This could probably lead to easy hacking if not used right.

like image 761
numerical25 Avatar asked Jun 03 '10 22:06

numerical25


People also ask

What are DLL files coded in?

DLL files use languages like C or C++, although you'll see C++ more often. You can write your own DLLs to run some code you need if you're willing to learn how to do it. It could be valuable to your project and of course it could make you look good in return.

Can you decode a DLL file?

Download and install a decompiler. A "decompiler" is a program that allows you to see the source code that was used to construct a file or program, in this case a DLL file. In order to see the code that makes a DLL file work, you will need to use a decompiler to revert it back into readable code.

Are DLLs loaded into memory?

DLLs are loaded into memory just once. In static linking, system libraries must be loaded into each program, which means every process has its own copy of the same library. That takes up more memory.

Is a DLL file binary?

DLL files are binary files that can contain executable code and resources like images, etc. Unlike applications, these cannot be directly executed, but an application will load them as and when they are required (or all at once during startup).


2 Answers

The dlls are still machine code. They're just dynamically linked in at run time (hence then name) so (if you don't change the function signatures) you don't have to recompile your main program to use a dll after it's been changed. A static library is physically part of your executable, that's why changes there require a recompile (or really, a relink).

like image 84
miked Avatar answered Nov 01 '22 21:11

miked


DLLs do contain compiled machine code. The difference is that the linking between the application EXE and the DLL is done at runtime, instead of at (traditional) link time between OBJ and LIB files.

like image 7
Greg Hewgill Avatar answered Nov 01 '22 21:11

Greg Hewgill