3 #include <ail/string.hpp>
4 #include <ail/file.hpp>
5 #include <boost/thread.hpp>
6 #include <boost/foreach.hpp>
8 #include "anti_debugging.hpp"
11 #include "exception_handler.hpp"
12 #include "arguments.hpp"
14 #include "interceptor.hpp"
18 BOOL WINAPI
DllMain(HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID lpvReserved
)
20 if(fdwReason
== DLL_PROCESS_ATTACH
)
22 process_command_line();
24 module_base
= reinterpret_cast<unsigned>(hinstDLL
);
26 write_line("Module base: " + ail::hex_string_32(module_base
));
28 initialise_dll_vector();
34 apply_hot_patches() &&
35 install_exception_handler() &&
36 process_main_thread() &&
37 python::initialise_python()
41 console_output
= true;
42 write_line("A fatal error occured, the program is not going to continue, please hit enter to terminate the process.");
44 std::getline(std::cin
, unused
);