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) |
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; |