From 4e0218b24a88d4d55db5d33a3ae5a253be49f530 Mon Sep 17 00:00:00 2001 From: Joaquin <67109235+Taiga74164@users.noreply.github.com> Date: Thu, 7 Mar 2024 01:52:54 -0700 Subject: [PATCH] init --- .gitignore | 6 + Core/Core.cpp | 264 +++++++++++ Core/Core.h | 41 ++ Exports/Exports.cpp | 25 + Exports/Exports.def | 266 +++++++++++ Exports/Exports.h | 39 ++ Exports/Resources.h | 311 ++++++++++++ Exports/psapi.asm | 172 +++++++ Exports/version.asm | 112 +++++ Exports/winhttp.asm | 400 ++++++++++++++++ Exports/winmm.asm | 1096 +++++++++++++++++++++++++++++++++++++++++++ HD2Cheeto.rc | 106 +++++ HD2Cheeto.sln | 22 + HD2Cheeto.vcxproj | 93 ++++ Memory.cpp | 135 ++++++ Memory.h | 23 + README.md | 24 + Utils.cpp | 159 +++++++ Utils.h | 34 ++ dllmain.cpp | 13 + resource.h | 16 + 21 files changed, 3357 insertions(+) create mode 100644 .gitignore create mode 100644 Core/Core.cpp create mode 100644 Core/Core.h create mode 100644 Exports/Exports.cpp create mode 100644 Exports/Exports.def create mode 100644 Exports/Exports.h create mode 100644 Exports/Resources.h create mode 100644 Exports/psapi.asm create mode 100644 Exports/version.asm create mode 100644 Exports/winhttp.asm create mode 100644 Exports/winmm.asm create mode 100644 HD2Cheeto.rc create mode 100644 HD2Cheeto.sln create mode 100644 HD2Cheeto.vcxproj create mode 100644 Memory.cpp create mode 100644 Memory.h create mode 100644 README.md create mode 100644 Utils.cpp create mode 100644 Utils.h create mode 100644 dllmain.cpp create mode 100644 resource.h diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..01980b9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.vs/ +.idea/ +x64/ +Release/ +*.vcxproj.* +*.aps diff --git a/Core/Core.cpp b/Core/Core.cpp new file mode 100644 index 0000000..5293474 --- /dev/null +++ b/Core/Core.cpp @@ -0,0 +1,264 @@ +#include "Core.h" +#include +#include +#include +#include + +#include "Memory.h" + +Core::Cheat cheat; + +void Core::InitializeCheat() +{ + auto gameHandle = reinterpret_cast(GetModuleHandleA("game.dll")); + + LOG("[HD2Cheeto] Found game handle! Getting module information..."); + + MODULEINFO moduleInfo; + bool success = GetModuleInformation(GetCurrentProcess(), (HMODULE)gameHandle, &moduleInfo, sizeof(moduleInfo)); + if (!success) + { + LOG("[HD2Cheeto] Failed to get module information. Stopping..."); + return; + } + + cheat.baseAddress = gameHandle; + cheat.size = moduleInfo.SizeOfImage; + + LOG("[HD2Cheeto] Found game.dll at base address 0x%s, size %s.", std::format("{:X}", cheat.baseAddress), std::to_string(cheat.size)); + + cheat.infGrenades = Memory::PatternScan(gameHandle, "41 ff 08 4a 8b 84 ed"); + cheat.infAmmo = Memory::PatternScan(gameHandle, "41 83 2c c2"); + cheat.infSyringe = Memory::PatternScan(gameHandle, "41 ff cf 3b c2 74 ?"); + cheat.infStamine = Memory::PatternScan(gameHandle, "f3 41 0f 11 08 8b 48 ? e8 ? ? ? ? 41 8b 47"); + cheat.infMissionTime = Memory::PatternScan(gameHandle, "f3 43 0f 11 84 f4"); + cheat.infHealthCheck = Memory::PatternScan(gameHandle, "41 bf ? ? ? ? 41 3b df 7c"); + cheat.infHealth = Memory::PatternScan(gameHandle, "45 89 38 49 8b 84 de"); + cheat.infStrategems = Memory::PatternScan(gameHandle, "48 03 48 ? 48 89 8c 37 ? ? ? ? 8b 8c 37 ? ? ? ? 8d 41 ? 83 f8 ? 77 ? 8d 41 ? 89 84 37 ? ? ? ? 45 33 c9"); + // fn: 40 55 48 83 ec ? 3b 15 ? ? ? ? 41 8b e8 4c 8b 15 ? ? ? ? 0f 84 ? ? ? ? 45 8b 8a ? ? ? ? 45 33 c0 45 8b 9a ? ? ? ? 48 89 5c 24 ? 48 89 74 24 ? 44 0f af da 41 8d 71 ? 48 89 7c 24 ? 45 85 c9 74 ? 49 8b 9a ? ? ? ? 41 8b ba ? ? ? ? 66 0f 1f 84 00 ? ? ? ? 8b c6 43 8d 0c 18 48 23 c8 48 8d 04 cb 8b 0c cb 3b cf 74 ? 3b ca 74 ? 41 ff c0 45 3b c1 72 ? 33 c0 48 8b 7c 24 ? 48 8b 74 24 ? 48 8b 5c 24 ? 39 10 75 ? 8b 40 ? eb ? b8 ? ? ? ? 8b c8 ba + // last mov [r8],ebp + cheat.noReload = Memory::PatternScan(gameHandle, "41 89 28 49 8B 84 CA 28 20 00 00 8B 48 10"); + //cheat.noRecoil = Memory::PatternScan(gameHandle, "75 ? 45 8b c7 8b d3"); + //cheat.checkIsBlipSeen = Memory::PatternScan(gameHandle, "41 0f b6 44 97"); + //cheat.checkIfAlienHivesAreObstructed = Memory::PatternScan(gameHandle, "41 80 be ? ? ? ? ? 0f 85 ? ? ? ? 80 be"); + //cheat.checkIfMinorInterestBlipIsDiscovered = Memory::PatternScan(gameHandle, "0f 85 ? ? ? ? 48 8b 44 24 ? 80 78 ? ? 0f 84 ? ? ? ? f3 0f 5c 7d"); + //cheat.getMinorInterestBlipIcon = Memory::PatternScan(gameHandle, "0f 84 ? ? ? ? 48 8b 4c 24 ? f3 41 0f 10 4f"); + //cheat.checkMissionBlip = Memory::PatternScan(gameHandle, "0f 85 ? ? ? ? 49 8d b8"); +} + +void Core::Start() +{ + while (!GetModuleHandleA("game.dll")) + { + LOG("[HD2Cheeto] game handle not found, waiting 3 seconds..."); + Sleep(3000); + } + + InitializeCheat(); + + LOG("[HD2Cheeto] Press F1 to activate all cheats"); + LOG("[HD2Cheeto] Press F2 to deactivate all cheats"); + + while (true) + { + if (GetAsyncKeyState(VK_F1) & 0x8000 && !cheat.cheatsEnabled) + { + // Infinite Grenades + Memory::NopBytes((void*)cheat.infGrenades, 3); + + // Infinite Ammo + Memory::PatchBytes((void*)(cheat.infAmmo + 4), "\x00"); + + // Infinite Syringe + Memory::NopBytes((void*)cheat.infSyringe, 3); + + // Infinite Stamina + Memory::NopBytes((void*)cheat.infStamine, 5); + + // Infinite Mission Time + Memory::NopBytes((void*)cheat.infMissionTime, 10); + + // Infinite Health + Memory::PatchBytes((void*)cheat.infHealthCheck, "\x41\xBF\x0F\x27\x00\x00"); + Memory::PatchBytes((void*)(cheat.infHealthCheck + 9), "\x75\x2B"); + Memory::NopBytes((void*)cheat.infHealth, 3); + + // Infinite Strategems + Memory::NopBytes((void*)cheat.infStrategems, 4); + Memory::PatchBytes((void*)(cheat.infStrategems + 0xC), "\x8B\x8C\x3E\xD0\x01\x00\x00"); + Memory::PatchBytes((void*)(cheat.infStrategems + 0x13), "\x8D\x01\x90"); + Memory::PatchBytes((void*)(cheat.infStrategems + 0x1E), "\x89\x84\x3E\xD0\x01\x00\x00"); + Memory::PatchBytes((void*)(cheat.infStrategems + 0x1b), "\x8D\x01\x90"); + + // No Reload + Memory::NopBytes((void*)cheat.noReload, 3); + + // No Recoil + //Memory::PatchBytes((void*)cheat.noRecoil, "\x74"); + + // Show Map Icons + //Memory::PatchBytes((void*)cheat.checkIsBlipSeen, "\xB8\x01\x00\x00\x00\x90"); + //Memory::PatchBytes((void*)cheat.checkIfAlienHivesAreObstructed, "\xF8\x90\x90\x90\x90\x90\x90\x90"); + //Memory::PatchBytes((void*)cheat.checkIfMinorInterestBlipIsDiscovered, "\x90\xE9"); + //Memory::PatchBytes((void*)cheat.getMinorInterestBlipIcon, "\xEB\x09"); + //Memory::PatchBytes((void*)cheat.checkMissionBlip, "\x90\xE9"); + + LOG("[HD2Cheeto] All Cheats enabled!"); + + cheat.cheatsEnabled = true; + } + else if (GetAsyncKeyState(VK_F2) & 0x8000 && cheat.cheatsEnabled) + { + Memory::RestoreBytes((void*)cheat.infGrenades); + + Memory::RestoreBytes((void*)cheat.infAmmo); + + Memory::RestoreBytes((void*)cheat.infSyringe); + + Memory::RestoreBytes((void*)cheat.infStamine); + + Memory::RestoreBytes((void*)cheat.infMissionTime); + + Memory::RestoreBytes((void*)cheat.infHealthCheck); + Memory::RestoreBytes((void*)cheat.infHealth); + Memory::RestoreBytes((void*)cheat.infStrategems); + + Memory::RestoreBytes((void*)cheat.noReload); + + //Memory::RestoreBytes((void*)cheat.noRecoil); + + //Memory::RestoreBytes((void*)cheat.checkIsBlipSeen); + //Memory::RestoreBytes((void*)cheat.checkIfAlienHivesAreObstructed); + //Memory::RestoreBytes((void*)cheat.checkIfMinorInterestBlipIsDiscovered); + //Memory::RestoreBytes((void*)cheat.getMinorInterestBlipIcon); + //Memory::RestoreBytes((void*)cheat.checkMissionBlip); + + LOG("[HD2Cheeto] All Cheats disabled!"); + + cheat.cheatsEnabled = false; + } + + Sleep(100); + } +} + +#pragma region Initialization and DLL proxy stuff + +void Core::Initialize(HINSTANCE hModule) +{ + if (Utils::GetCurrentProcessNameA().find("helldivers2") == std::string::npos) return; + + Utils::AttachConsole(); + + LOG("[HD2Cheeto] Initializing..."); + // Get execution path + std::vector pathBuf; + DWORD copied = 0; + do + { + pathBuf.resize(pathBuf.size() + MAX_PATH); + copied = GetModuleFileNameA(nullptr, pathBuf.data(), static_cast(pathBuf.size())); + } + while (copied >= pathBuf.size()); + + pathBuf.resize(copied); + + const std::filesystem::path filepath(pathBuf.begin(), pathBuf.end()); + + // Get file path of proxy, tolowercase the file name + const auto proxyFilepath = GetModuleFilePath(hModule); + auto ProxyFilename = proxyFilepath.filename().wstring(); + std::transform(ProxyFilename.begin(), ProxyFilename.end(), ProxyFilename.begin(), towlower); + + // Make proxy name list + std::wstring names; + bool _1 = true; + for(auto name : Exports::CompatibleFileNames) + { + if (_1) + { + _1 = false; + names += name; + } + else + { + names += L", "; + names += name; + } + } + + // Check if is compatible proxy + std::size_t index = -1; + if (!Exports::IsFileNameCompatible(ProxyFilename, &index)) + { + Error(L"Proxy has an incompatible file name!\nValid names are: " + names + L"\n", true); + return; + } + + // Load original libs + const HMODULE originalDll = LoadOriginalProxy(proxyFilepath, proxyFilepath.filename().stem().wstring()); + if (!originalDll) + { + Error(L"Failed to Load original " + proxyFilepath.wstring() + L"!", true); + return; + } + + // Load original lib exports + Exports::Load(index, originalDll); + + CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)Start, hModule, 0, nullptr); + + LOG("[HD2Cheeto] Created Thread."); +} + +HMODULE Core::LoadOriginalProxy(const std::filesystem::path& proxyFilepath, const std::wstring& proxyFilepathNoExt) +{ + HMODULE originalDll = LoadLibraryW((proxyFilepathNoExt + L"_original.dll").c_str()); + + if (!originalDll) + { + wchar_t system32_path[MAX_PATH]; + + if (GetSystemDirectoryW(system32_path, MAX_PATH) == NULL) + { + Error("Failed to get System32 directory!"); + KillProcess(); + return nullptr; + } + + const auto path = std::filesystem::path(system32_path); + originalDll = LoadLibraryW((path / proxyFilepath.filename()).c_str()); + } + + return originalDll; +} + +std::filesystem::path Core::GetModuleFilePath(HMODULE moduleHandle) +{ + wchar_t path[MAX_PATH]; + GetModuleFileNameW(moduleHandle, path, MAX_PATH); + return path; +} + +void Core::Error(const std::string& reason, const bool shouldKill) +{ + MessageBoxA(nullptr, (reason + " " + (shouldKill ? "Preventing Startup" : "Continuing without HD2Cheeto") + "...").c_str(), "HD2Cheeto", + MB_ICONERROR | MB_OK); + if (shouldKill) KillProcess(); +} + +void Core::Error(const std::wstring& reason, const bool shouldKill) +{ + MessageBoxW(nullptr, (reason + L" " + (shouldKill ? L"Preventing Startup" : L"Continuing without HD2Cheeto") + L"...").c_str(), L"HD2Cheeto", + MB_ICONERROR | MB_OK); + if (shouldKill) KillProcess(); +} + +void Core::KillProcess() +{ + const HANDLE current_process = GetCurrentProcess(); + TerminateProcess(current_process, NULL); + CloseHandle(current_process); +} + +#pragma endregion diff --git a/Core/Core.h b/Core/Core.h new file mode 100644 index 0000000..1784b65 --- /dev/null +++ b/Core/Core.h @@ -0,0 +1,41 @@ +#pragma once +#include +#include + +class Core +{ +public: + struct Cheat { + uintptr_t baseAddress; + size_t size; + + uintptr_t infGrenades; + uintptr_t infAmmo; + uintptr_t infSyringe; + uintptr_t infStamine; + uintptr_t infMissionTime; + uintptr_t infHealthCheck; + uintptr_t infHealth; + uintptr_t infStrategems; + uintptr_t noReload; + uintptr_t noRecoil; + uintptr_t checkIsBlipSeen; + uintptr_t checkIfAlienHivesAreObstructed; + uintptr_t checkIfMinorInterestBlipIsDiscovered; + uintptr_t getMinorInterestBlipIcon; + uintptr_t checkMissionBlip; + + bool cheatsEnabled = false; + }; + + static void Initialize(HINSTANCE hModule); + static void Start(); + static void InitializeCheat(); +private: + static HMODULE LoadOriginalProxy(const std::filesystem::path& proxyFilepath, const std::wstring& proxyFilepathNoExt); + static std::filesystem::path GetModuleFilePath(HMODULE moduleHandle); + + static void Error(const std::string& reason, bool shouldKill = false); + static void Error(const std::wstring& reason, bool shouldKill = false); + static void KillProcess(); +}; \ No newline at end of file diff --git a/Exports/Exports.cpp b/Exports/Exports.cpp new file mode 100644 index 0000000..24308a0 --- /dev/null +++ b/Exports/Exports.cpp @@ -0,0 +1,25 @@ +#include "Exports.h" + +FARPROC OriginalFuncs_psapi[27]; +FARPROC OriginalFuncs_version[17]; +FARPROC OriginalFuncs_winhttp[65]; +FARPROC OriginalFuncs_winmm[181]; + +bool Exports::IsFileNameCompatible(const std::wstring& proxyFilename, std::size_t* index) +{ + for (std::size_t i = 0; i < CompatibleFileNames.size(); ++i) + { + if (proxyFilename == CompatibleFileNames[i]) + { + *index = i; + return true; + } + } + + return false; +} + +void Exports::Load(HMODULE originalDll, const char* const* exportNames, FARPROC* originalFuncs, std::size_t arraySize) +{ + for (std::size_t i = 0; i < arraySize; i++) originalFuncs[i] = GetProcAddress(originalDll, exportNames[i]); +} diff --git a/Exports/Exports.def b/Exports/Exports.def new file mode 100644 index 0000000..e274da2 --- /dev/null +++ b/Exports/Exports.def @@ -0,0 +1,266 @@ +EXPORTS + GetFileVersionInfoA + GetFileVersionInfoByHandle + GetFileVersionInfoExA + GetFileVersionInfoExW + GetFileVersionInfoSizeA + GetFileVersionInfoSizeExA + GetFileVersionInfoSizeExW + GetFileVersionInfoSizeW + GetFileVersionInfoW + VerFindFileA + VerFindFileW + VerInstallFileA + VerInstallFileW + VerLanguageNameA + VerLanguageNameW + VerQueryValueA + VerQueryValueW + + Private1 + SvchostPushServiceGlobals + WinHttpAddRequestHeaders + WinHttpAutoProxySvcMain + WinHttpCheckPlatform + WinHttpCloseHandle + WinHttpConnect + WinHttpConnectionDeletePolicyEntries + WinHttpConnectionDeleteProxyInfo + WinHttpConnectionFreeNameList + WinHttpConnectionFreeProxyInfo + WinHttpConnectionFreeProxyList + WinHttpConnectionGetNameList + WinHttpConnectionGetProxyInfo + WinHttpConnectionGetProxyList + WinHttpConnectionSetPolicyEntries + WinHttpConnectionSetProxyInfo + WinHttpConnectionUpdateIfIndexTable + WinHttpCrackUrl + WinHttpCreateProxyResolver + WinHttpCreateUrl + WinHttpDetectAutoProxyConfigUrl + WinHttpFreeProxyResult + WinHttpFreeProxyResultEx + WinHttpFreeProxySettings + WinHttpGetDefaultProxyConfiguration + WinHttpGetIEProxyConfigForCurrentUser + WinHttpGetProxyForUrl + WinHttpGetProxyForUrlEx + WinHttpGetProxyForUrlEx2 + WinHttpGetProxyForUrlHvsi + WinHttpGetProxyResult + WinHttpGetProxyResultEx + WinHttpGetProxySettingsVersion + WinHttpGetTunnelSocket + WinHttpOpen + WinHttpOpenRequest + WinHttpPacJsWorkerMain + WinHttpProbeConnectivity + WinHttpQueryAuthSchemes + WinHttpQueryDataAvailable + WinHttpQueryHeaders + WinHttpQueryOption + WinHttpReadData + WinHttpReadProxySettings + WinHttpReadProxySettingsHvsi + WinHttpReceiveResponse + WinHttpResetAutoProxy + WinHttpSaveProxyCredentials + WinHttpSendRequest + WinHttpSetCredentials + WinHttpSetDefaultProxyConfiguration + WinHttpSetOption + WinHttpSetStatusCallback + WinHttpSetTimeouts + WinHttpTimeFromSystemTime + WinHttpTimeToSystemTime + WinHttpWebSocketClose + WinHttpWebSocketCompleteUpgrade + WinHttpWebSocketQueryCloseStatus + WinHttpWebSocketReceive + WinHttpWebSocketSend + WinHttpWebSocketShutdown + WinHttpWriteData + WinHttpWriteProxySettings + + CloseDriver + DefDriverProc + DriverCallback + DrvGetModuleHandle + GetDriverModuleHandle + OpenDriver + PlaySound + PlaySoundA + PlaySoundW + SendDriverMessage + WOWAppExit + auxGetDevCapsA + auxGetDevCapsW + auxGetNumDevs + auxGetVolume + auxOutMessage + auxSetVolume + joyConfigChanged + joyGetDevCapsA + joyGetDevCapsW + joyGetNumDevs + joyGetPos + joyGetPosEx + joyGetThreshold + joyReleaseCapture + joySetCapture + joySetThreshold + mciDriverNotify + mciDriverYield + mciExecute + mciFreeCommandResource + mciGetCreatorTask + mciGetDeviceIDA + mciGetDeviceIDFromElementIDA + mciGetDeviceIDFromElementIDW + mciGetDeviceIDW + mciGetDriverData + mciGetErrorStringA + mciGetErrorStringW + mciGetYieldProc + mciLoadCommandResource + mciSendCommandA + mciSendCommandW + mciSendStringA + mciSendStringW + mciSetDriverData + mciSetYieldProc + midiConnect + midiDisconnect + midiInAddBuffer + midiInClose + midiInGetDevCapsA + midiInGetDevCapsW + midiInGetErrorTextA + midiInGetErrorTextW + midiInGetID + midiInGetNumDevs + midiInMessage + midiInOpen + midiInPrepareHeader + midiInReset + midiInStart + midiInStop + midiInUnprepareHeader + midiOutCacheDrumPatches + midiOutCachePatches + midiOutClose + midiOutGetDevCapsA + midiOutGetDevCapsW + midiOutGetErrorTextA + midiOutGetErrorTextW + midiOutGetID + midiOutGetNumDevs + midiOutGetVolume + midiOutLongMsg + midiOutMessage + midiOutOpen + midiOutPrepareHeader + midiOutReset + midiOutSetVolume + midiOutShortMsg + midiOutUnprepareHeader + midiStreamClose + midiStreamOpen + midiStreamOut + midiStreamPause + midiStreamPosition + midiStreamProperty + midiStreamRestart + midiStreamStop + mixerClose + mixerGetControlDetailsA + mixerGetControlDetailsW + mixerGetDevCapsA + mixerGetDevCapsW + mixerGetID + mixerGetLineControlsA + mixerGetLineControlsW + mixerGetLineInfoA + mixerGetLineInfoW + mixerGetNumDevs + mixerMessage + mixerOpen + mixerSetControlDetails + mmDrvInstall + mmGetCurrentTask + mmTaskBlock + mmTaskCreate + mmTaskSignal + mmTaskYield + mmioAdvance + mmioAscend + mmioClose + mmioCreateChunk + mmioDescend + mmioFlush + mmioGetInfo + mmioInstallIOProcA + mmioInstallIOProcW + mmioOpenA + mmioOpenW + mmioRead + mmioRenameA + mmioRenameW + mmioSeek + mmioSendMessage + mmioSetBuffer + mmioSetInfo + mmioStringToFOURCCA + mmioStringToFOURCCW + mmioWrite + mmsystemGetVersion + sndPlaySoundA + sndPlaySoundW + timeBeginPeriod + timeEndPeriod + timeGetDevCaps + timeGetSystemTime + timeGetTime + timeKillEvent + timeSetEvent + waveInAddBuffer + waveInClose + waveInGetDevCapsA + waveInGetDevCapsW + waveInGetErrorTextA + waveInGetErrorTextW + waveInGetID + waveInGetNumDevs + waveInGetPosition + waveInMessage + waveInOpen + waveInPrepareHeader + waveInReset + waveInStart + waveInStop + waveInUnprepareHeader + waveOutBreakLoop + waveOutClose + waveOutGetDevCapsA + waveOutGetDevCapsW + waveOutGetErrorTextA + waveOutGetErrorTextW + waveOutGetID + waveOutGetNumDevs + waveOutGetPitch + waveOutGetPlaybackRate + waveOutGetPosition + waveOutGetVolume + waveOutMessage + waveOutOpen + waveOutPause + waveOutPrepareHeader + waveOutReset + waveOutRestart + waveOutSetPitch + waveOutSetPlaybackRate + waveOutSetVolume + waveOutUnprepareHeader + waveOutWrite + ExportByOrdinal2 \ No newline at end of file diff --git a/Exports/Exports.h b/Exports/Exports.h new file mode 100644 index 0000000..2edfcc0 --- /dev/null +++ b/Exports/Exports.h @@ -0,0 +1,39 @@ +#pragma once +#include +#include +#include "Resources.h" + +extern "C" FARPROC OriginalFuncs_psapi[27]; +extern "C" FARPROC OriginalFuncs_version[17]; +extern "C" FARPROC OriginalFuncs_winhttp[65]; +extern "C" FARPROC OriginalFuncs_winmm[181]; + +namespace Exports +{ + inline constexpr std::array CompatibleFileNames = + { + L"psapi.dll", + L"version.dll", + L"winhttp.dll", + L"winmm.dll" + }; + + void Load(HMODULE originalDll, const char* const* exportNames, FARPROC* originalFuncs, std::size_t arraySize); + + inline void Load_psapi(const HMODULE originalDll) { Load(originalDll, ExportNames_psapi.data(), OriginalFuncs_psapi, ExportNames_psapi.size()); } + inline void Load_version(const HMODULE originalDll) { Load(originalDll, ExportNames_version.data(), OriginalFuncs_version, ExportNames_version.size()); } + inline void Load_winhttp(const HMODULE originalDll) { Load(originalDll, ExportNames_winhttp.data(), OriginalFuncs_winhttp, ExportNames_winhttp.size()); } + inline void Load_winmm(const HMODULE originalDll) { Load(originalDll, ExportNames_winmm.data(), OriginalFuncs_winmm, ExportNames_winmm.size()); } + + using load_exports_func = decltype(&Load_psapi); + inline constexpr std::array load_funcs = + { + Load_psapi, + Load_version, + Load_winhttp, + Load_winmm + }; + + constexpr void Load(const std::size_t index, const HMODULE originalDll) { load_funcs[index](originalDll); } + bool IsFileNameCompatible(const std::wstring& proxyFilename, std::size_t* index); +}; diff --git a/Exports/Resources.h b/Exports/Resources.h new file mode 100644 index 0000000..8e97b9b --- /dev/null +++ b/Exports/Resources.h @@ -0,0 +1,311 @@ +#pragma once +#include + +namespace Exports +{ + constexpr std::array ExportNames_winmm = + { + "CloseDriver", + "DefDriverProc", + "DriverCallback", + "DrvGetModuleHandle", + "GetDriverModuleHandle", + "OpenDriver", + "PlaySound", + "PlaySoundA", + "PlaySoundW", + "SendDriverMessage", + "WOWAppExit", + "auxGetDevCapsA", + "auxGetDevCapsW", + "auxGetNumDevs", + "auxGetVolume", + "auxOutMessage", + "auxSetVolume", + "joyConfigChanged", + "joyGetDevCapsA", + "joyGetDevCapsW", + "joyGetNumDevs", + "joyGetPos", + "joyGetPosEx", + "joyGetThreshold", + "joyReleaseCapture", + "joySetCapture", + "joySetThreshold", + "mciDriverNotify", + "mciDriverYield", + "mciExecute", + "mciFreeCommandResource", + "mciGetCreatorTask", + "mciGetDeviceIDA", + "mciGetDeviceIDFromElementIDA", + "mciGetDeviceIDFromElementIDW", + "mciGetDeviceIDW", + "mciGetDriverData", + "mciGetErrorStringA", + "mciGetErrorStringW", + "mciGetYieldProc", + "mciLoadCommandResource", + "mciSendCommandA", + "mciSendCommandW", + "mciSendStringA", + "mciSendStringW", + "mciSetDriverData", + "mciSetYieldProc", + "midiConnect", + "midiDisconnect", + "midiInAddBuffer", + "midiInClose", + "midiInGetDevCapsA", + "midiInGetDevCapsW", + "midiInGetErrorTextA", + "midiInGetErrorTextW", + "midiInGetID", + "midiInGetNumDevs", + "midiInMessage", + "midiInOpen", + "midiInPrepareHeader", + "midiInReset", + "midiInStart", + "midiInStop", + "midiInUnprepareHeader", + "midiOutCacheDrumPatches", + "midiOutCachePatches", + "midiOutClose", + "midiOutGetDevCapsA", + "midiOutGetDevCapsW", + "midiOutGetErrorTextA", + "midiOutGetErrorTextW", + "midiOutGetID", + "midiOutGetNumDevs", + "midiOutGetVolume", + "midiOutLongMsg", + "midiOutMessage", + "midiOutOpen", + "midiOutPrepareHeader", + "midiOutReset", + "midiOutSetVolume", + "midiOutShortMsg", + "midiOutUnprepareHeader", + "midiStreamClose", + "midiStreamOpen", + "midiStreamOut", + "midiStreamPause", + "midiStreamPosition", + "midiStreamProperty", + "midiStreamRestart", + "midiStreamStop", + "mixerClose", + "mixerGetControlDetailsA", + "mixerGetControlDetailsW", + "mixerGetDevCapsA", + "mixerGetDevCapsW", + "mixerGetID", + "mixerGetLineControlsA", + "mixerGetLineControlsW", + "mixerGetLineInfoA", + "mixerGetLineInfoW", + "mixerGetNumDevs", + "mixerMessage", + "mixerOpen", + "mixerSetControlDetails", + "mmDrvInstall", + "mmGetCurrentTask", + "mmTaskBlock", + "mmTaskCreate", + "mmTaskSignal", + "mmTaskYield", + "mmioAdvance", + "mmioAscend", + "mmioClose", + "mmioCreateChunk", + "mmioDescend", + "mmioFlush", + "mmioGetInfo", + "mmioInstallIOProcA", + "mmioInstallIOProcW", + "mmioOpenA", + "mmioOpenW", + "mmioRead", + "mmioRenameA", + "mmioRenameW", + "mmioSeek", + "mmioSendMessage", + "mmioSetBuffer", + "mmioSetInfo", + "mmioStringToFOURCCA", + "mmioStringToFOURCCW", + "mmioWrite", + "mmsystemGetVersion", + "sndPlaySoundA", + "sndPlaySoundW", + "timeBeginPeriod", + "timeEndPeriod", + "timeGetDevCaps", + "timeGetSystemTime", + "timeGetTime", + "timeKillEvent", + "timeSetEvent", + "waveInAddBuffer", + "waveInClose", + "waveInGetDevCapsA", + "waveInGetDevCapsW", + "waveInGetErrorTextA", + "waveInGetErrorTextW", + "waveInGetID", + "waveInGetNumDevs", + "waveInGetPosition", + "waveInMessage", + "waveInOpen", + "waveInPrepareHeader", + "waveInReset", + "waveInStart", + "waveInStop", + "waveInUnprepareHeader", + "waveOutBreakLoop", + "waveOutClose", + "waveOutGetDevCapsA", + "waveOutGetDevCapsW", + "waveOutGetErrorTextA", + "waveOutGetErrorTextW", + "waveOutGetID", + "waveOutGetNumDevs", + "waveOutGetPitch", + "waveOutGetPlaybackRate", + "waveOutGetPosition", + "waveOutGetVolume", + "waveOutMessage", + "waveOutOpen", + "waveOutPause", + "waveOutPrepareHeader", + "waveOutReset", + "waveOutRestart", + "waveOutSetPitch", + "waveOutSetPlaybackRate", + "waveOutSetVolume", + "waveOutUnprepareHeader", + "waveOutWrite", + "ExportByOrdinal2" + }; + + constexpr std::array ExportNames_winhttp = + { + "Private1", + "SvchostPushServiceGlobals", + "WinHttpAddRequestHeaders", + "WinHttpAutoProxySvcMain", + "WinHttpCheckPlatform", + "WinHttpCloseHandle", + "WinHttpConnect", + "WinHttpConnectionDeletePolicyEntries", + "WinHttpConnectionDeleteProxyInfo", + "WinHttpConnectionFreeNameList", + "WinHttpConnectionFreeProxyInfo", + "WinHttpConnectionFreeProxyList", + "WinHttpConnectionGetNameList", + "WinHttpConnectionGetProxyInfo", + "WinHttpConnectionGetProxyList", + "WinHttpConnectionSetPolicyEntries", + "WinHttpConnectionSetProxyInfo", + "WinHttpConnectionUpdateIfIndexTable", + "WinHttpCrackUrl", + "WinHttpCreateProxyResolver", + "WinHttpCreateUrl", + "WinHttpDetectAutoProxyConfigUrl", + "WinHttpFreeProxyResult", + "WinHttpFreeProxyResultEx", + "WinHttpFreeProxySettings", + "WinHttpGetDefaultProxyConfiguration", + "WinHttpGetIEProxyConfigForCurrentUser", + "WinHttpGetProxyForUrl", + "WinHttpGetProxyForUrlEx", + "WinHttpGetProxyForUrlEx2", + "WinHttpGetProxyForUrlHvsi", + "WinHttpGetProxyResult", + "WinHttpGetProxyResultEx", + "WinHttpGetProxySettingsVersion", + "WinHttpGetTunnelSocket", + "WinHttpOpen", + "WinHttpOpenRequest", + "WinHttpPacJsWorkerMain", + "WinHttpProbeConnectivity", + "WinHttpQueryAuthSchemes", + "WinHttpQueryDataAvailable", + "WinHttpQueryHeaders", + "WinHttpQueryOption", + "WinHttpReadData", + "WinHttpReadProxySettings", + "WinHttpReadProxySettingsHvsi", + "WinHttpReceiveResponse", + "WinHttpResetAutoProxy", + "WinHttpSaveProxyCredentials", + "WinHttpSendRequest", + "WinHttpSetCredentials", + "WinHttpSetDefaultProxyConfiguration", + "WinHttpSetOption", + "WinHttpSetStatusCallback", + "WinHttpSetTimeouts", + "WinHttpTimeFromSystemTime", + "WinHttpTimeToSystemTime", + "WinHttpWebSocketClose", + "WinHttpWebSocketCompleteUpgrade", + "WinHttpWebSocketQueryCloseStatus", + "WinHttpWebSocketReceive", + "WinHttpWebSocketSend", + "WinHttpWebSocketShutdown", + "WinHttpWriteData", + "WinHttpWriteProxySettings" + }; + + constexpr std::array ExportNames_version = + { + "GetFileVersionInfoA", + "GetFileVersionInfoByHandle", + "GetFileVersionInfoExA", + "GetFileVersionInfoExW", + "GetFileVersionInfoSizeA", + "GetFileVersionInfoSizeExA", + "GetFileVersionInfoSizeExW", + "GetFileVersionInfoSizeW", + "GetFileVersionInfoW", + "VerFindFileA", + "VerFindFileW", + "VerInstallFileA", + "VerInstallFileW", + "VerLanguageNameA", + "VerLanguageNameW", + "VerQueryValueA", + "VerQueryValueW" + }; + + constexpr std::array ExportNames_psapi = + { + "EmptyWorkingSet", + "EnumDeviceDrivers", + "EnumPageFilesA", + "EnumPageFilesW", + "EnumProcessModules", + "EnumProcessModulesEx", + "EnumProcesses", + "GetDeviceDriverBaseNameA", + "GetDeviceDriverBaseNameW", + "GetDeviceDriverFileNameA", + "GetDeviceDriverFileNameW", + "GetMappedFileNameA", + "GetMappedFileNameW", + "GetModuleBaseNameA", + "GetModuleBaseNameW", + "GetModuleFileNameExA", + "GetModuleFileNameExW", + "GetModuleInformation", + "GetPerformanceInfo", + "GetProcessImageFileNameA", + "GetProcessImageFileNameW", + "GetProcessMemoryInfo", + "GetWsChanges", + "GetWsChangesEx", + "InitializeProcessForWsWatch", + "QueryWorkingSet", + "QueryWorkingSetEx" + }; +} \ No newline at end of file diff --git a/Exports/psapi.asm b/Exports/psapi.asm new file mode 100644 index 0000000..4b31c8d --- /dev/null +++ b/Exports/psapi.asm @@ -0,0 +1,172 @@ +ifdef RAX + .code + extern OriginalFuncs_psapi:QWORD + EmptyWorkingSet proc + jmp QWORD ptr OriginalFuncs_psapi[0 * 8] + EmptyWorkingSet endp + EnumDeviceDrivers proc + jmp QWORD ptr OriginalFuncs_psapi[1 * 8] + EnumDeviceDrivers endp + EnumPageFilesA proc + jmp QWORD ptr OriginalFuncs_psapi[2 * 8] + EnumPageFilesA endp + EnumPageFilesW proc + jmp QWORD ptr OriginalFuncs_psapi[3 * 8] + EnumPageFilesW endp + EnumProcessModules proc + jmp QWORD ptr OriginalFuncs_psapi[4 * 8] + EnumProcessModules endp + EnumProcessModulesEx proc + jmp QWORD ptr OriginalFuncs_psapi[5 * 8] + EnumProcessModulesEx endp + EnumProcesses proc + jmp QWORD ptr OriginalFuncs_psapi[6 * 8] + EnumProcesses endp + GetDeviceDriverBaseNameA proc + jmp QWORD ptr OriginalFuncs_psapi[7 * 8] + GetDeviceDriverBaseNameA endp + GetDeviceDriverBaseNameW proc + jmp QWORD ptr OriginalFuncs_psapi[8 * 8] + GetDeviceDriverBaseNameW endp + GetDeviceDriverFileNameA proc + jmp QWORD ptr OriginalFuncs_psapi[9 * 8] + GetDeviceDriverFileNameA endp + GetDeviceDriverFileNameW proc + jmp QWORD ptr OriginalFuncs_psapi[10 * 8] + GetDeviceDriverFileNameW endp + GetMappedFileNameA proc + jmp QWORD ptr OriginalFuncs_psapi[11 * 8] + GetMappedFileNameA endp + GetMappedFileNameW proc + jmp QWORD ptr OriginalFuncs_psapi[12 * 8] + GetMappedFileNameW endp + GetModuleBaseNameA proc + jmp QWORD ptr OriginalFuncs_psapi[13 * 8] + GetModuleBaseNameA endp + GetModuleBaseNameW proc + jmp QWORD ptr OriginalFuncs_psapi[14 * 8] + GetModuleBaseNameW endp + GetModuleFileNameExA proc + jmp QWORD ptr OriginalFuncs_psapi[15 * 8] + GetModuleFileNameExA endp + GetModuleFileNameExW proc + jmp QWORD ptr OriginalFuncs_psapi[16 * 8] + GetModuleFileNameExW endp + GetModuleInformation proc + jmp QWORD ptr OriginalFuncs_psapi[17 * 8] + GetModuleInformation endp + GetPerformanceInfo proc + jmp QWORD ptr OriginalFuncs_psapi[18 * 8] + GetPerformanceInfo endp + GetProcessImageFileNameA proc + jmp QWORD ptr OriginalFuncs_psapi[19 * 8] + GetProcessImageFileNameA endp + GetProcessImageFileNameW proc + jmp QWORD ptr OriginalFuncs_psapi[20 * 8] + GetProcessImageFileNameW endp + GetProcessMemoryInfo proc + jmp QWORD ptr OriginalFuncs_psapi[21 * 8] + GetProcessMemoryInfo endp + GetWsChanges proc + jmp QWORD ptr OriginalFuncs_psapi[22 * 8] + GetWsChanges endp + GetWsChangesEx proc + jmp QWORD ptr OriginalFuncs_psapi[23 * 8] + GetWsChangesEx endp + InitializeProcessForWsWatch proc + jmp QWORD ptr OriginalFuncs_psapi[24 * 8] + InitializeProcessForWsWatch endp + QueryWorkingSet proc + jmp QWORD ptr OriginalFuncs_psapi[25 * 8] + QueryWorkingSet endp + QueryWorkingSetEx proc + jmp QWORD ptr OriginalFuncs_psapi[26 * 8] + QueryWorkingSetEx endp +else + .model flat, C + .stack 4096 + .code + extern OriginalFuncs_psapi:DWORD + EmptyWorkingSet proc + jmp DWORD ptr OriginalFuncs_psapi[0 * 4] + EmptyWorkingSet endp + EnumDeviceDrivers proc + jmp DWORD ptr OriginalFuncs_psapi[1 * 4] + EnumDeviceDrivers endp + EnumPageFilesA proc + jmp DWORD ptr OriginalFuncs_psapi[2 * 4] + EnumPageFilesA endp + EnumPageFilesW proc + jmp DWORD ptr OriginalFuncs_psapi[3 * 4] + EnumPageFilesW endp + EnumProcessModules proc + jmp DWORD ptr OriginalFuncs_psapi[4 * 4] + EnumProcessModules endp + EnumProcessModulesEx proc + jmp DWORD ptr OriginalFuncs_psapi[5 * 4] + EnumProcessModulesEx endp + EnumProcesses proc + jmp DWORD ptr OriginalFuncs_psapi[6 * 4] + EnumProcesses endp + GetDeviceDriverBaseNameA proc + jmp DWORD ptr OriginalFuncs_psapi[7 * 4] + GetDeviceDriverBaseNameA endp + GetDeviceDriverBaseNameW proc + jmp DWORD ptr OriginalFuncs_psapi[8 * 4] + GetDeviceDriverBaseNameW endp + GetDeviceDriverFileNameA proc + jmp DWORD ptr OriginalFuncs_psapi[9 * 4] + GetDeviceDriverFileNameA endp + GetDeviceDriverFileNameW proc + jmp DWORD ptr OriginalFuncs_psapi[10 * 4] + GetDeviceDriverFileNameW endp + GetMappedFileNameA proc + jmp DWORD ptr OriginalFuncs_psapi[11 * 4] + GetMappedFileNameA endp + GetMappedFileNameW proc + jmp DWORD ptr OriginalFuncs_psapi[12 * 4] + GetMappedFileNameW endp + GetModuleBaseNameA proc + jmp DWORD ptr OriginalFuncs_psapi[13 * 4] + GetModuleBaseNameA endp + GetModuleBaseNameW proc + jmp DWORD ptr OriginalFuncs_psapi[14 * 4] + GetModuleBaseNameW endp + GetModuleFileNameExA proc + jmp DWORD ptr OriginalFuncs_psapi[15 * 4] + GetModuleFileNameExA endp + GetModuleFileNameExW proc + jmp DWORD ptr OriginalFuncs_psapi[16 * 4] + GetModuleFileNameExW endp + GetModuleInformation proc + jmp DWORD ptr OriginalFuncs_psapi[17 * 4] + GetModuleInformation endp + GetPerformanceInfo proc + jmp DWORD ptr OriginalFuncs_psapi[18 * 4] + GetPerformanceInfo endp + GetProcessImageFileNameA proc + jmp DWORD ptr OriginalFuncs_psapi[19 * 4] + GetProcessImageFileNameA endp + GetProcessImageFileNameW proc + jmp DWORD ptr OriginalFuncs_psapi[20 * 4] + GetProcessImageFileNameW endp + GetProcessMemoryInfo proc + jmp DWORD ptr OriginalFuncs_psapi[21 * 4] + GetProcessMemoryInfo endp + GetWsChanges proc + jmp DWORD ptr OriginalFuncs_psapi[22 * 4] + GetWsChanges endp + GetWsChangesEx proc + jmp DWORD ptr OriginalFuncs_psapi[23 * 4] + GetWsChangesEx endp + InitializeProcessForWsWatch proc + jmp DWORD ptr OriginalFuncs_psapi[24 * 4] + InitializeProcessForWsWatch endp + QueryWorkingSet proc + jmp DWORD ptr OriginalFuncs_psapi[25 * 4] + QueryWorkingSet endp + QueryWorkingSetEx proc + jmp DWORD ptr OriginalFuncs_psapi[26 * 4] + QueryWorkingSetEx endp +endif +end \ No newline at end of file diff --git a/Exports/version.asm b/Exports/version.asm new file mode 100644 index 0000000..91f6bee --- /dev/null +++ b/Exports/version.asm @@ -0,0 +1,112 @@ +ifdef RAX + .code + extern OriginalFuncs_version:QWORD + GetFileVersionInfoA proc + jmp QWORD ptr OriginalFuncs_version[0 * 8] + GetFileVersionInfoA endp + GetFileVersionInfoByHandle proc + jmp QWORD ptr OriginalFuncs_version[1 * 8] + GetFileVersionInfoByHandle endp + GetFileVersionInfoExA proc + jmp QWORD ptr OriginalFuncs_version[2 * 8] + GetFileVersionInfoExA endp + GetFileVersionInfoExW proc + jmp QWORD ptr OriginalFuncs_version[3 * 8] + GetFileVersionInfoExW endp + GetFileVersionInfoSizeA proc + jmp QWORD ptr OriginalFuncs_version[4 * 8] + GetFileVersionInfoSizeA endp + GetFileVersionInfoSizeExA proc + jmp QWORD ptr OriginalFuncs_version[5 * 8] + GetFileVersionInfoSizeExA endp + GetFileVersionInfoSizeExW proc + jmp QWORD ptr OriginalFuncs_version[6 * 8] + GetFileVersionInfoSizeExW endp + GetFileVersionInfoSizeW proc + jmp QWORD ptr OriginalFuncs_version[7 * 8] + GetFileVersionInfoSizeW endp + GetFileVersionInfoW proc + jmp QWORD ptr OriginalFuncs_version[8 * 8] + GetFileVersionInfoW endp + VerFindFileA proc + jmp QWORD ptr OriginalFuncs_version[9 * 8] + VerFindFileA endp + VerFindFileW proc + jmp QWORD ptr OriginalFuncs_version[10 * 8] + VerFindFileW endp + VerInstallFileA proc + jmp QWORD ptr OriginalFuncs_version[11 * 8] + VerInstallFileA endp + VerInstallFileW proc + jmp QWORD ptr OriginalFuncs_version[12 * 8] + VerInstallFileW endp + VerLanguageNameA proc + jmp QWORD ptr OriginalFuncs_version[13 * 8] + VerLanguageNameA endp + VerLanguageNameW proc + jmp QWORD ptr OriginalFuncs_version[14 * 8] + VerLanguageNameW endp + VerQueryValueA proc + jmp QWORD ptr OriginalFuncs_version[15 * 8] + VerQueryValueA endp + VerQueryValueW proc + jmp QWORD ptr OriginalFuncs_version[16 * 8] + VerQueryValueW endp +else + .model flat, C + .stack 4096 + .code + extern OriginalFuncs_version:DWORD + GetFileVersionInfoA proc + jmp DWORD ptr OriginalFuncs_version[0 * 4] + GetFileVersionInfoA endp + GetFileVersionInfoByHandle proc + jmp DWORD ptr OriginalFuncs_version[1 * 4] + GetFileVersionInfoByHandle endp + GetFileVersionInfoExA proc + jmp DWORD ptr OriginalFuncs_version[2 * 4] + GetFileVersionInfoExA endp + GetFileVersionInfoExW proc + jmp DWORD ptr OriginalFuncs_version[3 * 4] + GetFileVersionInfoExW endp + GetFileVersionInfoSizeA proc + jmp DWORD ptr OriginalFuncs_version[4 * 4] + GetFileVersionInfoSizeA endp + GetFileVersionInfoSizeExA proc + jmp DWORD ptr OriginalFuncs_version[5 * 4] + GetFileVersionInfoSizeExA endp + GetFileVersionInfoSizeExW proc + jmp DWORD ptr OriginalFuncs_version[6 * 4] + GetFileVersionInfoSizeExW endp + GetFileVersionInfoSizeW proc + jmp DWORD ptr OriginalFuncs_version[7 * 4] + GetFileVersionInfoSizeW endp + GetFileVersionInfoW proc + jmp DWORD ptr OriginalFuncs_version[8 * 4] + GetFileVersionInfoW endp + VerFindFileA proc + jmp DWORD ptr OriginalFuncs_version[9 * 4] + VerFindFileA endp + VerFindFileW proc + jmp DWORD ptr OriginalFuncs_version[10 * 4] + VerFindFileW endp + VerInstallFileA proc + jmp DWORD ptr OriginalFuncs_version[11 * 4] + VerInstallFileA endp + VerInstallFileW proc + jmp DWORD ptr OriginalFuncs_version[12 * 4] + VerInstallFileW endp + VerLanguageNameA proc + jmp DWORD ptr OriginalFuncs_version[13 * 4] + VerLanguageNameA endp + VerLanguageNameW proc + jmp DWORD ptr OriginalFuncs_version[14 * 4] + VerLanguageNameW endp + VerQueryValueA proc + jmp DWORD ptr OriginalFuncs_version[15 * 4] + VerQueryValueA endp + VerQueryValueW proc + jmp DWORD ptr OriginalFuncs_version[16 * 4] + VerQueryValueW endp +endif +end \ No newline at end of file diff --git a/Exports/winhttp.asm b/Exports/winhttp.asm new file mode 100644 index 0000000..6cba6d2 --- /dev/null +++ b/Exports/winhttp.asm @@ -0,0 +1,400 @@ +ifdef RAX + .code + extern OriginalFuncs_winhttp:QWORD + Private1 proc + jmp QWORD ptr OriginalFuncs_winhttp[0 * 8] + Private1 endp + SvchostPushServiceGlobals proc + jmp QWORD ptr OriginalFuncs_winhttp[1 * 8] + SvchostPushServiceGlobals endp + WinHttpAddRequestHeaders proc + jmp QWORD ptr OriginalFuncs_winhttp[2 * 8] + WinHttpAddRequestHeaders endp + WinHttpAutoProxySvcMain proc + jmp QWORD ptr OriginalFuncs_winhttp[3 * 8] + WinHttpAutoProxySvcMain endp + WinHttpCheckPlatform proc + jmp QWORD ptr OriginalFuncs_winhttp[4 * 8] + WinHttpCheckPlatform endp + WinHttpCloseHandle proc + jmp QWORD ptr OriginalFuncs_winhttp[5 * 8] + WinHttpCloseHandle endp + WinHttpConnect proc + jmp QWORD ptr OriginalFuncs_winhttp[6 * 8] + WinHttpConnect endp + WinHttpConnectionDeletePolicyEntries proc + jmp QWORD ptr OriginalFuncs_winhttp[7 * 8] + WinHttpConnectionDeletePolicyEntries endp + WinHttpConnectionDeleteProxyInfo proc + jmp QWORD ptr OriginalFuncs_winhttp[8 * 8] + WinHttpConnectionDeleteProxyInfo endp + WinHttpConnectionFreeNameList proc + jmp QWORD ptr OriginalFuncs_winhttp[9 * 8] + WinHttpConnectionFreeNameList endp + WinHttpConnectionFreeProxyInfo proc + jmp QWORD ptr OriginalFuncs_winhttp[10 * 8] + WinHttpConnectionFreeProxyInfo endp + WinHttpConnectionFreeProxyList proc + jmp QWORD ptr OriginalFuncs_winhttp[11 * 8] + WinHttpConnectionFreeProxyList endp + WinHttpConnectionGetNameList proc + jmp QWORD ptr OriginalFuncs_winhttp[12 * 8] + WinHttpConnectionGetNameList endp + WinHttpConnectionGetProxyInfo proc + jmp QWORD ptr OriginalFuncs_winhttp[13 * 8] + WinHttpConnectionGetProxyInfo endp + WinHttpConnectionGetProxyList proc + jmp QWORD ptr OriginalFuncs_winhttp[14 * 8] + WinHttpConnectionGetProxyList endp + WinHttpConnectionSetPolicyEntries proc + jmp QWORD ptr OriginalFuncs_winhttp[15 * 8] + WinHttpConnectionSetPolicyEntries endp + WinHttpConnectionSetProxyInfo proc + jmp QWORD ptr OriginalFuncs_winhttp[16 * 8] + WinHttpConnectionSetProxyInfo endp + WinHttpConnectionUpdateIfIndexTable proc + jmp QWORD ptr OriginalFuncs_winhttp[17 * 8] + WinHttpConnectionUpdateIfIndexTable endp + WinHttpCrackUrl proc + jmp QWORD ptr OriginalFuncs_winhttp[18 * 8] + WinHttpCrackUrl endp + WinHttpCreateProxyResolver proc + jmp QWORD ptr OriginalFuncs_winhttp[19 * 8] + WinHttpCreateProxyResolver endp + WinHttpCreateUrl proc + jmp QWORD ptr OriginalFuncs_winhttp[20 * 8] + WinHttpCreateUrl endp + WinHttpDetectAutoProxyConfigUrl proc + jmp QWORD ptr OriginalFuncs_winhttp[21 * 8] + WinHttpDetectAutoProxyConfigUrl endp + WinHttpFreeProxyResult proc + jmp QWORD ptr OriginalFuncs_winhttp[22 * 8] + WinHttpFreeProxyResult endp + WinHttpFreeProxyResultEx proc + jmp QWORD ptr OriginalFuncs_winhttp[23 * 8] + WinHttpFreeProxyResultEx endp + WinHttpFreeProxySettings proc + jmp QWORD ptr OriginalFuncs_winhttp[24 * 8] + WinHttpFreeProxySettings endp + WinHttpGetDefaultProxyConfiguration proc + jmp QWORD ptr OriginalFuncs_winhttp[25 * 8] + WinHttpGetDefaultProxyConfiguration endp + WinHttpGetIEProxyConfigForCurrentUser proc + jmp QWORD ptr OriginalFuncs_winhttp[26 * 8] + WinHttpGetIEProxyConfigForCurrentUser endp + WinHttpGetProxyForUrl proc + jmp QWORD ptr OriginalFuncs_winhttp[27 * 8] + WinHttpGetProxyForUrl endp + WinHttpGetProxyForUrlEx proc + jmp QWORD ptr OriginalFuncs_winhttp[28 * 8] + WinHttpGetProxyForUrlEx endp + WinHttpGetProxyForUrlEx2 proc + jmp QWORD ptr OriginalFuncs_winhttp[29 * 8] + WinHttpGetProxyForUrlEx2 endp + WinHttpGetProxyForUrlHvsi proc + jmp QWORD ptr OriginalFuncs_winhttp[30 * 8] + WinHttpGetProxyForUrlHvsi endp + WinHttpGetProxyResult proc + jmp QWORD ptr OriginalFuncs_winhttp[31 * 8] + WinHttpGetProxyResult endp + WinHttpGetProxyResultEx proc + jmp QWORD ptr OriginalFuncs_winhttp[32 * 8] + WinHttpGetProxyResultEx endp + WinHttpGetProxySettingsVersion proc + jmp QWORD ptr OriginalFuncs_winhttp[33 * 8] + WinHttpGetProxySettingsVersion endp + WinHttpGetTunnelSocket proc + jmp QWORD ptr OriginalFuncs_winhttp[34 * 8] + WinHttpGetTunnelSocket endp + WinHttpOpen proc + jmp QWORD ptr OriginalFuncs_winhttp[35 * 8] + WinHttpOpen endp + WinHttpOpenRequest proc + jmp QWORD ptr OriginalFuncs_winhttp[36 * 8] + WinHttpOpenRequest endp + WinHttpPacJsWorkerMain proc + jmp QWORD ptr OriginalFuncs_winhttp[37 * 8] + WinHttpPacJsWorkerMain endp + WinHttpProbeConnectivity proc + jmp QWORD ptr OriginalFuncs_winhttp[38 * 8] + WinHttpProbeConnectivity endp + WinHttpQueryAuthSchemes proc + jmp QWORD ptr OriginalFuncs_winhttp[39 * 8] + WinHttpQueryAuthSchemes endp + WinHttpQueryDataAvailable proc + jmp QWORD ptr OriginalFuncs_winhttp[40 * 8] + WinHttpQueryDataAvailable endp + WinHttpQueryHeaders proc + jmp QWORD ptr OriginalFuncs_winhttp[41 * 8] + WinHttpQueryHeaders endp + WinHttpQueryOption proc + jmp QWORD ptr OriginalFuncs_winhttp[42 * 8] + WinHttpQueryOption endp + WinHttpReadData proc + jmp QWORD ptr OriginalFuncs_winhttp[43 * 8] + WinHttpReadData endp + WinHttpReadProxySettings proc + jmp QWORD ptr OriginalFuncs_winhttp[44 * 8] + WinHttpReadProxySettings endp + WinHttpReadProxySettingsHvsi proc + jmp QWORD ptr OriginalFuncs_winhttp[45 * 8] + WinHttpReadProxySettingsHvsi endp + WinHttpReceiveResponse proc + jmp QWORD ptr OriginalFuncs_winhttp[46 * 8] + WinHttpReceiveResponse endp + WinHttpResetAutoProxy proc + jmp QWORD ptr OriginalFuncs_winhttp[47 * 8] + WinHttpResetAutoProxy endp + WinHttpSaveProxyCredentials proc + jmp QWORD ptr OriginalFuncs_winhttp[48 * 8] + WinHttpSaveProxyCredentials endp + WinHttpSendRequest proc + jmp QWORD ptr OriginalFuncs_winhttp[49 * 8] + WinHttpSendRequest endp + WinHttpSetCredentials proc + jmp QWORD ptr OriginalFuncs_winhttp[50 * 8] + WinHttpSetCredentials endp + WinHttpSetDefaultProxyConfiguration proc + jmp QWORD ptr OriginalFuncs_winhttp[51 * 8] + WinHttpSetDefaultProxyConfiguration endp + WinHttpSetOption proc + jmp QWORD ptr OriginalFuncs_winhttp[52 * 8] + WinHttpSetOption endp + WinHttpSetStatusCallback proc + jmp QWORD ptr OriginalFuncs_winhttp[53 * 8] + WinHttpSetStatusCallback endp + WinHttpSetTimeouts proc + jmp QWORD ptr OriginalFuncs_winhttp[54 * 8] + WinHttpSetTimeouts endp + WinHttpTimeFromSystemTime proc + jmp QWORD ptr OriginalFuncs_winhttp[55 * 8] + WinHttpTimeFromSystemTime endp + WinHttpTimeToSystemTime proc + jmp QWORD ptr OriginalFuncs_winhttp[56 * 8] + WinHttpTimeToSystemTime endp + WinHttpWebSocketClose proc + jmp QWORD ptr OriginalFuncs_winhttp[57 * 8] + WinHttpWebSocketClose endp + WinHttpWebSocketCompleteUpgrade proc + jmp QWORD ptr OriginalFuncs_winhttp[58 * 8] + WinHttpWebSocketCompleteUpgrade endp + WinHttpWebSocketQueryCloseStatus proc + jmp QWORD ptr OriginalFuncs_winhttp[59 * 8] + WinHttpWebSocketQueryCloseStatus endp + WinHttpWebSocketReceive proc + jmp QWORD ptr OriginalFuncs_winhttp[60 * 8] + WinHttpWebSocketReceive endp + WinHttpWebSocketSend proc + jmp QWORD ptr OriginalFuncs_winhttp[61 * 8] + WinHttpWebSocketSend endp + WinHttpWebSocketShutdown proc + jmp QWORD ptr OriginalFuncs_winhttp[62 * 8] + WinHttpWebSocketShutdown endp + WinHttpWriteData proc + jmp QWORD ptr OriginalFuncs_winhttp[63 * 8] + WinHttpWriteData endp + WinHttpWriteProxySettings proc + jmp QWORD ptr OriginalFuncs_winhttp[64 * 8] + WinHttpWriteProxySettings endp +else + .model flat, C + .stack 4096 + .code + extern OriginalFuncs_winhttp:DWORD + Private1 proc + jmp DWORD ptr OriginalFuncs_winhttp[0 * 4] + Private1 endp + SvchostPushServiceGlobals proc + jmp DWORD ptr OriginalFuncs_winhttp[1 * 4] + SvchostPushServiceGlobals endp + WinHttpAddRequestHeaders proc + jmp DWORD ptr OriginalFuncs_winhttp[2 * 4] + WinHttpAddRequestHeaders endp + WinHttpAutoProxySvcMain proc + jmp DWORD ptr OriginalFuncs_winhttp[3 * 4] + WinHttpAutoProxySvcMain endp + WinHttpCheckPlatform proc + jmp DWORD ptr OriginalFuncs_winhttp[4 * 4] + WinHttpCheckPlatform endp + WinHttpCloseHandle proc + jmp DWORD ptr OriginalFuncs_winhttp[5 * 4] + WinHttpCloseHandle endp + WinHttpConnect proc + jmp DWORD ptr OriginalFuncs_winhttp[6 * 4] + WinHttpConnect endp + WinHttpConnectionDeletePolicyEntries proc + jmp DWORD ptr OriginalFuncs_winhttp[7 * 4] + WinHttpConnectionDeletePolicyEntries endp + WinHttpConnectionDeleteProxyInfo proc + jmp DWORD ptr OriginalFuncs_winhttp[8 * 4] + WinHttpConnectionDeleteProxyInfo endp + WinHttpConnectionFreeNameList proc + jmp DWORD ptr OriginalFuncs_winhttp[9 * 4] + WinHttpConnectionFreeNameList endp + WinHttpConnectionFreeProxyInfo proc + jmp DWORD ptr OriginalFuncs_winhttp[10 * 4] + WinHttpConnectionFreeProxyInfo endp + WinHttpConnectionFreeProxyList proc + jmp DWORD ptr OriginalFuncs_winhttp[11 * 4] + WinHttpConnectionFreeProxyList endp + WinHttpConnectionGetNameList proc + jmp DWORD ptr OriginalFuncs_winhttp[12 * 4] + WinHttpConnectionGetNameList endp + WinHttpConnectionGetProxyInfo proc + jmp DWORD ptr OriginalFuncs_winhttp[13 * 4] + WinHttpConnectionGetProxyInfo endp + WinHttpConnectionGetProxyList proc + jmp DWORD ptr OriginalFuncs_winhttp[14 * 4] + WinHttpConnectionGetProxyList endp + WinHttpConnectionSetPolicyEntries proc + jmp DWORD ptr OriginalFuncs_winhttp[15 * 4] + WinHttpConnectionSetPolicyEntries endp + WinHttpConnectionSetProxyInfo proc + jmp DWORD ptr OriginalFuncs_winhttp[16 * 4] + WinHttpConnectionSetProxyInfo endp + WinHttpConnectionUpdateIfIndexTable proc + jmp DWORD ptr OriginalFuncs_winhttp[17 * 4] + WinHttpConnectionUpdateIfIndexTable endp + WinHttpCrackUrl proc + jmp DWORD ptr OriginalFuncs_winhttp[18 * 4] + WinHttpCrackUrl endp + WinHttpCreateProxyResolver proc + jmp DWORD ptr OriginalFuncs_winhttp[19 * 4] + WinHttpCreateProxyResolver endp + WinHttpCreateUrl proc + jmp DWORD ptr OriginalFuncs_winhttp[20 * 4] + WinHttpCreateUrl endp + WinHttpDetectAutoProxyConfigUrl proc + jmp DWORD ptr OriginalFuncs_winhttp[21 * 4] + WinHttpDetectAutoProxyConfigUrl endp + WinHttpFreeProxyResult proc + jmp DWORD ptr OriginalFuncs_winhttp[22 * 4] + WinHttpFreeProxyResult endp + WinHttpFreeProxyResultEx proc + jmp DWORD ptr OriginalFuncs_winhttp[23 * 4] + WinHttpFreeProxyResultEx endp + WinHttpFreeProxySettings proc + jmp DWORD ptr OriginalFuncs_winhttp[24 * 4] + WinHttpFreeProxySettings endp + WinHttpGetDefaultProxyConfiguration proc + jmp DWORD ptr OriginalFuncs_winhttp[25 * 4] + WinHttpGetDefaultProxyConfiguration endp + WinHttpGetIEProxyConfigForCurrentUser proc + jmp DWORD ptr OriginalFuncs_winhttp[26 * 4] + WinHttpGetIEProxyConfigForCurrentUser endp + WinHttpGetProxyForUrl proc + jmp DWORD ptr OriginalFuncs_winhttp[27 * 4] + WinHttpGetProxyForUrl endp + WinHttpGetProxyForUrlEx proc + jmp DWORD ptr OriginalFuncs_winhttp[28 * 4] + WinHttpGetProxyForUrlEx endp + WinHttpGetProxyForUrlEx2 proc + jmp DWORD ptr OriginalFuncs_winhttp[29 * 4] + WinHttpGetProxyForUrlEx2 endp + WinHttpGetProxyForUrlHvsi proc + jmp DWORD ptr OriginalFuncs_winhttp[30 * 4] + WinHttpGetProxyForUrlHvsi endp + WinHttpGetProxyResult proc + jmp DWORD ptr OriginalFuncs_winhttp[31 * 4] + WinHttpGetProxyResult endp + WinHttpGetProxyResultEx proc + jmp DWORD ptr OriginalFuncs_winhttp[32 * 4] + WinHttpGetProxyResultEx endp + WinHttpGetProxySettingsVersion proc + jmp DWORD ptr OriginalFuncs_winhttp[33 * 4] + WinHttpGetProxySettingsVersion endp + WinHttpGetTunnelSocket proc + jmp DWORD ptr OriginalFuncs_winhttp[34 * 4] + WinHttpGetTunnelSocket endp + WinHttpOpen proc + jmp DWORD ptr OriginalFuncs_winhttp[35 * 4] + WinHttpOpen endp + WinHttpOpenRequest proc + jmp DWORD ptr OriginalFuncs_winhttp[36 * 4] + WinHttpOpenRequest endp + WinHttpPacJsWorkerMain proc + jmp DWORD ptr OriginalFuncs_winhttp[37 * 4] + WinHttpPacJsWorkerMain endp + WinHttpProbeConnectivity proc + jmp DWORD ptr OriginalFuncs_winhttp[38 * 4] + WinHttpProbeConnectivity endp + WinHttpQueryAuthSchemes proc + jmp DWORD ptr OriginalFuncs_winhttp[39 * 4] + WinHttpQueryAuthSchemes endp + WinHttpQueryDataAvailable proc + jmp DWORD ptr OriginalFuncs_winhttp[40 * 4] + WinHttpQueryDataAvailable endp + WinHttpQueryHeaders proc + jmp DWORD ptr OriginalFuncs_winhttp[41 * 4] + WinHttpQueryHeaders endp + WinHttpQueryOption proc + jmp DWORD ptr OriginalFuncs_winhttp[42 * 4] + WinHttpQueryOption endp + WinHttpReadData proc + jmp DWORD ptr OriginalFuncs_winhttp[43 * 4] + WinHttpReadData endp + WinHttpReadProxySettings proc + jmp DWORD ptr OriginalFuncs_winhttp[44 * 4] + WinHttpReadProxySettings endp + WinHttpReadProxySettingsHvsi proc + jmp DWORD ptr OriginalFuncs_winhttp[45 * 4] + WinHttpReadProxySettingsHvsi endp + WinHttpReceiveResponse proc + jmp DWORD ptr OriginalFuncs_winhttp[46 * 4] + WinHttpReceiveResponse endp + WinHttpResetAutoProxy proc + jmp DWORD ptr OriginalFuncs_winhttp[47 * 4] + WinHttpResetAutoProxy endp + WinHttpSaveProxyCredentials proc + jmp DWORD ptr OriginalFuncs_winhttp[48 * 4] + WinHttpSaveProxyCredentials endp + WinHttpSendRequest proc + jmp DWORD ptr OriginalFuncs_winhttp[49 * 4] + WinHttpSendRequest endp + WinHttpSetCredentials proc + jmp DWORD ptr OriginalFuncs_winhttp[50 * 4] + WinHttpSetCredentials endp + WinHttpSetDefaultProxyConfiguration proc + jmp DWORD ptr OriginalFuncs_winhttp[51 * 4] + WinHttpSetDefaultProxyConfiguration endp + WinHttpSetOption proc + jmp DWORD ptr OriginalFuncs_winhttp[52 * 4] + WinHttpSetOption endp + WinHttpSetStatusCallback proc + jmp DWORD ptr OriginalFuncs_winhttp[53 * 4] + WinHttpSetStatusCallback endp + WinHttpSetTimeouts proc + jmp DWORD ptr OriginalFuncs_winhttp[54 * 4] + WinHttpSetTimeouts endp + WinHttpTimeFromSystemTime proc + jmp DWORD ptr OriginalFuncs_winhttp[55 * 4] + WinHttpTimeFromSystemTime endp + WinHttpTimeToSystemTime proc + jmp DWORD ptr OriginalFuncs_winhttp[56 * 4] + WinHttpTimeToSystemTime endp + WinHttpWebSocketClose proc + jmp DWORD ptr OriginalFuncs_winhttp[57 * 4] + WinHttpWebSocketClose endp + WinHttpWebSocketCompleteUpgrade proc + jmp DWORD ptr OriginalFuncs_winhttp[58 * 4] + WinHttpWebSocketCompleteUpgrade endp + WinHttpWebSocketQueryCloseStatus proc + jmp DWORD ptr OriginalFuncs_winhttp[59 * 4] + WinHttpWebSocketQueryCloseStatus endp + WinHttpWebSocketReceive proc + jmp DWORD ptr OriginalFuncs_winhttp[60 * 4] + WinHttpWebSocketReceive endp + WinHttpWebSocketSend proc + jmp DWORD ptr OriginalFuncs_winhttp[61 * 4] + WinHttpWebSocketSend endp + WinHttpWebSocketShutdown proc + jmp DWORD ptr OriginalFuncs_winhttp[62 * 4] + WinHttpWebSocketShutdown endp + WinHttpWriteData proc + jmp DWORD ptr OriginalFuncs_winhttp[63 * 4] + WinHttpWriteData endp + WinHttpWriteProxySettings proc + jmp DWORD ptr OriginalFuncs_winhttp[64 * 4] + WinHttpWriteProxySettings endp +endif +end \ No newline at end of file diff --git a/Exports/winmm.asm b/Exports/winmm.asm new file mode 100644 index 0000000..5620fdc --- /dev/null +++ b/Exports/winmm.asm @@ -0,0 +1,1096 @@ +ifdef RAX + .code + extern OriginalFuncs_winmm:QWORD + CloseDriver proc + jmp QWORD ptr OriginalFuncs_winmm[0 * 8] + CloseDriver endp + DefDriverProc proc + jmp QWORD ptr OriginalFuncs_winmm[1 * 8] + DefDriverProc endp + DriverCallback proc + jmp QWORD ptr OriginalFuncs_winmm[2 * 8] + DriverCallback endp + DrvGetModuleHandle proc + jmp QWORD ptr OriginalFuncs_winmm[3 * 8] + DrvGetModuleHandle endp + GetDriverModuleHandle proc + jmp QWORD ptr OriginalFuncs_winmm[4 * 8] + GetDriverModuleHandle endp + OpenDriver proc + jmp QWORD ptr OriginalFuncs_winmm[5 * 8] + OpenDriver endp + PlaySound proc + jmp QWORD ptr OriginalFuncs_winmm[6 * 8] + PlaySound endp + PlaySoundA proc + jmp QWORD ptr OriginalFuncs_winmm[7 * 8] + PlaySoundA endp + PlaySoundW proc + jmp QWORD ptr OriginalFuncs_winmm[8 * 8] + PlaySoundW endp + SendDriverMessage proc + jmp QWORD ptr OriginalFuncs_winmm[9 * 8] + SendDriverMessage endp + WOWAppExit proc + jmp QWORD ptr OriginalFuncs_winmm[10 * 8] + WOWAppExit endp + auxGetDevCapsA proc + jmp QWORD ptr OriginalFuncs_winmm[11 * 8] + auxGetDevCapsA endp + auxGetDevCapsW proc + jmp QWORD ptr OriginalFuncs_winmm[12 * 8] + auxGetDevCapsW endp + auxGetNumDevs proc + jmp QWORD ptr OriginalFuncs_winmm[13 * 8] + auxGetNumDevs endp + auxGetVolume proc + jmp QWORD ptr OriginalFuncs_winmm[14 * 8] + auxGetVolume endp + auxOutMessage proc + jmp QWORD ptr OriginalFuncs_winmm[15 * 8] + auxOutMessage endp + auxSetVolume proc + jmp QWORD ptr OriginalFuncs_winmm[16 * 8] + auxSetVolume endp + joyConfigChanged proc + jmp QWORD ptr OriginalFuncs_winmm[17 * 8] + joyConfigChanged endp + joyGetDevCapsA proc + jmp QWORD ptr OriginalFuncs_winmm[18 * 8] + joyGetDevCapsA endp + joyGetDevCapsW proc + jmp QWORD ptr OriginalFuncs_winmm[19 * 8] + joyGetDevCapsW endp + joyGetNumDevs proc + jmp QWORD ptr OriginalFuncs_winmm[20 * 8] + joyGetNumDevs endp + joyGetPos proc + jmp QWORD ptr OriginalFuncs_winmm[21 * 8] + joyGetPos endp + joyGetPosEx proc + jmp QWORD ptr OriginalFuncs_winmm[22 * 8] + joyGetPosEx endp + joyGetThreshold proc + jmp QWORD ptr OriginalFuncs_winmm[23 * 8] + joyGetThreshold endp + joyReleaseCapture proc + jmp QWORD ptr OriginalFuncs_winmm[24 * 8] + joyReleaseCapture endp + joySetCapture proc + jmp QWORD ptr OriginalFuncs_winmm[25 * 8] + joySetCapture endp + joySetThreshold proc + jmp QWORD ptr OriginalFuncs_winmm[26 * 8] + joySetThreshold endp + mciDriverNotify proc + jmp QWORD ptr OriginalFuncs_winmm[27 * 8] + mciDriverNotify endp + mciDriverYield proc + jmp QWORD ptr OriginalFuncs_winmm[28 * 8] + mciDriverYield endp + mciExecute proc + jmp QWORD ptr OriginalFuncs_winmm[29 * 8] + mciExecute endp + mciFreeCommandResource proc + jmp QWORD ptr OriginalFuncs_winmm[30 * 8] + mciFreeCommandResource endp + mciGetCreatorTask proc + jmp QWORD ptr OriginalFuncs_winmm[31 * 8] + mciGetCreatorTask endp + mciGetDeviceIDA proc + jmp QWORD ptr OriginalFuncs_winmm[32 * 8] + mciGetDeviceIDA endp + mciGetDeviceIDFromElementIDA proc + jmp QWORD ptr OriginalFuncs_winmm[33 * 8] + mciGetDeviceIDFromElementIDA endp + mciGetDeviceIDFromElementIDW proc + jmp QWORD ptr OriginalFuncs_winmm[34 * 8] + mciGetDeviceIDFromElementIDW endp + mciGetDeviceIDW proc + jmp QWORD ptr OriginalFuncs_winmm[35 * 8] + mciGetDeviceIDW endp + mciGetDriverData proc + jmp QWORD ptr OriginalFuncs_winmm[36 * 8] + mciGetDriverData endp + mciGetErrorStringA proc + jmp QWORD ptr OriginalFuncs_winmm[37 * 8] + mciGetErrorStringA endp + mciGetErrorStringW proc + jmp QWORD ptr OriginalFuncs_winmm[38 * 8] + mciGetErrorStringW endp + mciGetYieldProc proc + jmp QWORD ptr OriginalFuncs_winmm[39 * 8] + mciGetYieldProc endp + mciLoadCommandResource proc + jmp QWORD ptr OriginalFuncs_winmm[40 * 8] + mciLoadCommandResource endp + mciSendCommandA proc + jmp QWORD ptr OriginalFuncs_winmm[41 * 8] + mciSendCommandA endp + mciSendCommandW proc + jmp QWORD ptr OriginalFuncs_winmm[42 * 8] + mciSendCommandW endp + mciSendStringA proc + jmp QWORD ptr OriginalFuncs_winmm[43 * 8] + mciSendStringA endp + mciSendStringW proc + jmp QWORD ptr OriginalFuncs_winmm[44 * 8] + mciSendStringW endp + mciSetDriverData proc + jmp QWORD ptr OriginalFuncs_winmm[45 * 8] + mciSetDriverData endp + mciSetYieldProc proc + jmp QWORD ptr OriginalFuncs_winmm[46 * 8] + mciSetYieldProc endp + midiConnect proc + jmp QWORD ptr OriginalFuncs_winmm[47 * 8] + midiConnect endp + midiDisconnect proc + jmp QWORD ptr OriginalFuncs_winmm[48 * 8] + midiDisconnect endp + midiInAddBuffer proc + jmp QWORD ptr OriginalFuncs_winmm[49 * 8] + midiInAddBuffer endp + midiInClose proc + jmp QWORD ptr OriginalFuncs_winmm[50 * 8] + midiInClose endp + midiInGetDevCapsA proc + jmp QWORD ptr OriginalFuncs_winmm[51 * 8] + midiInGetDevCapsA endp + midiInGetDevCapsW proc + jmp QWORD ptr OriginalFuncs_winmm[52 * 8] + midiInGetDevCapsW endp + midiInGetErrorTextA proc + jmp QWORD ptr OriginalFuncs_winmm[53 * 8] + midiInGetErrorTextA endp + midiInGetErrorTextW proc + jmp QWORD ptr OriginalFuncs_winmm[54 * 8] + midiInGetErrorTextW endp + midiInGetID proc + jmp QWORD ptr OriginalFuncs_winmm[55 * 8] + midiInGetID endp + midiInGetNumDevs proc + jmp QWORD ptr OriginalFuncs_winmm[56 * 8] + midiInGetNumDevs endp + midiInMessage proc + jmp QWORD ptr OriginalFuncs_winmm[57 * 8] + midiInMessage endp + midiInOpen proc + jmp QWORD ptr OriginalFuncs_winmm[58 * 8] + midiInOpen endp + midiInPrepareHeader proc + jmp QWORD ptr OriginalFuncs_winmm[59 * 8] + midiInPrepareHeader endp + midiInReset proc + jmp QWORD ptr OriginalFuncs_winmm[60 * 8] + midiInReset endp + midiInStart proc + jmp QWORD ptr OriginalFuncs_winmm[61 * 8] + midiInStart endp + midiInStop proc + jmp QWORD ptr OriginalFuncs_winmm[62 * 8] + midiInStop endp + midiInUnprepareHeader proc + jmp QWORD ptr OriginalFuncs_winmm[63 * 8] + midiInUnprepareHeader endp + midiOutCacheDrumPatches proc + jmp QWORD ptr OriginalFuncs_winmm[64 * 8] + midiOutCacheDrumPatches endp + midiOutCachePatches proc + jmp QWORD ptr OriginalFuncs_winmm[65 * 8] + midiOutCachePatches endp + midiOutClose proc + jmp QWORD ptr OriginalFuncs_winmm[66 * 8] + midiOutClose endp + midiOutGetDevCapsA proc + jmp QWORD ptr OriginalFuncs_winmm[67 * 8] + midiOutGetDevCapsA endp + midiOutGetDevCapsW proc + jmp QWORD ptr OriginalFuncs_winmm[68 * 8] + midiOutGetDevCapsW endp + midiOutGetErrorTextA proc + jmp QWORD ptr OriginalFuncs_winmm[69 * 8] + midiOutGetErrorTextA endp + midiOutGetErrorTextW proc + jmp QWORD ptr OriginalFuncs_winmm[70 * 8] + midiOutGetErrorTextW endp + midiOutGetID proc + jmp QWORD ptr OriginalFuncs_winmm[71 * 8] + midiOutGetID endp + midiOutGetNumDevs proc + jmp QWORD ptr OriginalFuncs_winmm[72 * 8] + midiOutGetNumDevs endp + midiOutGetVolume proc + jmp QWORD ptr OriginalFuncs_winmm[73 * 8] + midiOutGetVolume endp + midiOutLongMsg proc + jmp QWORD ptr OriginalFuncs_winmm[74 * 8] + midiOutLongMsg endp + midiOutMessage proc + jmp QWORD ptr OriginalFuncs_winmm[75 * 8] + midiOutMessage endp + midiOutOpen proc + jmp QWORD ptr OriginalFuncs_winmm[76 * 8] + midiOutOpen endp + midiOutPrepareHeader proc + jmp QWORD ptr OriginalFuncs_winmm[77 * 8] + midiOutPrepareHeader endp + midiOutReset proc + jmp QWORD ptr OriginalFuncs_winmm[78 * 8] + midiOutReset endp + midiOutSetVolume proc + jmp QWORD ptr OriginalFuncs_winmm[79 * 8] + midiOutSetVolume endp + midiOutShortMsg proc + jmp QWORD ptr OriginalFuncs_winmm[80 * 8] + midiOutShortMsg endp + midiOutUnprepareHeader proc + jmp QWORD ptr OriginalFuncs_winmm[81 * 8] + midiOutUnprepareHeader endp + midiStreamClose proc + jmp QWORD ptr OriginalFuncs_winmm[82 * 8] + midiStreamClose endp + midiStreamOpen proc + jmp QWORD ptr OriginalFuncs_winmm[83 * 8] + midiStreamOpen endp + midiStreamOut proc + jmp QWORD ptr OriginalFuncs_winmm[84 * 8] + midiStreamOut endp + midiStreamPause proc + jmp QWORD ptr OriginalFuncs_winmm[85 * 8] + midiStreamPause endp + midiStreamPosition proc + jmp QWORD ptr OriginalFuncs_winmm[86 * 8] + midiStreamPosition endp + midiStreamProperty proc + jmp QWORD ptr OriginalFuncs_winmm[87 * 8] + midiStreamProperty endp + midiStreamRestart proc + jmp QWORD ptr OriginalFuncs_winmm[88 * 8] + midiStreamRestart endp + midiStreamStop proc + jmp QWORD ptr OriginalFuncs_winmm[89 * 8] + midiStreamStop endp + mixerClose proc + jmp QWORD ptr OriginalFuncs_winmm[90 * 8] + mixerClose endp + mixerGetControlDetailsA proc + jmp QWORD ptr OriginalFuncs_winmm[91 * 8] + mixerGetControlDetailsA endp + mixerGetControlDetailsW proc + jmp QWORD ptr OriginalFuncs_winmm[92 * 8] + mixerGetControlDetailsW endp + mixerGetDevCapsA proc + jmp QWORD ptr OriginalFuncs_winmm[93 * 8] + mixerGetDevCapsA endp + mixerGetDevCapsW proc + jmp QWORD ptr OriginalFuncs_winmm[94 * 8] + mixerGetDevCapsW endp + mixerGetID proc + jmp QWORD ptr OriginalFuncs_winmm[95 * 8] + mixerGetID endp + mixerGetLineControlsA proc + jmp QWORD ptr OriginalFuncs_winmm[96 * 8] + mixerGetLineControlsA endp + mixerGetLineControlsW proc + jmp QWORD ptr OriginalFuncs_winmm[97 * 8] + mixerGetLineControlsW endp + mixerGetLineInfoA proc + jmp QWORD ptr OriginalFuncs_winmm[98 * 8] + mixerGetLineInfoA endp + mixerGetLineInfoW proc + jmp QWORD ptr OriginalFuncs_winmm[99 * 8] + mixerGetLineInfoW endp + mixerGetNumDevs proc + jmp QWORD ptr OriginalFuncs_winmm[100 * 8] + mixerGetNumDevs endp + mixerMessage proc + jmp QWORD ptr OriginalFuncs_winmm[101 * 8] + mixerMessage endp + mixerOpen proc + jmp QWORD ptr OriginalFuncs_winmm[102 * 8] + mixerOpen endp + mixerSetControlDetails proc + jmp QWORD ptr OriginalFuncs_winmm[103 * 8] + mixerSetControlDetails endp + mmDrvInstall proc + jmp QWORD ptr OriginalFuncs_winmm[104 * 8] + mmDrvInstall endp + mmGetCurrentTask proc + jmp QWORD ptr OriginalFuncs_winmm[105 * 8] + mmGetCurrentTask endp + mmTaskBlock proc + jmp QWORD ptr OriginalFuncs_winmm[106 * 8] + mmTaskBlock endp + mmTaskCreate proc + jmp QWORD ptr OriginalFuncs_winmm[107 * 8] + mmTaskCreate endp + mmTaskSignal proc + jmp QWORD ptr OriginalFuncs_winmm[108 * 8] + mmTaskSignal endp + mmTaskYield proc + jmp QWORD ptr OriginalFuncs_winmm[109 * 8] + mmTaskYield endp + mmioAdvance proc + jmp QWORD ptr OriginalFuncs_winmm[110 * 8] + mmioAdvance endp + mmioAscend proc + jmp QWORD ptr OriginalFuncs_winmm[111 * 8] + mmioAscend endp + mmioClose proc + jmp QWORD ptr OriginalFuncs_winmm[112 * 8] + mmioClose endp + mmioCreateChunk proc + jmp QWORD ptr OriginalFuncs_winmm[113 * 8] + mmioCreateChunk endp + mmioDescend proc + jmp QWORD ptr OriginalFuncs_winmm[114 * 8] + mmioDescend endp + mmioFlush proc + jmp QWORD ptr OriginalFuncs_winmm[115 * 8] + mmioFlush endp + mmioGetInfo proc + jmp QWORD ptr OriginalFuncs_winmm[116 * 8] + mmioGetInfo endp + mmioInstallIOProcA proc + jmp QWORD ptr OriginalFuncs_winmm[117 * 8] + mmioInstallIOProcA endp + mmioInstallIOProcW proc + jmp QWORD ptr OriginalFuncs_winmm[118 * 8] + mmioInstallIOProcW endp + mmioOpenA proc + jmp QWORD ptr OriginalFuncs_winmm[119 * 8] + mmioOpenA endp + mmioOpenW proc + jmp QWORD ptr OriginalFuncs_winmm[120 * 8] + mmioOpenW endp + mmioRead proc + jmp QWORD ptr OriginalFuncs_winmm[121 * 8] + mmioRead endp + mmioRenameA proc + jmp QWORD ptr OriginalFuncs_winmm[122 * 8] + mmioRenameA endp + mmioRenameW proc + jmp QWORD ptr OriginalFuncs_winmm[123 * 8] + mmioRenameW endp + mmioSeek proc + jmp QWORD ptr OriginalFuncs_winmm[124 * 8] + mmioSeek endp + mmioSendMessage proc + jmp QWORD ptr OriginalFuncs_winmm[125 * 8] + mmioSendMessage endp + mmioSetBuffer proc + jmp QWORD ptr OriginalFuncs_winmm[126 * 8] + mmioSetBuffer endp + mmioSetInfo proc + jmp QWORD ptr OriginalFuncs_winmm[127 * 8] + mmioSetInfo endp + mmioStringToFOURCCA proc + jmp QWORD ptr OriginalFuncs_winmm[128 * 8] + mmioStringToFOURCCA endp + mmioStringToFOURCCW proc + jmp QWORD ptr OriginalFuncs_winmm[129 * 8] + mmioStringToFOURCCW endp + mmioWrite proc + jmp QWORD ptr OriginalFuncs_winmm[130 * 8] + mmioWrite endp + mmsystemGetVersion proc + jmp QWORD ptr OriginalFuncs_winmm[131 * 8] + mmsystemGetVersion endp + sndPlaySoundA proc + jmp QWORD ptr OriginalFuncs_winmm[132 * 8] + sndPlaySoundA endp + sndPlaySoundW proc + jmp QWORD ptr OriginalFuncs_winmm[133 * 8] + sndPlaySoundW endp + timeBeginPeriod proc + jmp QWORD ptr OriginalFuncs_winmm[134 * 8] + timeBeginPeriod endp + timeEndPeriod proc + jmp QWORD ptr OriginalFuncs_winmm[135 * 8] + timeEndPeriod endp + timeGetDevCaps proc + jmp QWORD ptr OriginalFuncs_winmm[136 * 8] + timeGetDevCaps endp + timeGetSystemTime proc + jmp QWORD ptr OriginalFuncs_winmm[137 * 8] + timeGetSystemTime endp + timeGetTime proc + jmp QWORD ptr OriginalFuncs_winmm[138 * 8] + timeGetTime endp + timeKillEvent proc + jmp QWORD ptr OriginalFuncs_winmm[139 * 8] + timeKillEvent endp + timeSetEvent proc + jmp QWORD ptr OriginalFuncs_winmm[140 * 8] + timeSetEvent endp + waveInAddBuffer proc + jmp QWORD ptr OriginalFuncs_winmm[141 * 8] + waveInAddBuffer endp + waveInClose proc + jmp QWORD ptr OriginalFuncs_winmm[142 * 8] + waveInClose endp + waveInGetDevCapsA proc + jmp QWORD ptr OriginalFuncs_winmm[143 * 8] + waveInGetDevCapsA endp + waveInGetDevCapsW proc + jmp QWORD ptr OriginalFuncs_winmm[144 * 8] + waveInGetDevCapsW endp + waveInGetErrorTextA proc + jmp QWORD ptr OriginalFuncs_winmm[145 * 8] + waveInGetErrorTextA endp + waveInGetErrorTextW proc + jmp QWORD ptr OriginalFuncs_winmm[146 * 8] + waveInGetErrorTextW endp + waveInGetID proc + jmp QWORD ptr OriginalFuncs_winmm[147 * 8] + waveInGetID endp + waveInGetNumDevs proc + jmp QWORD ptr OriginalFuncs_winmm[148 * 8] + waveInGetNumDevs endp + waveInGetPosition proc + jmp QWORD ptr OriginalFuncs_winmm[149 * 8] + waveInGetPosition endp + waveInMessage proc + jmp QWORD ptr OriginalFuncs_winmm[150 * 8] + waveInMessage endp + waveInOpen proc + jmp QWORD ptr OriginalFuncs_winmm[151 * 8] + waveInOpen endp + waveInPrepareHeader proc + jmp QWORD ptr OriginalFuncs_winmm[152 * 8] + waveInPrepareHeader endp + waveInReset proc + jmp QWORD ptr OriginalFuncs_winmm[153 * 8] + waveInReset endp + waveInStart proc + jmp QWORD ptr OriginalFuncs_winmm[154 * 8] + waveInStart endp + waveInStop proc + jmp QWORD ptr OriginalFuncs_winmm[155 * 8] + waveInStop endp + waveInUnprepareHeader proc + jmp QWORD ptr OriginalFuncs_winmm[156 * 8] + waveInUnprepareHeader endp + waveOutBreakLoop proc + jmp QWORD ptr OriginalFuncs_winmm[157 * 8] + waveOutBreakLoop endp + waveOutClose proc + jmp QWORD ptr OriginalFuncs_winmm[158 * 8] + waveOutClose endp + waveOutGetDevCapsA proc + jmp QWORD ptr OriginalFuncs_winmm[159 * 8] + waveOutGetDevCapsA endp + waveOutGetDevCapsW proc + jmp QWORD ptr OriginalFuncs_winmm[160 * 8] + waveOutGetDevCapsW endp + waveOutGetErrorTextA proc + jmp QWORD ptr OriginalFuncs_winmm[161 * 8] + waveOutGetErrorTextA endp + waveOutGetErrorTextW proc + jmp QWORD ptr OriginalFuncs_winmm[162 * 8] + waveOutGetErrorTextW endp + waveOutGetID proc + jmp QWORD ptr OriginalFuncs_winmm[163 * 8] + waveOutGetID endp + waveOutGetNumDevs proc + jmp QWORD ptr OriginalFuncs_winmm[164 * 8] + waveOutGetNumDevs endp + waveOutGetPitch proc + jmp QWORD ptr OriginalFuncs_winmm[165 * 8] + waveOutGetPitch endp + waveOutGetPlaybackRate proc + jmp QWORD ptr OriginalFuncs_winmm[166 * 8] + waveOutGetPlaybackRate endp + waveOutGetPosition proc + jmp QWORD ptr OriginalFuncs_winmm[167 * 8] + waveOutGetPosition endp + waveOutGetVolume proc + jmp QWORD ptr OriginalFuncs_winmm[168 * 8] + waveOutGetVolume endp + waveOutMessage proc + jmp QWORD ptr OriginalFuncs_winmm[169 * 8] + waveOutMessage endp + waveOutOpen proc + jmp QWORD ptr OriginalFuncs_winmm[170 * 8] + waveOutOpen endp + waveOutPause proc + jmp QWORD ptr OriginalFuncs_winmm[171 * 8] + waveOutPause endp + waveOutPrepareHeader proc + jmp QWORD ptr OriginalFuncs_winmm[172 * 8] + waveOutPrepareHeader endp + waveOutReset proc + jmp QWORD ptr OriginalFuncs_winmm[173 * 8] + waveOutReset endp + waveOutRestart proc + jmp QWORD ptr OriginalFuncs_winmm[174 * 8] + waveOutRestart endp + waveOutSetPitch proc + jmp QWORD ptr OriginalFuncs_winmm[175 * 8] + waveOutSetPitch endp + waveOutSetPlaybackRate proc + jmp QWORD ptr OriginalFuncs_winmm[176 * 8] + waveOutSetPlaybackRate endp + waveOutSetVolume proc + jmp QWORD ptr OriginalFuncs_winmm[177 * 8] + waveOutSetVolume endp + waveOutUnprepareHeader proc + jmp QWORD ptr OriginalFuncs_winmm[178 * 8] + waveOutUnprepareHeader endp + waveOutWrite proc + jmp QWORD ptr OriginalFuncs_winmm[179 * 8] + waveOutWrite endp + ExportByOrdinal2 proc + jmp QWORD ptr OriginalFuncs_winmm[180 * 8] + ExportByOrdinal2 endp +else + .model flat, C + .stack 4096 + .code + extern OriginalFuncs_winmm:DWORD + CloseDriver proc + jmp DWORD ptr OriginalFuncs_winmm[0 * 4] + CloseDriver endp + DefDriverProc proc + jmp DWORD ptr OriginalFuncs_winmm[1 * 4] + DefDriverProc endp + DriverCallback proc + jmp DWORD ptr OriginalFuncs_winmm[2 * 4] + DriverCallback endp + DrvGetModuleHandle proc + jmp DWORD ptr OriginalFuncs_winmm[3 * 4] + DrvGetModuleHandle endp + GetDriverModuleHandle proc + jmp DWORD ptr OriginalFuncs_winmm[4 * 4] + GetDriverModuleHandle endp + OpenDriver proc + jmp DWORD ptr OriginalFuncs_winmm[5 * 4] + OpenDriver endp + PlaySound proc + jmp DWORD ptr OriginalFuncs_winmm[6 * 4] + PlaySound endp + PlaySoundA proc + jmp DWORD ptr OriginalFuncs_winmm[7 * 4] + PlaySoundA endp + PlaySoundW proc + jmp DWORD ptr OriginalFuncs_winmm[8 * 4] + PlaySoundW endp + SendDriverMessage proc + jmp DWORD ptr OriginalFuncs_winmm[9 * 4] + SendDriverMessage endp + WOWAppExit proc + jmp DWORD ptr OriginalFuncs_winmm[10 * 4] + WOWAppExit endp + auxGetDevCapsA proc + jmp DWORD ptr OriginalFuncs_winmm[11 * 4] + auxGetDevCapsA endp + auxGetDevCapsW proc + jmp DWORD ptr OriginalFuncs_winmm[12 * 4] + auxGetDevCapsW endp + auxGetNumDevs proc + jmp DWORD ptr OriginalFuncs_winmm[13 * 4] + auxGetNumDevs endp + auxGetVolume proc + jmp DWORD ptr OriginalFuncs_winmm[14 * 4] + auxGetVolume endp + auxOutMessage proc + jmp DWORD ptr OriginalFuncs_winmm[15 * 4] + auxOutMessage endp + auxSetVolume proc + jmp DWORD ptr OriginalFuncs_winmm[16 * 4] + auxSetVolume endp + joyConfigChanged proc + jmp DWORD ptr OriginalFuncs_winmm[17 * 4] + joyConfigChanged endp + joyGetDevCapsA proc + jmp DWORD ptr OriginalFuncs_winmm[18 * 4] + joyGetDevCapsA endp + joyGetDevCapsW proc + jmp DWORD ptr OriginalFuncs_winmm[19 * 4] + joyGetDevCapsW endp + joyGetNumDevs proc + jmp DWORD ptr OriginalFuncs_winmm[20 * 4] + joyGetNumDevs endp + joyGetPos proc + jmp DWORD ptr OriginalFuncs_winmm[21 * 4] + joyGetPos endp + joyGetPosEx proc + jmp DWORD ptr OriginalFuncs_winmm[22 * 4] + joyGetPosEx endp + joyGetThreshold proc + jmp DWORD ptr OriginalFuncs_winmm[23 * 4] + joyGetThreshold endp + joyReleaseCapture proc + jmp DWORD ptr OriginalFuncs_winmm[24 * 4] + joyReleaseCapture endp + joySetCapture proc + jmp DWORD ptr OriginalFuncs_winmm[25 * 4] + joySetCapture endp + joySetThreshold proc + jmp DWORD ptr OriginalFuncs_winmm[26 * 4] + joySetThreshold endp + mciDriverNotify proc + jmp DWORD ptr OriginalFuncs_winmm[27 * 4] + mciDriverNotify endp + mciDriverYield proc + jmp DWORD ptr OriginalFuncs_winmm[28 * 4] + mciDriverYield endp + mciExecute proc + jmp DWORD ptr OriginalFuncs_winmm[29 * 4] + mciExecute endp + mciFreeCommandResource proc + jmp DWORD ptr OriginalFuncs_winmm[30 * 4] + mciFreeCommandResource endp + mciGetCreatorTask proc + jmp DWORD ptr OriginalFuncs_winmm[31 * 4] + mciGetCreatorTask endp + mciGetDeviceIDA proc + jmp DWORD ptr OriginalFuncs_winmm[32 * 4] + mciGetDeviceIDA endp + mciGetDeviceIDFromElementIDA proc + jmp DWORD ptr OriginalFuncs_winmm[33 * 4] + mciGetDeviceIDFromElementIDA endp + mciGetDeviceIDFromElementIDW proc + jmp DWORD ptr OriginalFuncs_winmm[34 * 4] + mciGetDeviceIDFromElementIDW endp + mciGetDeviceIDW proc + jmp DWORD ptr OriginalFuncs_winmm[35 * 4] + mciGetDeviceIDW endp + mciGetDriverData proc + jmp DWORD ptr OriginalFuncs_winmm[36 * 4] + mciGetDriverData endp + mciGetErrorStringA proc + jmp DWORD ptr OriginalFuncs_winmm[37 * 4] + mciGetErrorStringA endp + mciGetErrorStringW proc + jmp DWORD ptr OriginalFuncs_winmm[38 * 4] + mciGetErrorStringW endp + mciGetYieldProc proc + jmp DWORD ptr OriginalFuncs_winmm[39 * 4] + mciGetYieldProc endp + mciLoadCommandResource proc + jmp DWORD ptr OriginalFuncs_winmm[40 * 4] + mciLoadCommandResource endp + mciSendCommandA proc + jmp DWORD ptr OriginalFuncs_winmm[41 * 4] + mciSendCommandA endp + mciSendCommandW proc + jmp DWORD ptr OriginalFuncs_winmm[42 * 4] + mciSendCommandW endp + mciSendStringA proc + jmp DWORD ptr OriginalFuncs_winmm[43 * 4] + mciSendStringA endp + mciSendStringW proc + jmp DWORD ptr OriginalFuncs_winmm[44 * 4] + mciSendStringW endp + mciSetDriverData proc + jmp DWORD ptr OriginalFuncs_winmm[45 * 4] + mciSetDriverData endp + mciSetYieldProc proc + jmp DWORD ptr OriginalFuncs_winmm[46 * 4] + mciSetYieldProc endp + midiConnect proc + jmp DWORD ptr OriginalFuncs_winmm[47 * 4] + midiConnect endp + midiDisconnect proc + jmp DWORD ptr OriginalFuncs_winmm[48 * 4] + midiDisconnect endp + midiInAddBuffer proc + jmp DWORD ptr OriginalFuncs_winmm[49 * 4] + midiInAddBuffer endp + midiInClose proc + jmp DWORD ptr OriginalFuncs_winmm[50 * 4] + midiInClose endp + midiInGetDevCapsA proc + jmp DWORD ptr OriginalFuncs_winmm[51 * 4] + midiInGetDevCapsA endp + midiInGetDevCapsW proc + jmp DWORD ptr OriginalFuncs_winmm[52 * 4] + midiInGetDevCapsW endp + midiInGetErrorTextA proc + jmp DWORD ptr OriginalFuncs_winmm[53 * 4] + midiInGetErrorTextA endp + midiInGetErrorTextW proc + jmp DWORD ptr OriginalFuncs_winmm[54 * 4] + midiInGetErrorTextW endp + midiInGetID proc + jmp DWORD ptr OriginalFuncs_winmm[55 * 4] + midiInGetID endp + midiInGetNumDevs proc + jmp DWORD ptr OriginalFuncs_winmm[56 * 4] + midiInGetNumDevs endp + midiInMessage proc + jmp DWORD ptr OriginalFuncs_winmm[57 * 4] + midiInMessage endp + midiInOpen proc + jmp DWORD ptr OriginalFuncs_winmm[58 * 4] + midiInOpen endp + midiInPrepareHeader proc + jmp DWORD ptr OriginalFuncs_winmm[59 * 4] + midiInPrepareHeader endp + midiInReset proc + jmp DWORD ptr OriginalFuncs_winmm[60 * 4] + midiInReset endp + midiInStart proc + jmp DWORD ptr OriginalFuncs_winmm[61 * 4] + midiInStart endp + midiInStop proc + jmp DWORD ptr OriginalFuncs_winmm[62 * 4] + midiInStop endp + midiInUnprepareHeader proc + jmp DWORD ptr OriginalFuncs_winmm[63 * 4] + midiInUnprepareHeader endp + midiOutCacheDrumPatches proc + jmp DWORD ptr OriginalFuncs_winmm[64 * 4] + midiOutCacheDrumPatches endp + midiOutCachePatches proc + jmp DWORD ptr OriginalFuncs_winmm[65 * 4] + midiOutCachePatches endp + midiOutClose proc + jmp DWORD ptr OriginalFuncs_winmm[66 * 4] + midiOutClose endp + midiOutGetDevCapsA proc + jmp DWORD ptr OriginalFuncs_winmm[67 * 4] + midiOutGetDevCapsA endp + midiOutGetDevCapsW proc + jmp DWORD ptr OriginalFuncs_winmm[68 * 4] + midiOutGetDevCapsW endp + midiOutGetErrorTextA proc + jmp DWORD ptr OriginalFuncs_winmm[69 * 4] + midiOutGetErrorTextA endp + midiOutGetErrorTextW proc + jmp DWORD ptr OriginalFuncs_winmm[70 * 4] + midiOutGetErrorTextW endp + midiOutGetID proc + jmp DWORD ptr OriginalFuncs_winmm[71 * 4] + midiOutGetID endp + midiOutGetNumDevs proc + jmp DWORD ptr OriginalFuncs_winmm[72 * 4] + midiOutGetNumDevs endp + midiOutGetVolume proc + jmp DWORD ptr OriginalFuncs_winmm[73 * 4] + midiOutGetVolume endp + midiOutLongMsg proc + jmp DWORD ptr OriginalFuncs_winmm[74 * 4] + midiOutLongMsg endp + midiOutMessage proc + jmp DWORD ptr OriginalFuncs_winmm[75 * 4] + midiOutMessage endp + midiOutOpen proc + jmp DWORD ptr OriginalFuncs_winmm[76 * 4] + midiOutOpen endp + midiOutPrepareHeader proc + jmp DWORD ptr OriginalFuncs_winmm[77 * 4] + midiOutPrepareHeader endp + midiOutReset proc + jmp DWORD ptr OriginalFuncs_winmm[78 * 4] + midiOutReset endp + midiOutSetVolume proc + jmp DWORD ptr OriginalFuncs_winmm[79 * 4] + midiOutSetVolume endp + midiOutShortMsg proc + jmp DWORD ptr OriginalFuncs_winmm[80 * 4] + midiOutShortMsg endp + midiOutUnprepareHeader proc + jmp DWORD ptr OriginalFuncs_winmm[81 * 4] + midiOutUnprepareHeader endp + midiStreamClose proc + jmp DWORD ptr OriginalFuncs_winmm[82 * 4] + midiStreamClose endp + midiStreamOpen proc + jmp DWORD ptr OriginalFuncs_winmm[83 * 4] + midiStreamOpen endp + midiStreamOut proc + jmp DWORD ptr OriginalFuncs_winmm[84 * 4] + midiStreamOut endp + midiStreamPause proc + jmp DWORD ptr OriginalFuncs_winmm[85 * 4] + midiStreamPause endp + midiStreamPosition proc + jmp DWORD ptr OriginalFuncs_winmm[86 * 4] + midiStreamPosition endp + midiStreamProperty proc + jmp DWORD ptr OriginalFuncs_winmm[87 * 4] + midiStreamProperty endp + midiStreamRestart proc + jmp DWORD ptr OriginalFuncs_winmm[88 * 4] + midiStreamRestart endp + midiStreamStop proc + jmp DWORD ptr OriginalFuncs_winmm[89 * 4] + midiStreamStop endp + mixerClose proc + jmp DWORD ptr OriginalFuncs_winmm[90 * 4] + mixerClose endp + mixerGetControlDetailsA proc + jmp DWORD ptr OriginalFuncs_winmm[91 * 4] + mixerGetControlDetailsA endp + mixerGetControlDetailsW proc + jmp DWORD ptr OriginalFuncs_winmm[92 * 4] + mixerGetControlDetailsW endp + mixerGetDevCapsA proc + jmp DWORD ptr OriginalFuncs_winmm[93 * 4] + mixerGetDevCapsA endp + mixerGetDevCapsW proc + jmp DWORD ptr OriginalFuncs_winmm[94 * 4] + mixerGetDevCapsW endp + mixerGetID proc + jmp DWORD ptr OriginalFuncs_winmm[95 * 4] + mixerGetID endp + mixerGetLineControlsA proc + jmp DWORD ptr OriginalFuncs_winmm[96 * 4] + mixerGetLineControlsA endp + mixerGetLineControlsW proc + jmp DWORD ptr OriginalFuncs_winmm[97 * 4] + mixerGetLineControlsW endp + mixerGetLineInfoA proc + jmp DWORD ptr OriginalFuncs_winmm[98 * 4] + mixerGetLineInfoA endp + mixerGetLineInfoW proc + jmp DWORD ptr OriginalFuncs_winmm[99 * 4] + mixerGetLineInfoW endp + mixerGetNumDevs proc + jmp DWORD ptr OriginalFuncs_winmm[100 * 4] + mixerGetNumDevs endp + mixerMessage proc + jmp DWORD ptr OriginalFuncs_winmm[101 * 4] + mixerMessage endp + mixerOpen proc + jmp DWORD ptr OriginalFuncs_winmm[102 * 4] + mixerOpen endp + mixerSetControlDetails proc + jmp DWORD ptr OriginalFuncs_winmm[103 * 4] + mixerSetControlDetails endp + mmDrvInstall proc + jmp DWORD ptr OriginalFuncs_winmm[104 * 4] + mmDrvInstall endp + mmGetCurrentTask proc + jmp DWORD ptr OriginalFuncs_winmm[105 * 4] + mmGetCurrentTask endp + mmTaskBlock proc + jmp DWORD ptr OriginalFuncs_winmm[106 * 4] + mmTaskBlock endp + mmTaskCreate proc + jmp DWORD ptr OriginalFuncs_winmm[107 * 4] + mmTaskCreate endp + mmTaskSignal proc + jmp DWORD ptr OriginalFuncs_winmm[108 * 4] + mmTaskSignal endp + mmTaskYield proc + jmp DWORD ptr OriginalFuncs_winmm[109 * 4] + mmTaskYield endp + mmioAdvance proc + jmp DWORD ptr OriginalFuncs_winmm[110 * 4] + mmioAdvance endp + mmioAscend proc + jmp DWORD ptr OriginalFuncs_winmm[111 * 4] + mmioAscend endp + mmioClose proc + jmp DWORD ptr OriginalFuncs_winmm[112 * 4] + mmioClose endp + mmioCreateChunk proc + jmp DWORD ptr OriginalFuncs_winmm[113 * 4] + mmioCreateChunk endp + mmioDescend proc + jmp DWORD ptr OriginalFuncs_winmm[114 * 4] + mmioDescend endp + mmioFlush proc + jmp DWORD ptr OriginalFuncs_winmm[115 * 4] + mmioFlush endp + mmioGetInfo proc + jmp DWORD ptr OriginalFuncs_winmm[116 * 4] + mmioGetInfo endp + mmioInstallIOProcA proc + jmp DWORD ptr OriginalFuncs_winmm[117 * 4] + mmioInstallIOProcA endp + mmioInstallIOProcW proc + jmp DWORD ptr OriginalFuncs_winmm[118 * 4] + mmioInstallIOProcW endp + mmioOpenA proc + jmp DWORD ptr OriginalFuncs_winmm[119 * 4] + mmioOpenA endp + mmioOpenW proc + jmp DWORD ptr OriginalFuncs_winmm[120 * 4] + mmioOpenW endp + mmioRead proc + jmp DWORD ptr OriginalFuncs_winmm[121 * 4] + mmioRead endp + mmioRenameA proc + jmp DWORD ptr OriginalFuncs_winmm[122 * 4] + mmioRenameA endp + mmioRenameW proc + jmp DWORD ptr OriginalFuncs_winmm[123 * 4] + mmioRenameW endp + mmioSeek proc + jmp DWORD ptr OriginalFuncs_winmm[124 * 4] + mmioSeek endp + mmioSendMessage proc + jmp DWORD ptr OriginalFuncs_winmm[125 * 4] + mmioSendMessage endp + mmioSetBuffer proc + jmp DWORD ptr OriginalFuncs_winmm[126 * 4] + mmioSetBuffer endp + mmioSetInfo proc + jmp DWORD ptr OriginalFuncs_winmm[127 * 4] + mmioSetInfo endp + mmioStringToFOURCCA proc + jmp DWORD ptr OriginalFuncs_winmm[128 * 4] + mmioStringToFOURCCA endp + mmioStringToFOURCCW proc + jmp DWORD ptr OriginalFuncs_winmm[129 * 4] + mmioStringToFOURCCW endp + mmioWrite proc + jmp DWORD ptr OriginalFuncs_winmm[130 * 4] + mmioWrite endp + mmsystemGetVersion proc + jmp DWORD ptr OriginalFuncs_winmm[131 * 4] + mmsystemGetVersion endp + sndPlaySoundA proc + jmp DWORD ptr OriginalFuncs_winmm[132 * 4] + sndPlaySoundA endp + sndPlaySoundW proc + jmp DWORD ptr OriginalFuncs_winmm[133 * 4] + sndPlaySoundW endp + timeBeginPeriod proc + jmp DWORD ptr OriginalFuncs_winmm[134 * 4] + timeBeginPeriod endp + timeEndPeriod proc + jmp DWORD ptr OriginalFuncs_winmm[135 * 4] + timeEndPeriod endp + timeGetDevCaps proc + jmp DWORD ptr OriginalFuncs_winmm[136 * 4] + timeGetDevCaps endp + timeGetSystemTime proc + jmp DWORD ptr OriginalFuncs_winmm[137 * 4] + timeGetSystemTime endp + timeGetTime proc + jmp DWORD ptr OriginalFuncs_winmm[138 * 4] + timeGetTime endp + timeKillEvent proc + jmp DWORD ptr OriginalFuncs_winmm[139 * 4] + timeKillEvent endp + timeSetEvent proc + jmp DWORD ptr OriginalFuncs_winmm[140 * 4] + timeSetEvent endp + waveInAddBuffer proc + jmp DWORD ptr OriginalFuncs_winmm[141 * 4] + waveInAddBuffer endp + waveInClose proc + jmp DWORD ptr OriginalFuncs_winmm[142 * 4] + waveInClose endp + waveInGetDevCapsA proc + jmp DWORD ptr OriginalFuncs_winmm[143 * 4] + waveInGetDevCapsA endp + waveInGetDevCapsW proc + jmp DWORD ptr OriginalFuncs_winmm[144 * 4] + waveInGetDevCapsW endp + waveInGetErrorTextA proc + jmp DWORD ptr OriginalFuncs_winmm[145 * 4] + waveInGetErrorTextA endp + waveInGetErrorTextW proc + jmp DWORD ptr OriginalFuncs_winmm[146 * 4] + waveInGetErrorTextW endp + waveInGetID proc + jmp DWORD ptr OriginalFuncs_winmm[147 * 4] + waveInGetID endp + waveInGetNumDevs proc + jmp DWORD ptr OriginalFuncs_winmm[148 * 4] + waveInGetNumDevs endp + waveInGetPosition proc + jmp DWORD ptr OriginalFuncs_winmm[149 * 4] + waveInGetPosition endp + waveInMessage proc + jmp DWORD ptr OriginalFuncs_winmm[150 * 4] + waveInMessage endp + waveInOpen proc + jmp DWORD ptr OriginalFuncs_winmm[151 * 4] + waveInOpen endp + waveInPrepareHeader proc + jmp DWORD ptr OriginalFuncs_winmm[152 * 4] + waveInPrepareHeader endp + waveInReset proc + jmp DWORD ptr OriginalFuncs_winmm[153 * 4] + waveInReset endp + waveInStart proc + jmp DWORD ptr OriginalFuncs_winmm[154 * 4] + waveInStart endp + waveInStop proc + jmp DWORD ptr OriginalFuncs_winmm[155 * 4] + waveInStop endp + waveInUnprepareHeader proc + jmp DWORD ptr OriginalFuncs_winmm[156 * 4] + waveInUnprepareHeader endp + waveOutBreakLoop proc + jmp DWORD ptr OriginalFuncs_winmm[157 * 4] + waveOutBreakLoop endp + waveOutClose proc + jmp DWORD ptr OriginalFuncs_winmm[158 * 4] + waveOutClose endp + waveOutGetDevCapsA proc + jmp DWORD ptr OriginalFuncs_winmm[159 * 4] + waveOutGetDevCapsA endp + waveOutGetDevCapsW proc + jmp DWORD ptr OriginalFuncs_winmm[160 * 4] + waveOutGetDevCapsW endp + waveOutGetErrorTextA proc + jmp DWORD ptr OriginalFuncs_winmm[161 * 4] + waveOutGetErrorTextA endp + waveOutGetErrorTextW proc + jmp DWORD ptr OriginalFuncs_winmm[162 * 4] + waveOutGetErrorTextW endp + waveOutGetID proc + jmp DWORD ptr OriginalFuncs_winmm[163 * 4] + waveOutGetID endp + waveOutGetNumDevs proc + jmp DWORD ptr OriginalFuncs_winmm[164 * 4] + waveOutGetNumDevs endp + waveOutGetPitch proc + jmp DWORD ptr OriginalFuncs_winmm[165 * 4] + waveOutGetPitch endp + waveOutGetPlaybackRate proc + jmp DWORD ptr OriginalFuncs_winmm[166 * 4] + waveOutGetPlaybackRate endp + waveOutGetPosition proc + jmp DWORD ptr OriginalFuncs_winmm[167 * 4] + waveOutGetPosition endp + waveOutGetVolume proc + jmp DWORD ptr OriginalFuncs_winmm[168 * 4] + waveOutGetVolume endp + waveOutMessage proc + jmp DWORD ptr OriginalFuncs_winmm[169 * 4] + waveOutMessage endp + waveOutOpen proc + jmp DWORD ptr OriginalFuncs_winmm[170 * 4] + waveOutOpen endp + waveOutPause proc + jmp DWORD ptr OriginalFuncs_winmm[171 * 4] + waveOutPause endp + waveOutPrepareHeader proc + jmp DWORD ptr OriginalFuncs_winmm[172 * 4] + waveOutPrepareHeader endp + waveOutReset proc + jmp DWORD ptr OriginalFuncs_winmm[173 * 4] + waveOutReset endp + waveOutRestart proc + jmp DWORD ptr OriginalFuncs_winmm[174 * 4] + waveOutRestart endp + waveOutSetPitch proc + jmp DWORD ptr OriginalFuncs_winmm[175 * 4] + waveOutSetPitch endp + waveOutSetPlaybackRate proc + jmp DWORD ptr OriginalFuncs_winmm[176 * 4] + waveOutSetPlaybackRate endp + waveOutSetVolume proc + jmp DWORD ptr OriginalFuncs_winmm[177 * 4] + waveOutSetVolume endp + waveOutUnprepareHeader proc + jmp DWORD ptr OriginalFuncs_winmm[178 * 4] + waveOutUnprepareHeader endp + waveOutWrite proc + jmp DWORD ptr OriginalFuncs_winmm[179 * 4] + waveOutWrite endp + ExportByOrdinal2 proc + jmp DWORD ptr OriginalFuncs_winmm[180 * 4] + ExportByOrdinal2 endp +endif +end \ No newline at end of file diff --git a/HD2Cheeto.rc b/HD2Cheeto.rc new file mode 100644 index 0000000..53b4d0f --- /dev/null +++ b/HD2Cheeto.rc @@ -0,0 +1,106 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,0 + PRODUCTVERSION 1,0,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "GitHub: Taiga74164" + VALUE "FileDescription", "Hell Divers 2 Cheat" + VALUE "FileVersion", "1.0.0.0" + VALUE "InternalName", "HD2Cheeto.dll" + VALUE "OriginalFilename", "HD2Cheeto.dll" + VALUE "ProductName", "HD2Cheeto" + VALUE "ProductVersion", "1.0.0.0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/HD2Cheeto.sln b/HD2Cheeto.sln new file mode 100644 index 0000000..f68256f --- /dev/null +++ b/HD2Cheeto.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32929.385 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HD2Cheeto", "HD2Cheeto.vcxproj", "{41503935-0CD8-44F5-BD2C-3A4F46E0D197}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {41503935-0CD8-44F5-BD2C-3A4F46E0D197}.Release|x64.ActiveCfg = Release|x64 + {41503935-0CD8-44F5-BD2C-3A4F46E0D197}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {75D032EF-1FF7-434C-B3C1-4C9D1286A223} + EndGlobalSection +EndGlobal diff --git a/HD2Cheeto.vcxproj b/HD2Cheeto.vcxproj new file mode 100644 index 0000000..196e97d --- /dev/null +++ b/HD2Cheeto.vcxproj @@ -0,0 +1,93 @@ + + + + + Release + x64 + + + + 16.0 + Win32Proj + {41503935-0cd8-44f5-bd2c-3a4f46e0d197} + HD2Cheeto + 10.0 + HD2Cheeto + + + + DynamicLibrary + false + v143 + true + MultiByte + + + + + + + + + + + + + + + + Level3 + true + true + true + NDEBUG;HD2Cheeto_EXPORTS;_WINDOWS;_USRDLL;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions) + true + NotUsing + pch.h + true + stdcpp20 + $(ProjectDir) + + + Windows + true + true + false + false + Exports/Exports.def + %(AdditionalDependencies) + + + xcopy /f /y "$(TargetDir)$(ProjectName).dll" "D:\SteamLibrary\steamapps\common\Helldivers 2\bin\version.dll*" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Memory.cpp b/Memory.cpp new file mode 100644 index 0000000..241b598 --- /dev/null +++ b/Memory.cpp @@ -0,0 +1,135 @@ +#include "Memory.h" + +std::unordered_map Memory::patches; + +void Memory::PatchBytes(void* address, const char* bytes) +{ + // Get the length of the bytes. + auto len = strlen(bytes); + + // Store the original bytes. + PatchInfo info; + info.address = address; + info.originalBytes.resize(len); + memcpy(info.originalBytes.data(), address, len); + + // Patch the bytes. + DWORD oldProtect; + VirtualProtect(address, len, PAGE_EXECUTE_READWRITE, &oldProtect); + memcpy(address, bytes, len); + VirtualProtect(address, len, oldProtect, &oldProtect); + + // Store the patch info. + patches[address] = info; +} + +void Memory::NopBytes(void* address, const size_t len) +{ + std::vector nops(len, 0x90); + PatchBytes(address, nops.data()); +} + +void Memory::RestoreBytes(void* address) +{ + auto it = patches.find(address); + if (it != patches.end()) + { + // Restore the original bytes. + const auto& info = it->second; + DWORD oldProtect; + VirtualProtect(info.address, info.originalBytes.size(), PAGE_EXECUTE_READWRITE, &oldProtect); + memcpy(info.address, info.originalBytes.data(), info.originalBytes.size()); + VirtualProtect(info.address, info.originalBytes.size(), oldProtect, &oldProtect); + + // Remove the patch info. + patches.erase(it); + } +} + +uintptr_t Memory::PatternScan(uintptr_t module, const char* signature) +{ + static auto patternToByte = [](const char* pattern) + { + auto bytes = std::vector{}; + const auto start = const_cast(pattern); + const auto end = const_cast(pattern) + strlen(pattern); + + for (auto current = start; current < end; ++current) + { + if (*current == '?') + { + ++current; + if (*current == '?') + ++current; + bytes.push_back(-1); + } + else + { + bytes.push_back(strtoul(current, ¤t, 16)); + } + } + return bytes; + }; + + const auto dosHeader = (PIMAGE_DOS_HEADER)module; + const auto ntHeaders = (PIMAGE_NT_HEADERS)((std::uint8_t*)module + dosHeader->e_lfanew); + + const auto sizeOfImage = ntHeaders->OptionalHeader.SizeOfImage; + auto patternBytes = patternToByte(signature); + const auto scanBytes = reinterpret_cast(module); + + const auto s = patternBytes.size(); + const auto d = patternBytes.data(); + + for (auto i = 0ul; i < sizeOfImage - s; ++i) + { + bool found = true; + for (auto j = 0ul; j < s; ++j) + { + if (scanBytes[i + j] != d[j] && d[j] != -1) + { + found = false; + break; + } + } + if (found) + { + // return reinterpret_cast(&scanBytes[i]); + // Return the address of the pattern. + return module + i; + } + } + return NULL; +} + +void* Memory::AllocateNearbyMemory(uintptr_t address, size_t size) +{ + // Get the system allocation granularity. + SYSTEM_INFO si; + GetSystemInfo(&si); + + // Calculate the start and end addresses. + auto start = (address > si.dwAllocationGranularity) ? (address - si.dwAllocationGranularity) : 0; + auto end = address + si.dwAllocationGranularity; + + // Iterate through the memory range and find a suitable location. + MEMORY_BASIC_INFORMATION mbi; + while (start < end && VirtualQuery((LPCVOID)start, &mbi, sizeof(mbi))) + { + // If the memory is free and large enough, allocate it. + if (mbi.State == MEM_FREE && mbi.RegionSize >= size) + { + auto ptr = VirtualAlloc((LPVOID)start, size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); + if (ptr) + return ptr; + } + + // Move to the next memory region. + start += si.dwAllocationGranularity; + } + + // If we couldn't find a suitable location, just allocate the memory anywhere. + return VirtualAlloc(nullptr, size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); +} + + diff --git a/Memory.h b/Memory.h new file mode 100644 index 0000000..a898e76 --- /dev/null +++ b/Memory.h @@ -0,0 +1,23 @@ +#pragma once +#include +#include +#include + +class Memory +{ +public: + static void PatchBytes(void* address, const char* bytes); + static void NopBytes(void* address, size_t len); + static void RestoreBytes(void* address); + static uintptr_t PatternScan(uintptr_t module, const char* signature); + static void* AllocateNearbyMemory(uintptr_t address, size_t size); + //static void CreateTrampolite(void* address, void* destination, size_t length); + //static void RemoveTrampolite(void* address); +private: + struct PatchInfo { + std::vector originalBytes; + void* address; + }; + + static std::unordered_map patches; +}; diff --git a/README.md b/README.md new file mode 100644 index 0000000..1047058 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +## HD2Cheeto + +This cheat is based on emoisback's [PoC](https://github.com/emoisback/Helldivers-2-Hack-PoC) + +I made this cheat while I was in class so currently, all features will activate when F1 is pressed. I unfortunately dont have the time to add extra features like config, gui, etc. + +If you wish to have more features and regular updates, use emoisback's cheat on [UnknownCheats](https://www.unknowncheats.me/forum/helldivers-2-a/625832-helldivers-2-hack-dll-proxy-proof-concept.html) which is using the same concept as mine. + +### Features +- Infinite Grenades +- Infinite Ammo +- Infinite Syringe +- Infinite Mission Time +- Infinite Health +- Infinite Strategems +- No Reload + +### Building +- Make sure to change the game directory in **Post-Build Event** + +### Special Thanks +- [emoisback](https://github.com/emoisback) +- [@gir489 and contributors](https://fearlessrevolution.com/viewtopic.php?f=4&t=27812) +- ergrelet for the [unpacker](https://github.com/ergrelet/unlicense) \ No newline at end of file diff --git a/Utils.cpp b/Utils.cpp new file mode 100644 index 0000000..280ccb1 --- /dev/null +++ b/Utils.cpp @@ -0,0 +1,159 @@ +#include "Utils.h" +#include +#include +#include +#include +#include +#include +#include + +std::mutex _mutex; + +namespace Utils +{ + void AttachConsole() + { + AllocConsole(); + freopen_s((FILE**)stdin, "CONIN$", "r", stdin); + freopen_s((FILE**)stdout, "CONOUT$", "w", stdout); + freopen_s((FILE**)stderr, "CONOUT$", "w", stderr); + SetConsoleOutputCP(CP_UTF8); + } + + void DetachConsole() + { + fclose(stdin); + fclose(stdout); + fclose(stderr); + FreeConsole(); + } + + void ConsolePrint(const char* filepath, int line, const char* fmt, ...) + { + char buf[4096]; + + va_list va; + va_start(va, fmt); + vsprintf_s(buf, fmt, va); + va_end(va); + + const std::lock_guard lock(_mutex); + + auto filename = std::filesystem::path(filepath).filename().string(); + auto logLineConsole = string_format("[%s:%d] %s", filename.c_str(), line, buf); + auto str = (logLineConsole + std::string(fmt)).c_str(); + + std::cout << logLineConsole << std::endl; + } + + void ConsolePrint(const char* filepath, int line, const wchar_t* fmt, ...) + { + wchar_t buf[4096]; + + va_list va; + va_start(va, fmt); + vswprintf_s(buf, fmt, va); + va_end(va); + + const std::lock_guard lock(_mutex); + + auto filename = std::filesystem::path(filepath).filename().string(); + auto logLineConsole = string_format("[%s:%d] %s", filename.c_str(), line, buf); + auto str = (logLineConsole + to_string(std::wstring(fmt))).c_str(); + + std::cout << logLineConsole << std::endl; + } + + void ClearConsole() + { + DWORD n; /* Number of characters written */ + DWORD size; /* number of visible characters */ + COORD coord = { 0 }; /* Top left screen position */ + CONSOLE_SCREEN_BUFFER_INFO csbi; + + /* Get a handle to the console */ + HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); + + GetConsoleScreenBufferInfo(h, &csbi); + + /* Find the number of characters to overwrite */ + size = csbi.dwSize.X * csbi.dwSize.Y; + + /* Overwrite the screen buffer with whitespace */ + FillConsoleOutputCharacter(h, TEXT(' '), size, coord, &n); + GetConsoleScreenBufferInfo(h, &csbi); + FillConsoleOutputAttribute(h, csbi.wAttributes, size, coord, &n); + + /* Reset the cursor to the top left position */ + SetConsoleCursorPosition(h, coord); + } + + char ConsoleReadKey() + { + auto key = char{ 0 }; + auto keysread = DWORD{ 0 }; + + //ReadConsoleA(_in, &key, 1, &keysread, nullptr); + return std::cin.get(); + } + + std::string GetAddressModuleName(uintptr_t address) + { + std::vector Modules{}; + + static DWORD pid = GetCurrentProcessId(); + MODULEENTRY32 mod{}; + mod.dwSize = sizeof(mod); + HANDLE snap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pid); + for (Module32First(snap, &mod); Module32Next(snap, &mod);) + { + if (mod.th32ProcessID != pid) + continue; + + Modules.emplace_back(mod); + } + CloseHandle(snap); + + for (const auto& it : Modules) + { + if (address >= (uintptr_t)it.modBaseAddr && address <= (uintptr_t)it.modBaseAddr + it.modBaseSize) + return it.szModule; + } + + return "unknown"; + } + + std::wstring GetCurrentProcessNameW() + { + DWORD processID = GetCurrentProcessId(); + HANDLE processHandle = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID); + + if (processHandle != NULL) + { + WCHAR processName[MAX_PATH] = L""; + GetModuleBaseNameW(processHandle, NULL, processName, MAX_PATH); + CloseHandle(processHandle); + return std::wstring(processName); + } + + // In case the handle could not be opened, return an error message. + return L"Unable to retrieve process name."; + } + + std::string GetCurrentProcessNameA() + { + return to_string(GetCurrentProcessNameW()); + } + + std::string to_string(std::wstring wstr) + { + std::wstring_convert> strconverter; + return strconverter.to_bytes(wstr); + } + + std::wstring to_wstring(std::string str) + { + std::wstring_convert> strconverter; + return strconverter.from_bytes(str); + } +} \ No newline at end of file diff --git a/Utils.h b/Utils.h new file mode 100644 index 0000000..5f9ca3a --- /dev/null +++ b/Utils.h @@ -0,0 +1,34 @@ +#pragma once +#include +#include + +#define LOG(fmt, ...) Utils::ConsolePrint(__FILE__, __LINE__, fmt, __VA_ARGS__) + +namespace Utils +{ + void AttachConsole(); + void DetachConsole(); + void ConsolePrint(const char* filepath, int line, const char* fmt, ...); + void ConsolePrint(const char* filepath, int line, const wchar_t* fmt, ...); + void ClearConsole(); + char ConsoleReadKey(); + + template + std::string string_format(const std::string& format, Args ... args) + { + int size_s = std::snprintf(nullptr, 0, format.c_str(), args ...) + 1; // Extra space for '\0' + if (size_s <= 0) { throw std::runtime_error("Error during formatting."); } + auto size = static_cast(size_s); + auto buf = std::make_unique(size); + std::snprintf(buf.get(), size, format.c_str(), args ...); + return std::string(buf.get(), buf.get() + size - 1); // We don't want the '\0' inside + } + + std::string GetAddressModuleName(uintptr_t address); + + std::wstring GetCurrentProcessNameW(); + std::string GetCurrentProcessNameA(); + + std::string to_string(std::wstring wstr); + std::wstring to_wstring(std::string str); +} \ No newline at end of file diff --git a/dllmain.cpp b/dllmain.cpp new file mode 100644 index 0000000..ad16713 --- /dev/null +++ b/dllmain.cpp @@ -0,0 +1,13 @@ +#include "Core/Core.h" + +BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hModule); + Core::Initialize(hModule); + break; + } + return TRUE; +} diff --git a/resource.h b/resource.h new file mode 100644 index 0000000..d403676 --- /dev/null +++ b/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by HD2Cheeto.rc +// +#define IDR_ACCELERATOR1 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40002 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif