There is no big difference between EXE and DLL files. They both have a PE structure, they both have import tables and they both have
an Entry point.
There is just a difference in what an entry point means. In EXE file, EntryPoint is the place, where the program begins. In a DLL
file is the entrypoint a pointer to a function, which has three parameters and can be called by several occasions.
For more information on DllMain, visit
MSDN.
PE-inject allows you (in addition to BeforeHandlers and AfterHandlers) use a function called DllMain, which has the same prototype
as Windows DLL's DllMain. This function will be executed everytime an event, which requires a DllMain call occurs. This includes
the DLL_PROCESS_ATTACH and DLL_PROCESS_DETACH events. PE-inject will pass the execution to your function BEFORE the execution
of host DLL's DllMain occurs.