#include #include #include #include #include "Daodan.h" #include "Daodan_Patch.h" #include "Patches/Utility.h" #include "Patches/Cheater.h" #include "Patches/BSL.h" #include "Patches/Console.h" #include "Daodan_Config.h" #include "Patches/Patches.h" #include "Patches/Localization.h" #include "bink-proxy.h" #include "_Version.h" #include "Oni/Oni.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, "%Y-%m-%d %H:%M:%S", timeinfo); STARTUPMESSAGE("Daodan v."DAODAN_VERSION_STRING" attached!", 0); STARTUPMESSAGE("%s", buffer); DDrConfig(argc, argv); DD_Localization(); if(GetKeyState(VK_SHIFT) & 0x8000) { STARTUPMESSAGE("Shift", 0); guitest(DDrONiModule); } DD_Patch_Init(); BinkProxyInit(); 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; }