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 455 by rossy, Mon Aug 10 11:46:16 2009 UTC vs.
Revision 465 by rossy, Sat Oct 17 08:47:09 2009 UTC

# Line 38 | Line 38 | bool patch_particledisablebit = false;
38   bool patch_multibyte = false;
39   bool patch_cheattable = true;
40   bool patch_argb8888 = true;
41 + bool patch_killvtune = true;
42  
43   bool patch_safeprintf = true;
44   bool patch_daodandisplayenum = true;
# Line 161 | Line 162 | bool DDrPatch_Init()
162                  DDrPatch_Int32 (OniExe + 0x000f617a, (int)&DDr_CheatTable[0].message_on);
163          }
164          
165 +        // ARGB8888 textures
166          if (patch_argb8888)
167          {
168                  DDrPatch_Byte  (OniExe + 0x00135af0, 0x07);
169                  DDrPatch_Byte  (OniExe + 0x00135af4, 0x0B);
170          }
171          
172 +        // Disable loading the vtuneapi.dll
173 +        if (patch_killvtune)
174 +                DDrPatch_Byte  (OniExe + 0x00026340, 0xC3);
175 +        
176          return true;
177   }
178  
# Line 228 | Line 234 | bool DDrIniCallback(char* section, bool
234                                  patch_cheattable = !stricmp(inifile_cleanstr(value), "true");
235                          else if (!stricmp(name, "argb8888"))
236                                  patch_argb8888 = !stricmp(inifile_cleanstr(value), "true");
237 +                        else if (!stricmp(name, "killvtune"))
238 +                                patch_killvtune = !stricmp(inifile_cleanstr(value), "true");
239                          else if (!stricmp(name, "safeprintf"))
240                                  patch_safeprintf = !stricmp(inifile_cleanstr(value), "true");
241                          else if (!stricmp(name, "daodandisplayenum"))
# Line 446 | 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 455 | 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)