From 6be80c524112eeb1f1193b8265bbf2805a079cbb Mon Sep 17 00:00:00 2001 From: Federico Date: Tue, 12 Jul 2022 16:12:29 +0200 Subject: [PATCH] Initial commit --- README.md | 54 +++ WhMocFix/WhMocFix.vcxproj | 167 +++++++ WhMocFix/WhMocFix.vcxproj.filters | 22 + WhMocFix/WhMocFix.vcxproj.user | 4 + WhMocFix/dllmain.cpp | 774 ++++++++++++++++++++++++++++++ 5 files changed, 1021 insertions(+) create mode 100644 README.md create mode 100644 WhMocFix/WhMocFix.vcxproj create mode 100644 WhMocFix/WhMocFix.vcxproj.filters create mode 100644 WhMocFix/WhMocFix.vcxproj.user create mode 100644 WhMocFix/dllmain.cpp diff --git a/README.md b/README.md new file mode 100644 index 0000000..8430a9c --- /dev/null +++ b/README.md @@ -0,0 +1,54 @@ +# Warhammer: Mark of Chaos Performance Fix + +[Warhammer: Mark of Chaos](https://www.gog.com/game/warhammer_mark_of_chaos_gold_edition) is a real time strategy game released in 2006. + +Despite its age, the game remains CPU bottlenecked to this day due to the fact that it only uses 1 CPU core and there's some leftover debug code that spams millions of system calls to `GetThreadTimes` and `QueryPerformanceCounter`. This causes long load times and irregular performance on Windows and makes the game virtually unplayable on Wine, where these system calls are very slow. + +This patch removes the leftover debug code, improving __loading times by 40-50% on Windows__ and by nearly 3000% on Linux (that's not a typo), __game performance will also improve by about 10-15%__ in CPU-bound scenarios (such as large hordes of rats), and __stuttering is reduced__ in general. + +## Installation +* Make sure you're using the GOG version of the game, it should say Version 2.14 in the menu +* Open the game's installation folder +* Rename `binkw32.dll` to `binkw23.dll` +* Extract `binkw32.dll` to the game's folder +* Run the game + +If you run into issues while playing the game, report them here or send an email to [info@fdossena.com](mailto:info@fdossena.com) + +__Please note that your antivirus software might classify this patch as malware since it overwrites the game code, you can safely ignore it.__ + +## Compatibility +|**Version**|**Source**|**Compatibility**| +|-----------|----------|-----------------| +| 2.14 | [GOG](https://www.gog.com/game/warhammer_mark_of_chaos_gold_edition) | **Yes** | +| 2.14 (EU) | Retail | **Yes** 1 | +| 2.14 (US) | Retail | Probably 1 | +| 2.14 (RU) | Retail | Probably 1 | +| <= 1.74 | Retail | **No** | + +1. The game's SafeDisc DRM is incompatible with modern systems, a crack is required. + +## ASI mods +This patch contains a simple ASI loader. To load ASI mods into the game, make a folder called `asi` in the game's installation folder and put your ASI mods into it, they'll be loaded automatically when the game is launched. + +## How it works +This article explains how this fix was made and how it works: [link](https://fdossena.com/?p=whmocfix/i.md) + +## How to build +Want to improve the patch? Great! You'll need Visual Studio 2019. Load the solution in VS, make sure the Release x86 build is selected, and build it. + +## Credits +* WarrantyVoider for his super useful [Proxy DLL Maker](https://github.com/zeroKilo/ProxyDllMaker) +* Erik-JS for his awesome [Mass Effect ASI loader](https://github.com/Erik-JS/masseffect-binkw32/tree/master/ME1) that served as a base for the ASI loader in this patch + +## License +Copyright (C) 2022 Federico Dossena + +This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/lgpl. + +This program and its author are in no way affiliated to Deep Silver, Bandai Namco, Black Hole Entertainment or Games Workshop. +Warhammer is a registered trademark of Games Workshop. diff --git a/WhMocFix/WhMocFix.vcxproj b/WhMocFix/WhMocFix.vcxproj new file mode 100644 index 0000000..f0985ec --- /dev/null +++ b/WhMocFix/WhMocFix.vcxproj @@ -0,0 +1,167 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + {F8BF2349-88F0-4569-AAD0-7493D8EF603F} + Win32Proj + WhMocFix + 10.0 + WhMocFix + + + + DynamicLibrary + true + v142 + MultiByte + + + DynamicLibrary + false + v142 + MultiByte + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + binkw32 + + + true + + + false + binkw32 + + + false + + + + NotUsing + Level3 + Disabled + true + WIN32;_DEBUG;WHMOCFIX_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + pch.h + MultiThreadedDebug + + + Windows + true + false + + + + + Use + Level3 + Disabled + true + _DEBUG;WHMOCFIX_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + pch.h + + + Windows + true + false + + + + + NotUsing + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;WHMOCFIX_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + pch.h + MultiThreaded + + + Windows + true + true + true + false + + + + + Use + Level3 + MaxSpeed + true + true + true + NDEBUG;WHMOCFIX_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + pch.h + + + Windows + true + true + true + false + + + + + + + + + \ No newline at end of file diff --git a/WhMocFix/WhMocFix.vcxproj.filters b/WhMocFix/WhMocFix.vcxproj.filters new file mode 100644 index 0000000..fd6c32e --- /dev/null +++ b/WhMocFix/WhMocFix.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/WhMocFix/WhMocFix.vcxproj.user b/WhMocFix/WhMocFix.vcxproj.user new file mode 100644 index 0000000..0f14913 --- /dev/null +++ b/WhMocFix/WhMocFix.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/WhMocFix/dllmain.cpp b/WhMocFix/dllmain.cpp new file mode 100644 index 0000000..9cd2cba --- /dev/null +++ b/WhMocFix/dllmain.cpp @@ -0,0 +1,774 @@ +#include +#include +#include +#include +#pragma pack(1) + +//begin patch code + +//performance fix +BYTE pattern1[] = {0x83,0xec,0x18,0x53,0x8b,0x1d,0xa4,0x11,0xe4,0x00}; +BYTE pattern1_replacement[] = {0xc3}; +BYTE pattern2[] = {0x55,0x8b,0xec,0x83,0xe4,0xf8,0x83,0xec,0x08,0x53,0x8b,0x5e,0x0c,0x57,0x8b,0x7e,0x08,0x8d,0x44,0x24,0x08,0x50,0xff,0x15,0xa4,0x11,0xe4,0x00}; +BYTE pattern2_replacement[] = {0xc3}; +BYTE pattern3[] = {0xd9,0xee,0x8b,0x35,0xa4,0x11,0xe4,0x00}; +BYTE pattern3_replacement[] = {0xeb,0x79}; +//auto update disabler +BYTE pattern4[] = {0xb8,0x10,0x00,0x00,0x00,0x39,0x46,0x3c,0x72,0x05}; +BYTE pattern4_replacement[] = {0x31,0xc0,0xc3}; + +DWORD FindPattern(DWORD start, DWORD end, BYTE* pattern, unsigned int patternLength) { + unsigned int matchLength = 0; + for (DWORD ptr = start; ptr <= end - patternLength; ptr++) { + while (((BYTE*)ptr)[matchLength] == pattern[matchLength]) { + matchLength++; + if (matchLength == patternLength) return ptr; + } + matchLength = 0; + } + return NULL; +} + +void ReplaceCode(DWORD target, BYTE* replacement, unsigned int replacementLength) { + DWORD originalProtection; + VirtualProtect((void*)target, replacementLength, PAGE_EXECUTE_READWRITE, &originalProtection); + for (unsigned int i = 0; i < replacementLength; i++) { + ((BYTE*)target)[i] = replacement[i]; + } + VirtualProtect((void*)target, replacementLength, originalProtection, NULL); +} + +void PatchGame() { + DWORD target1 = NULL, target2 = NULL, target3 = NULL, target4 = NULL; + //find patterns in memory + for (int count = 0; count < 10; count++) { + target1 = FindPattern(0x401000, 0xe40e0c, pattern1, sizeof(pattern1)); + target2 = FindPattern(0x401000, 0xe40e0c, pattern2, sizeof(pattern2)); + target3 = FindPattern(0x401000, 0xe40e0c, pattern3, sizeof(pattern3)); + target4 = FindPattern(0x401000, 0xe40e0c, pattern4, sizeof(pattern4)); + if (target1 && target2 && target3 && target4) { + break; //all patterns found, stop looking for them + } + else { + Sleep(300); //one or more patterns were not found, try again in 300ms, max 10 tries + } + } + if (target1 && target2 && target3 && target4) { + //all patterns found, apply patch + ReplaceCode(target1, pattern1_replacement, sizeof(pattern1_replacement)); + ReplaceCode(target2, pattern2_replacement, sizeof(pattern2_replacement)); + ReplaceCode(target3, pattern3_replacement, sizeof(pattern3_replacement)); + ReplaceCode(target4, pattern4_replacement, sizeof(pattern4_replacement)); + } + else { + //one or more patterns were not found, show error + MessageBox(0, "Patching failed! Make sure you're using the GOG version of the game.\n\nThe game will continue, but no patches have been applied.", "WH:MOC Performance Fix - Error", MB_OK | MB_ICONWARNING); + } +} + +//patch code ends here + +//begin ASI loader + +void LoadASImods() { + WIN32_FIND_DATA fd; + char currfile[FILENAME_MAX]; + HANDLE asiFile = FindFirstFile(".\\asi\\*.asi", &fd); + if (asiFile == INVALID_HANDLE_VALUE) return; + do { + if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { + strcpy_s(currfile, ".\\asi\\"); + strcat_s(currfile, fd.cFileName); + if (!LoadLibrary(currfile)) { + char errmsg[128 + FILENAME_MAX]; + strcpy_s(errmsg, "ASI mod failed to load: "); + strcat_s(errmsg, currfile); + strcat_s(errmsg, "\n\nThe game will continue without this mod"); + MessageBox(0, errmsg, "WH:MOC ASI Loader - Error", MB_OK | MB_ICONWARNING); + } + } + } while (FindNextFile(asiFile, &fd)); + FindClose(asiFile); +} + +//end ASI loader, the next code is just for passing through bink calls to the original bink dll that we replaced + +HINSTANCE hL = NULL; +FARPROC p[72] = { 0 }; //pointers to original bink calls + +void LoadOriginalBink() { + HINSTANCE hL = LoadLibrary(".\\binkw23.dll"); + if (!hL) { + MessageBox(0, "Failed to load binkw23.dll\n\nYou did not apply the fix correctly, the game will crash.", "WH:MOC Performance Fix - Error", MB_OK | MB_ICONWARNING); + return; + } + p[0] = GetProcAddress(hL, "_BinkStartAsyncThread@8"); + p[1] = GetProcAddress(hL, "_BinkBufferOpen@16"); + p[2] = GetProcAddress(hL, "_BinkWait@4"); + p[3] = GetProcAddress(hL, "_BinkBufferSetOffset@12"); + p[4] = GetProcAddress(hL, "_BinkRegisterFrameBuffers@8"); + p[5] = GetProcAddress(hL, "_BinkSetIO@4"); + p[6] = GetProcAddress(hL, "_BinkShouldSkip@4"); + p[7] = GetProcAddress(hL, "_BinkClose@4"); + p[8] = GetProcAddress(hL, "_BinkGetRealtime@12"); + p[9] = GetProcAddress(hL, "_BinkSetError@4"); + //p[10] = GetProcAddress(hL, "EntryPoint"); //no need to load this, LoadLibrary already called it + p[11] = GetProcAddress(hL, "_BinkBufferGetError@0"); + p[12] = GetProcAddress(hL, "_BinkGetTrackData@8"); + p[13] = GetProcAddress(hL, "_BinkOpenWaveOut@4"); + p[14] = GetProcAddress(hL, "_BinkDoFrameAsync@12"); + p[15] = GetProcAddress(hL, "_BinkBufferSetDirectDraw@8"); + p[16] = GetProcAddress(hL, "_BinkGetKeyFrame@12"); + p[17] = GetProcAddress(hL, "_BinkSetMixBins@16"); + p[18] = GetProcAddress(hL, "_BinkSetVolume@12"); + p[19] = GetProcAddress(hL, "_BinkSetMemory@8"); + p[20] = GetProcAddress(hL, "_BinkBufferGetDescription@4"); + p[21] = GetProcAddress(hL, "_BinkCheckCursor@20"); + p[22] = GetProcAddress(hL, "_BinkDX8SurfaceType@4"); + p[23] = GetProcAddress(hL, "_RADTimerRead@0"); + p[24] = GetProcAddress(hL, "_BinkNextFrame@4"); + p[25] = GetProcAddress(hL, "_BinkGetRects@8"); + p[26] = GetProcAddress(hL, "_BinkCopyToBuffer@28"); + p[27] = GetProcAddress(hL, "_BinkBufferClear@8"); + p[28] = GetProcAddress(hL, "_BinkRestoreCursor@4"); + p[29] = GetProcAddress(hL, "_BinkPause@8"); + p[30] = GetProcAddress(hL, "_BinkDoFrameAsyncWait@8"); + p[31] = GetProcAddress(hL, "_BinkOpenTrack@8"); + p[32] = GetProcAddress(hL, "_BinkBufferBlit@12"); + p[33] = GetProcAddress(hL, "_BinkGoto@12"); + p[34] = GetProcAddress(hL, "_BinkControlBackgroundIO@8"); + p[35] = GetProcAddress(hL, "_BinkCloseTrack@4"); + p[36] = GetProcAddress(hL, "_BinkBufferSetResolution@12"); + p[37] = GetProcAddress(hL, "_BinkIsSoftwareCursor@8"); + p[38] = GetProcAddress(hL, "_BinkGetSummary@8"); + p[39] = GetProcAddress(hL, "_BinkGetFrameBuffersInfo@8"); + p[40] = GetProcAddress(hL, "_BinkControlPlatformFeatures@8"); + p[41] = GetProcAddress(hL, "_BinkBufferSetScale@12"); + p[42] = GetProcAddress(hL, "_BinkBufferCheckWinPos@12"); + p[43] = GetProcAddress(hL, "_BinkLogoAddress@0"); + p[44] = GetProcAddress(hL, "_BinkBufferClose@4"); + p[45] = GetProcAddress(hL, "_BinkOpen@8"); + p[46] = GetProcAddress(hL, "_BinkGetTrackMaxSize@8"); + p[47] = GetProcAddress(hL, "_BinkDoFrame@4"); + p[48] = GetProcAddress(hL, "_BinkRequestStopAsyncThread@4"); + p[49] = GetProcAddress(hL, "_BinkSetFrameRate@8"); + p[50] = GetProcAddress(hL, "_BinkCopyToBufferRect@44"); + p[51] = GetProcAddress(hL, "_BinkGetPalette@4"); + p[52] = GetProcAddress(hL, "_BinkSetSoundSystem@8"); + p[53] = GetProcAddress(hL, "_BinkGetError@0"); + p[54] = GetProcAddress(hL, "_BinkSetSoundTrack@8"); + p[55] = GetProcAddress(hL, "_BinkSetPan@12"); + p[56] = GetProcAddress(hL, "_BinkSetVideoOnOff@8"); + p[57] = GetProcAddress(hL, "_BinkSetSoundOnOff@8"); + p[58] = GetProcAddress(hL, "_BinkBufferSetHWND@8"); + p[59] = GetProcAddress(hL, "_BinkBufferUnlock@4"); + p[60] = GetProcAddress(hL, "_BinkGetTrackType@8"); + p[61] = GetProcAddress(hL, "_BinkBufferLock@4"); + p[62] = GetProcAddress(hL, "_BinkSetSimulate@4"); + p[63] = GetProcAddress(hL, "_BinkWaitStopAsyncThread@4"); + p[64] = GetProcAddress(hL, "_BinkOpenMiles@4"); + p[65] = GetProcAddress(hL, "_BinkService@4"); + p[66] = GetProcAddress(hL, "_BinkDDSurfaceType@4"); + p[67] = GetProcAddress(hL, "_BinkGetTrackID@8"); + p[68] = GetProcAddress(hL, "_BinkDX9SurfaceType@4"); + p[69] = GetProcAddress(hL, "_BinkOpenDirectSound@4"); + p[70] = GetProcAddress(hL, "_BinkSetMixBinVolumes@20"); + p[71] = GetProcAddress(hL, "_BinkSetIOSize@4"); + //make sure we loaded all the pointers correctly (except for p[10], we don't need that) + for (int i = 0; i < 72; i++) { + if (i == 10) continue; + if (!p[i]) { + MessageBox(0, "Wrong version of binkw23.dll! Make sure you're using the GOG version of the game.\n\nThe game will continue but it may not work properly", "WH:MOC Performance Fix - Error", MB_OK | MB_ICONWARNING); + return; + } + } +} + +DWORD WINAPI MainThread(LPVOID lpParam){ + LoadOriginalBink(); + PatchGame(); + LoadASImods(); + return 0; +} + +extern "C" BOOL WINAPI DllMain(HINSTANCE hInst, DWORD reason, LPVOID) +{ + if (reason == DLL_PROCESS_ATTACH) + { + DWORD dwThreadId, dwThrdParam = 1; + HANDLE hThread; + hThread = CreateThread(NULL, 0, MainThread, &dwThrdParam, 0, &dwThreadId); + } + if (reason == DLL_PROCESS_DETACH) + FreeLibrary(hL); + return TRUE; +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkStartAsyncThread(int a, int b) +{ +__asm +{ + jmp p[0 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkBufferOpen(int a, int b, int c, int d) +{ +__asm +{ + jmp p[1 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkWait(int a) +{ +__asm +{ + jmp p[2 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkBufferSetOffset(int a, int b, int c) +{ +__asm +{ + jmp p[3 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkRegisterFrameBuffers(int a, int b) +{ +__asm +{ + jmp p[4 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkSetIO(int a) +{ +__asm +{ + jmp p[5 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkShouldSkip(int a) +{ +__asm +{ + jmp p[6 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkClose(int a) +{ +__asm +{ + jmp p[7 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkGetRealtime(int a, int b, int c) +{ +__asm +{ + jmp p[8 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkSetError(int a) +{ +__asm +{ + jmp p[9 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkBufferGetError() +{ +__asm +{ + jmp p[11 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkGetTrackData(int a, int b) +{ +__asm +{ + jmp p[12 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkOpenWaveOut(int a) +{ +__asm +{ + jmp p[13 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkDoFrameAsync(int a, int b, int c) +{ +__asm +{ + jmp p[14 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkBufferSetDirectDraw(int a, int b) +{ +__asm +{ + jmp p[15 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkGetKeyFrame(int a, int b, int c) +{ +__asm +{ + jmp p[16 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkSetMixBins(int a, int b, int c, int d) +{ +__asm +{ + jmp p[17 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkSetVolume(int a, int b, int c) +{ +__asm +{ + jmp p[18 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkSetMemory(int a, int b) +{ +__asm +{ + jmp p[19 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkBufferGetDescription(int a) +{ +__asm +{ + jmp p[20 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkCheckCursor(int a, int b, int c, int d, int e) +{ +__asm +{ + jmp p[21 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkDX8SurfaceType(int a) +{ +__asm +{ + jmp p[22 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall RADTimerRead() +{ +__asm +{ + jmp p[23 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkNextFrame(int a) +{ +__asm +{ + jmp p[24 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkGetRects(int a, int b) +{ +__asm +{ + jmp p[25 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkCopyToBuffer(int a, int b, int c, int d, int e, int f, int g) +{ +__asm +{ + jmp p[26 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkBufferClear(int a, int b) +{ +__asm +{ + jmp p[27 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkRestoreCursor(int a) +{ +__asm +{ + jmp p[28 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkPause(int a, int b) +{ +__asm +{ + jmp p[29 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkDoFrameAsyncWait(int a, int b) +{ +__asm +{ + jmp p[30 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkOpenTrack(int a, int b) +{ +__asm +{ + jmp p[31 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkBufferBlit(int a, int b, int c) +{ +__asm +{ + jmp p[32 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkGoto(int a, int b, int c) +{ +__asm +{ + jmp p[33 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkControlBackgroundIO(int a, int b) +{ +__asm +{ + jmp p[34 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkCloseTrack(int a) +{ +__asm +{ + jmp p[35 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkBufferSetResolution(int a, int b, int c) +{ +__asm +{ + jmp p[36 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkIsSoftwareCursor(int a, int b) +{ +__asm +{ + jmp p[37 * 4]; +} +} + + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkGetSummary(int a, int b) +{ +__asm +{ + jmp p[38 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkGetFrameBuffersInfo(int a, int b) +{ +__asm +{ + jmp p[39 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkControlPlatformFeatures(int a, int b) +{ +__asm +{ + jmp p[40 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkBufferSetScale(int a, int b, int c) +{ +__asm +{ + jmp p[41 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkBufferCheckWinPos(int a, int b, int c) +{ +__asm +{ + jmp p[42 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkLogoAddress() +{ +__asm +{ + jmp p[43 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkBufferClose(int a) +{ +__asm +{ + jmp p[44 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkOpen(int a, int b) +{ +__asm +{ + jmp p[45 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkGetTrackMaxSize(int a, int b) +{ +__asm +{ + jmp p[46 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkDoFrame(int a) +{ +__asm +{ + jmp p[47 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkRequestStopAsyncThread(int a) +{ +__asm +{ + jmp p[48 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkSetFrameRate(int a, int b) +{ +__asm +{ + jmp p[49 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkCopyToBufferRect(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k) +{ +__asm +{ + jmp p[50 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkGetPalette(int a) +{ +__asm +{ + jmp p[51 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkSetSoundSystem(int a, int b) +{ +__asm +{ + jmp p[52 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkGetError() +{ +__asm +{ + jmp p[53 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkSetSoundTrack(int a, int b) +{ +__asm +{ + jmp p[54 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkSetPan(int a, int b, int c) +{ +__asm +{ + jmp p[55 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkSetVideoOnOff(int a, int b) +{ +__asm +{ + jmp p[56 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkSetSoundOnOff(int a, int b) +{ +__asm +{ + jmp p[57 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkBufferSetHWND(int a, int b) +{ +__asm +{ + jmp p[58 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkBufferUnlock(int a) +{ +__asm +{ + jmp p[59 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkGetTrackType(int a, int b) +{ +__asm +{ + jmp p[60 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkBufferLock(int a) +{ +__asm +{ + jmp p[61 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkSetSimulate(int a) +{ +__asm +{ + jmp p[62 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkWaitStopAsyncThread(int a) +{ +__asm +{ + jmp p[63 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkOpenMiles(int a) +{ +__asm +{ + jmp p[64 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkService(int a) +{ +__asm +{ + jmp p[65 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkDDSurfaceType(int a) +{ +__asm +{ + jmp p[66 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkGetTrackID(int a, int b) +{ +__asm +{ + jmp p[67 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkDX9SurfaceType(int a) +{ +__asm +{ + jmp p[68 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkOpenDirectSound(int a) +{ +__asm +{ + jmp p[69 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkSetMixBinVolumes(int a, int b, int c, int d, int e) +{ +__asm +{ + jmp p[70 * 4]; +} +} + +extern "C" __declspec(dllexport) __declspec(naked) void __stdcall BinkSetIOSize(int a) +{ +__asm +{ + jmp p[71 * 4]; +} +}