#include #include #include #include #include "Daodan.h" #include "Daodan_Patch.h" #include "Daodan_Utility.h" #include "Daodan_Cheater.h" #include "Daodan_BSL.h" #include "Daodan_Console.h" #include "Daodan_Config.h" #include "patches/Patches.h" #include "_Version.h" #include "Oni.h" #include "Oni_GL.h" HMODULE DDrDLLModule; HMODULE DDrONiModule; void __cdecl DDrMain(int argc, char* argv[]) { time_t rawtime; struct tm* timeinfo; char buffer[80]; time(&rawtime); timeinfo = localtime(&rawtime); strftime(buffer, 80, "Daodan: %Y-%m-%d %H:%M:%S", timeinfo); DDrStartupMessage("Daodan: Daodan v."DAODAN_VERSION_STRING" attached!"); DDrStartupMessage(buffer); DDrConfig(argc, argv); DD_Patch_Init(); ONiMain(argc, argv); } /* void DDrWrongExe() { switch (MessageBox(NULL, "This version of the Daodan DLL is incompatible with your Oni.exe.\n" "Click OK for more information. To continue using Oni without the patch, replace the downloaded binkw32.dll with the original.", "Daodan", MB_OKCANCEL | MB_ICONERROR)) { case IDOK: { STARTUPINFO si; PROCESS_INFORMATION pi; FillMemory(&si, 0, sizeof(si)); FillMemory(&pi, 0, sizeof(pi)); si.cb = sizeof(si); if (!CreateProcess(NULL, "cmd /c \"start http://wiki.oni2.net/Daodan_DLL\"", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) MessageBox(NULL, "", "", 0); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); } default: ExitProcess(0); } } */ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) { switch (fdwReason) { case DLL_PROCESS_ATTACH: DDrDLLModule = hinstDLL; DDrONiModule = GetModuleHandle(NULL); if (*(uint32_t*)(OniExe + 0x0011acd0) == 0x09d36852) DDrPatch_MakeCall((void*)(OniExe + 0x0010fb49), (void*)DDrMain); else ExitProcess(0); break; } return TRUE; }