6. Dynamic-Link Library (DLL) Analysis

A Dynamic-Link Library (DLL) is a module that contains functions (called exported functions or exports) that can be used by another program (such as an Executable or DLL). An executable can use the functions implemented in a DLL by importing it from the DLL.

The Windows operating system contains many DLLs that export various functions called Application Programming Interfaces (APIs). The functions contained in these DLLs are used by the processes to interact with the file system, process, registry, network, and the graphical user interface (GUI).

To display the exported functions in CFF Explorer tool, load the PE file that export functions and click on Export Directory. The following screenshot show some of the functions exported by Kernel32.dll (it is an operating system DLL and is located in the C:WindowsSystem32 directory). One of the functions exported by Kernel32.dll is CreateFile; this API function is used to create or open a file:

In the following screenshot, it can be seen that notepad.exe imports some of the functions exported by kernel32.dll, including the CreateFile function. When you open or create a file with Notepad, it calls the CreateFile API implemented in Kernel32.dll:

In the preceding example, notepad.exe did not have to implement the functionality to create or open the file in its code. To do that, it just imports and calls the CreateFile API implemented in Kernel32.dll. The advantage of implementing the DLL is that its code can be shared by multiple applications. If an application wants to call an API function, it must first load a copy of DLL that exports the API into its memory space.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.172.252