--- Daodan/src/Daodan.c 2009/03/17 09:06:00 272 +++ Daodan/src/Daodan.c 2009/03/17 09:55:12 273 @@ -2,6 +2,7 @@ #include "Daodan_Patch.h" #include "Daodan_Utility.h" +#include "Oni.h" #include "BFW_Utility.h" HMODULE DDrDLLModule; @@ -54,6 +55,16 @@ bool DDrPatch_Init() return true; } +void DDrMain(int argc, char* argv[]) +{ + DDrPatch_Init(); + + // Safe startup message printer + DDrPatch_MakeJump(UUrStartupMessage, DDrStartupMessage); + + ONiMain(argc, argv); +} + BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) { switch (fdwReason) @@ -62,8 +73,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DDrDLLModule = hinstDLL; DDrONiModule = GetModuleHandle(NULL); - DDrPatch_MakeJump(UUrStartupMessage, DDrStartupMessage); - DDrPatch_Init(); + DDrPatch_MakeCall((void*)0x00400000 + 0x0010fb49, DDrMain); + break; } return TRUE;