
So finally after we understood entire code of the injector, we can test it. The only difference is we add path of our DLL from disk (1) and before we finally inject and run our DLL - we need a memory address of LoadLibraryA, as this will be an API call that we will execute in the context of the victim process to load our DLL (2): So exe need a main function and DLL’s need DLLMain functionīasically that’s the simplest difference.įor simplicity, we create DLL which just pop-up a message box:īOOL APIENTRY DllMain ( HMODULE hModule, DWORD nReason, LPVOID lpReserved ) On the other hand with the DLL’s when you want to run your program as a dynamic library, it’s a slighty different way, so the loader has already created process in memory and for some reason that process needs your DLL or any other DLL to be load it into the process and it might be due to the function your DLL implements. At this point your program starts its execution when the OS loader finishes its job. In exe case there should be a function called main which is being called by the OS loader when it finishes all in initialization if a new process. The basic difference is how you call you code in your module or program. There are slight difference in writing C code for exe and DLL.

In this post we will discuss about a classic DLL injection technique which are use debugging API.Ībout classic code injection I wrote in this post. This post is a Proof of Concept and is for educational purposes only.Īuthor takes no responsibility of any damage you cause. Hello, cybersecurity enthusiasts and white hackers!
