ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/src/Daodan.c
(Generate patch)

Comparing Daodan/src/Daodan.c (file contents):
Revision 459 by rossy, Mon Aug 24 11:32:06 2009 UTC vs.
Revision 465 by rossy, Sat Oct 17 08:47:09 2009 UTC

# Line 454 | Line 454 | void __cdecl DDrMain(int argc, char* arg
454          
455          ONiMain(argc, argv);
456   }
457 <
457 > /*
458 > void DDrWrongExe()
459 > {
460 >        switch (MessageBox(NULL, "This version of the Daodan DLL is incompatible with your Oni.exe.\n"
461 >                "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))
462 >        {
463 >                case IDOK:
464 >                        {
465 >                                STARTUPINFO si;
466 >                                PROCESS_INFORMATION pi;
467 >                                FillMemory(&si, 0, sizeof(si));
468 >                                FillMemory(&pi, 0, sizeof(pi));
469 >                                si.cb = sizeof(si);
470 >                                if (!CreateProcess(NULL, "cmd /c \"start http://wiki.oni2.net/Daodan_DLL\"", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
471 >                                        MessageBox(NULL, "", "", 0);
472 >                                CloseHandle(pi.hProcess);
473 >                                CloseHandle(pi.hThread);
474 >                        }
475 >                default:
476 >                        ExitProcess(0);
477 >        }
478 > }
479 > */
480   BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
481   {
482          switch (fdwReason)
# Line 463 | Line 485 | BOOL WINAPI DllMain(HINSTANCE hinstDLL,
485                          DDrDLLModule = hinstDLL;
486                          DDrONiModule = GetModuleHandle(NULL);
487                          
488 <                        DDrPatch_MakeCall(OniExe + 0x0010fb49, DDrMain);
489 <                        
488 >                        if (*(uint32_t*)((void*)OniExe + 0x0011acd0) == 0x09d36852)
489 >                                DDrPatch_MakeCall(OniExe + 0x0010fb49, DDrMain);
490 >                        else
491 >                                ExitProcess(0);
492                          break;
493          }
494          return TRUE;

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)