├── .gitattributes ├── .gitignore ├── Client Base.sln ├── Client Base ├── Client Base.vcxproj ├── Client Base.vcxproj.filters ├── Client Base.vcxproj.user ├── Client.cpp ├── Client │ ├── ClientManager.cpp │ ├── ClientManager.h │ ├── Hooks │ │ ├── ClientInstance.h │ │ ├── GameMode.h │ │ ├── KeyItem.h │ │ └── RenderContext.h │ └── Modules │ │ ├── AirJump.cpp │ │ ├── AirJump.h │ │ ├── AutoSprint.cpp │ │ ├── AutoSprint.h │ │ ├── Hitbox.cpp │ │ ├── Hitbox.h │ │ ├── Instabreak.cpp │ │ ├── Instabreak.h │ │ ├── Jesus.cpp │ │ ├── Jesus.h │ │ ├── Jetpack.cpp │ │ ├── Jetpack.h │ │ ├── Killaura.cpp │ │ ├── Killaura.h │ │ ├── TabGUI.cpp │ │ ├── TabGUI.h │ │ ├── TestModule.cpp │ │ ├── TestModule.h │ │ ├── Uninject.cpp │ │ └── Uninject.h ├── Other │ ├── Module.cpp │ ├── Module.h │ ├── Utils.cpp │ └── Utils.h ├── SDK │ ├── Classes │ │ ├── Actor.h │ │ ├── ClientInstance.h │ │ ├── GameMode.h │ │ ├── LocalPlayer.h │ │ ├── MinecraftUIRenderContext.h │ │ ├── MultiPlayerLevel.h │ │ └── TextHolder.h │ └── Minecraft.h └── packages.config ├── LocalPlayer.rcnet ├── README.md └── packages └── minhook.1.3.3 ├── .signature.p7s ├── build └── native │ └── minhook.targets ├── lib └── native │ └── include │ └── MinHook.h └── minhook.1.3.3.nupkg /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vs/ 2 | /.vs/ 3 | .vs/* 4 | /.vs/* 5 | */Debug/ 6 | */Release/ 7 | */x64 8 | */obj/ 9 | *.obj 10 | *.ilk 11 | */*/Debug 12 | */*/Release 13 | Debug/ 14 | Release/ 15 | *.lib -------------------------------------------------------------------------------- /Client Base.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30717.126 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Client Base", "Client Base\Client Base.vcxproj", "{27A13AF4-71F1-4471-963B-26AEC92C2EC5}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {27A13AF4-71F1-4471-963B-26AEC92C2EC5}.Debug|x64.ActiveCfg = Debug|x64 17 | {27A13AF4-71F1-4471-963B-26AEC92C2EC5}.Debug|x64.Build.0 = Debug|x64 18 | {27A13AF4-71F1-4471-963B-26AEC92C2EC5}.Debug|x86.ActiveCfg = Debug|Win32 19 | {27A13AF4-71F1-4471-963B-26AEC92C2EC5}.Debug|x86.Build.0 = Debug|Win32 20 | {27A13AF4-71F1-4471-963B-26AEC92C2EC5}.Release|x64.ActiveCfg = Release|x64 21 | {27A13AF4-71F1-4471-963B-26AEC92C2EC5}.Release|x64.Build.0 = Release|x64 22 | {27A13AF4-71F1-4471-963B-26AEC92C2EC5}.Release|x86.ActiveCfg = Release|Win32 23 | {27A13AF4-71F1-4471-963B-26AEC92C2EC5}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {CE16FEFE-1ADA-43AF-98C5-34BCB52A7247} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /Client Base/Client Base.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {27a13af4-71f1-4471-963b-26aec92c2ec5} 25 | ClientBase 26 | 10.0 27 | 28 | 29 | 30 | DynamicLibrary 31 | true 32 | v142 33 | Unicode 34 | 35 | 36 | DynamicLibrary 37 | false 38 | v142 39 | true 40 | Unicode 41 | 42 | 43 | DynamicLibrary 44 | true 45 | v142 46 | Unicode 47 | 48 | 49 | DynamicLibrary 50 | false 51 | v142 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | 76 | 77 | false 78 | 79 | 80 | true 81 | 82 | 83 | false 84 | 85 | 86 | 87 | Level3 88 | true 89 | WIN32;_DEBUG;CLIENTBASE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 90 | true 91 | NotUsing 92 | pch.h 93 | 94 | 95 | Windows 96 | true 97 | false 98 | 99 | 100 | 101 | 102 | Level3 103 | true 104 | true 105 | true 106 | WIN32;NDEBUG;CLIENTBASE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 107 | true 108 | Use 109 | pch.h 110 | 111 | 112 | Windows 113 | true 114 | true 115 | true 116 | false 117 | 118 | 119 | 120 | 121 | Level3 122 | true 123 | _DEBUG;CLIENTBASE_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 124 | true 125 | NotUsing 126 | pch.h 127 | stdcpp17 128 | 129 | 130 | Windows 131 | true 132 | false 133 | 134 | 135 | 136 | 137 | Level3 138 | true 139 | true 140 | true 141 | NDEBUG;CLIENTBASE_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 142 | true 143 | NotUsing 144 | pch.h 145 | stdcpp17 146 | 147 | 148 | Windows 149 | true 150 | true 151 | true 152 | false 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 208 | 209 | 210 | 211 | -------------------------------------------------------------------------------- /Client Base/Client Base.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | Source Files 59 | 60 | 61 | 62 | 63 | Header Files 64 | 65 | 66 | Header Files 67 | 68 | 69 | Header Files 70 | 71 | 72 | Header Files 73 | 74 | 75 | Header Files 76 | 77 | 78 | Header Files 79 | 80 | 81 | Header Files 82 | 83 | 84 | Header Files 85 | 86 | 87 | Header Files 88 | 89 | 90 | Header Files 91 | 92 | 93 | Header Files 94 | 95 | 96 | Header Files 97 | 98 | 99 | Header Files 100 | 101 | 102 | Header Files 103 | 104 | 105 | Header Files 106 | 107 | 108 | Header Files 109 | 110 | 111 | Header Files 112 | 113 | 114 | Header Files 115 | 116 | 117 | Header Files 118 | 119 | 120 | Header Files 121 | 122 | 123 | Header Files 124 | 125 | 126 | Header Files 127 | 128 | 129 | Header Files 130 | 131 | 132 | Header Files 133 | 134 | 135 | Header Files 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /Client Base/Client Base.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | true 5 | 6 | -------------------------------------------------------------------------------- /Client Base/Client.cpp: -------------------------------------------------------------------------------- 1 | #include "Other/Utils.h" 2 | #include "Client/ClientManager.h" 3 | 4 | void Init(LPVOID lpParam) { 5 | Utils::hModule = (HMODULE)lpParam; 6 | Utils::DeletePath("Client/Output.txt"); 7 | Utils::DebugLogOutput("Injected..."); 8 | 9 | ClientManager::InitHooks(); 10 | ClientManager::InitModules(); 11 | } 12 | 13 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { 14 | switch (ul_reason_for_call) 15 | { 16 | case DLL_PROCESS_ATTACH: 17 | CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Init, hModule, 0, 0); 18 | case DLL_THREAD_ATTACH: 19 | case DLL_THREAD_DETACH: 20 | case DLL_PROCESS_DETACH: 21 | break; 22 | } 23 | return TRUE; 24 | } -------------------------------------------------------------------------------- /Client Base/Client/ClientManager.cpp: -------------------------------------------------------------------------------- 1 | #include "ClientManager.h" 2 | #include "../Other/Module.h" 3 | 4 | std::vector ClientManager::Hooks; 5 | std::vector ClientManager::Modules; 6 | std::vector ClientManager::Categories; 7 | 8 | #include "Hooks/ClientInstance.h" 9 | #include "Hooks/RenderContext.h" 10 | #include "Hooks/GameMode.h" 11 | #include "Hooks/KeyItem.h" 12 | 13 | ClientInstance* Minecraft::CachedInstance = nullptr; //Resolve error on compile 14 | GameMode* Minecraft::CachedGameMode = nullptr; //Resolve error on compile 15 | std::vector Minecraft::Friends = { "EchoHackCmd", "bricker1462" }; 16 | 17 | void ClientManager::InitHooks() { 18 | 19 | if (MH_Initialize() == MH_OK) { 20 | Hooks.push_back(new ClientInstance_Hook()); 21 | Hooks.push_back(new RenderContext()); 22 | Hooks.push_back(new GameMode_Hook()); 23 | Hooks.push_back(new KeyItem()); 24 | } 25 | 26 | Utils::DebugLogOutput("Initializing Hooks..."); 27 | 28 | for (int I = 0; I < Hooks.size(); I++) { //Initialize the hooks 29 | Hooks.at(I)->Install(); 30 | } 31 | } 32 | 33 | /* Combat */ 34 | #include "Modules/Killaura.h" 35 | #include "Modules/Hitbox.h" 36 | /* Movement */ 37 | #include "Modules/AirJump.h" 38 | #include "Modules/Jetpack.h" 39 | #include "Modules/AutoSprint.h" 40 | #include "Modules/Jesus.h" 41 | /* Player */ 42 | // 43 | /* Visuals */ 44 | #include "Modules/TabGUI.h" 45 | /* World */ 46 | #include "Modules/Instabreak.h" 47 | /* Other */ 48 | #include "Modules/TestModule.h" 49 | #include "Modules/Uninject.h" 50 | 51 | void ClientManager::InitModules() { 52 | /* Combat */ 53 | Modules.push_back(new Killaura()); 54 | Modules.push_back(new Hitbox()); 55 | /* Movement */ 56 | Modules.push_back(new AirJump()); 57 | Modules.push_back(new Jetpack()); 58 | Modules.push_back(new AutoSprint()); 59 | Modules.push_back(new Jesus()); 60 | /* Visuals */ 61 | Modules.push_back(new TabGUI()); 62 | /* World */ 63 | Modules.push_back(new Instabreak()); 64 | /* Other */ 65 | Modules.push_back(new TestModule()); 66 | Modules.push_back(new Uninject()); 67 | 68 | for (int I = 0; I < Modules.size(); I++) { //Initialize Categories 69 | bool exists = false; 70 | for (auto currCategory : Categories) { 71 | if (currCategory == Modules.at(I)->category) exists = true; 72 | } 73 | if (!exists) { 74 | Categories.push_back(Modules.at(I)->category); 75 | } 76 | } 77 | 78 | for (;;) { 79 | for (int I = 0; I < Modules.size(); I++) { //Loop Modules 80 | Modules.at(I)->onBaseTick(); 81 | } 82 | } 83 | } 84 | 85 | std::vector ClientManager::GetModulesFromCategory(std::string Category) { 86 | bool exists = false; 87 | for (auto Curr : Categories) { 88 | if (Curr == Category) exists = true; 89 | } 90 | if (exists) { 91 | std::vector ModulesArr; 92 | for (auto Module : Modules) { 93 | if (Module->category == Category) ModulesArr.push_back(Module); 94 | } 95 | return ModulesArr; 96 | } 97 | else { 98 | return std::vector(); 99 | } 100 | } -------------------------------------------------------------------------------- /Client Base/Client/ClientManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Other/Utils.h" 3 | 4 | class ClientManager { 5 | public: 6 | static void InitHooks(); 7 | static void InitModules(); 8 | static std::vector Hooks; 9 | static std::vector Modules; 10 | static std::vector Categories; 11 | 12 | static std::vector GetModulesFromCategory(std::string Category); 13 | }; -------------------------------------------------------------------------------- /Client Base/Client/Hooks/ClientInstance.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../Other/Module.h" 3 | 4 | class ClientInstance_Hook : public Hook { 5 | public: 6 | void Install(); 7 | }; 8 | 9 | typedef void(__fastcall* C_Hook)(ClientInstance* a1, void* a2); 10 | C_Hook _C_Hook; 11 | 12 | void Callback(ClientInstance* a1, void* a2) { 13 | Minecraft::SetClientInstance(a1); 14 | _C_Hook(a1, a2); 15 | } 16 | 17 | void ClientInstance_Hook::Install() { 18 | uintptr_t sigAddr = Utils::FindSig("48 89 5C 24 ?? 48 89 74 24 ?? 57 48 83 EC ?? 48 8B F9 48 8B 01"); 19 | if (sigAddr) { 20 | Utils::DebugLogOutput("Found address needed for the ClientInstance Hook, Preparing Hook install now..."); 21 | if (MH_CreateHook((void*)sigAddr, &Callback, reinterpret_cast(&_C_Hook)) == MH_OK) { 22 | Utils::DebugLogOutput("Successfully created ClientInstance Hook, Installing Hook now..."); 23 | MH_EnableHook((void*)sigAddr); 24 | } 25 | else { 26 | Utils::DebugLogOutput("Failed to create ClientInstance Hook!"); 27 | } 28 | } 29 | else { 30 | Utils::DebugLogOutput("Failed to find address needed for the ClientInstance Hook!"); 31 | } 32 | } -------------------------------------------------------------------------------- /Client Base/Client/Hooks/GameMode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../Other/Module.h" 3 | 4 | class GameMode_Hook : public Hook { 5 | public: 6 | void Install(); 7 | }; 8 | 9 | typedef void(__fastcall* GmTick)(GameMode* GM); 10 | GmTick _GmTick; 11 | GmTick _SmTick; 12 | 13 | void GmTickCallback(GameMode* GM) { 14 | LocalPlayer* myPlayer = Minecraft::ClientInstance()->LocalPlayer(); 15 | if (GM != nullptr && GM->Player != nullptr && myPlayer != nullptr) { 16 | if (myPlayer == GM->Player) { 17 | Minecraft::SetGamemode(GM); 18 | for (auto Module : ClientManager::Modules) { 19 | if (Module->isEnabled) Module->onGmTick(); 20 | } 21 | } 22 | } 23 | _GmTick(GM); 24 | } 25 | 26 | void SmTickCallback(GameMode* GM) { 27 | LocalPlayer* myPlayer = Minecraft::ClientInstance()->LocalPlayer(); 28 | if (GM != nullptr && GM->Player != nullptr && myPlayer != nullptr) { 29 | if (myPlayer == GM->Player) { 30 | Minecraft::SetGamemode(GM); 31 | for (auto Module : ClientManager::Modules) { 32 | if (Module->isEnabled) Module->onGmTick(); 33 | } 34 | } 35 | } 36 | _SmTick(GM); 37 | } 38 | 39 | typedef void(__fastcall* StartDestroyBlock)(GameMode*, Vec3_i*, uint8_t, void*, void*); 40 | StartDestroyBlock _StartDestroyBlock; 41 | 42 | void DestroyBlockCallback(GameMode* GM, Vec3_i* blockPos, uint8_t blockFace, void* a4, void* a5) { 43 | for (auto Module : ClientManager::Modules) { 44 | if (Module->isEnabled) Module->onStartDestroyBlock(GM, blockPos, blockFace); 45 | } 46 | _StartDestroyBlock(GM, blockPos, blockFace, a4, a5); 47 | } 48 | 49 | void GameMode_Hook::Install() { 50 | /* GameMode */ 51 | { 52 | uintptr_t sigAddr = Utils::FindSig("8B 41 20 89 41 1C C3"); 53 | if (sigAddr) { 54 | Utils::DebugLogOutput("Found address needed for the GameMode::tick Hook, Preparing Hook Install..."); 55 | if (MH_CreateHook((void*)sigAddr, &GmTickCallback, reinterpret_cast(&_GmTick)) == MH_OK) { 56 | Utils::DebugLogOutput("Successfully created GameMode::tick Hook, Enabling Hook..."); 57 | MH_EnableHook((void*)sigAddr); 58 | } 59 | else { 60 | Utils::DebugLogOutput("Failed to create GameMode::tick Hook!"); 61 | } 62 | } 63 | else { 64 | Utils::DebugLogOutput("Failed to find address needed for the GameMode::tick Hook!"); 65 | } 66 | uintptr_t startDestroyBlockAddr = Utils::FindSig("40 55 53 56 57 41 56 41 57 48 8D 6C 24 D1 48 81 EC C8 00 00 00 0F"); 67 | if (startDestroyBlockAddr) { 68 | Utils::DebugLogOutput("Successfully found address needed for the GameMode::onStartDestroyBlock Hook, Preparing Hook Install..."); 69 | if (MH_CreateHook((void*)startDestroyBlockAddr, &DestroyBlockCallback, reinterpret_cast(&_StartDestroyBlock)) == MH_OK) { 70 | Utils::DebugLogOutput("Successfully created GameMode::onStartDestroyBlock Hook, Enabling Hook..."); 71 | MH_EnableHook((void*)startDestroyBlockAddr); 72 | } 73 | else { 74 | Utils::DebugLogOutput("Failed to create GameMode::onStartDestroyBlock Hook!"); 75 | } 76 | } 77 | else { 78 | Utils::DebugLogOutput("Failed to find address needed for GameMode::onStartDestroyBlock Hook!"); 79 | } 80 | } 81 | /* SurvivalMode */ 82 | { 83 | uintptr_t sigAddr = Utils::FindSig("48 89 5C 24 ?? 48 89 74 24 ?? 55 57 41 56 48 8D 6C 24 B9 48 81 ?? ?? ?? ?? ?? 48 8B 05 0F F3 8A 01"); 84 | if (sigAddr) { 85 | Utils::DebugLogOutput("Successfully found address needed for SurvivalMode::tick Hook, Preparing Hook Install..."); 86 | if (MH_CreateHook((void*)sigAddr, &SmTickCallback, reinterpret_cast(&_SmTick)) == MH_OK) { 87 | Utils::DebugLogOutput("Successfully created SurvivalMode::tick Hook, Enabling Hook..."); 88 | MH_EnableHook((void*)sigAddr); 89 | } 90 | else { 91 | Utils::DebugLogOutput("Failed to create SurvivalMode::tick Hook!"); 92 | } 93 | } 94 | else { 95 | Utils::DebugLogOutput("Failed to find address needed for SurvivalMode::tick Hook!"); 96 | } 97 | } 98 | } -------------------------------------------------------------------------------- /Client Base/Client/Hooks/KeyItem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../Other/Module.h" 3 | 4 | class KeyItem : public Hook { 5 | public: 6 | void Install(); 7 | }; 8 | 9 | typedef void(WINAPI* AVKeyItem)(uint64_t key, bool isDown); 10 | AVKeyItem _AVKeyItem; 11 | 12 | void KeyItemCallback(uint64_t key, bool isDown) { 13 | Utils::KeyMapping[key] = isDown; 14 | bool cancel = false; 15 | for (auto Module : ClientManager::Modules) { 16 | if (Module->isEnabled) Module->onKey(key, isDown, &cancel); 17 | } 18 | if(!cancel) _AVKeyItem(key, isDown); 19 | } 20 | 21 | void KeyItem::Install() { 22 | uintptr_t sigAddr = Utils::FindSig("48 89 5C 24 ?? ?? 48 83 EC ?? 8B 05 ?? ?? ?? ?? 8B DA"); 23 | if (sigAddr) { 24 | Utils::DebugLogOutput("Found address needed for the KeyItem Hook, Preparing Hook install now..."); 25 | if (MH_CreateHook((void*)sigAddr, &KeyItemCallback, reinterpret_cast(&_AVKeyItem)) == MH_OK) { 26 | Utils::DebugLogOutput("Successfully created KeyItem Hook, Installing Hook now..."); 27 | MH_EnableHook((void*)sigAddr); 28 | } 29 | else { 30 | Utils::DebugLogOutput("Failed to create KeyItem Hook!"); 31 | } 32 | } 33 | else { 34 | Utils::DebugLogOutput("Failed to find address needed for the KeyItem Hook!"); 35 | } 36 | } -------------------------------------------------------------------------------- /Client Base/Client/Hooks/RenderContext.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../Other/Module.h" 3 | 4 | class RenderContext : public Hook { 5 | public: 6 | void Install(); 7 | }; 8 | 9 | typedef void(__stdcall* RenderUIContext)(__int64 a1, MinecraftUIRenderContext* Ctx); 10 | RenderUIContext _RenderContext; 11 | 12 | void RenderCallback(__int64 a1, MinecraftUIRenderContext* Ctx) { 13 | 14 | ClientInstance* Curr = Minecraft::ClientInstance(); 15 | MinecraftGame* mcGame = Curr->MinecraftGame(); 16 | if (Curr != nullptr && mcGame != nullptr && mcGame->MCFont() != nullptr) { 17 | RenderUtils::SetContext(Ctx, mcGame->MCFont()); 18 | for (auto Module : ClientManager::Modules) { 19 | if (Module->isEnabled) Module->onRender(); 20 | } 21 | } 22 | _RenderContext(a1, Ctx); 23 | } 24 | 25 | void RenderContext::Install() { 26 | uintptr_t sigAddr = Utils::FindSig("48 8B C4 48 89 58 ?? 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 0F 29 70 ?? 0F 29 78 ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 4C 8B F2 48 89 54 24"); 27 | if (sigAddr) { 28 | Utils::DebugLogOutput("Successfully found address needed for the RenderContext Hook, Preparing Hook install now..."); 29 | if (MH_CreateHook((void*)sigAddr, &RenderCallback, reinterpret_cast(&_RenderContext)) == MH_OK) { 30 | Utils::DebugLogOutput("Successfully created RenderContext Hook, Installing hook now..."); 31 | MH_EnableHook((void*)sigAddr); 32 | } 33 | else { 34 | Utils::DebugLogOutput("Failed to create RenderContext Hook!"); 35 | } 36 | } 37 | else { 38 | Utils::DebugLogOutput("Failed to find address needed for the RenderContext Hook!"); 39 | } 40 | } -------------------------------------------------------------------------------- /Client Base/Client/Modules/AirJump.cpp: -------------------------------------------------------------------------------- 1 | #include "AirJump.h" 2 | 3 | void AirJump::onGmTick() { 4 | if (Minecraft::ClientInstance()->LocalPlayer() != nullptr) { 5 | Minecraft::ClientInstance()->LocalPlayer()->onGround = true; 6 | } 7 | } -------------------------------------------------------------------------------- /Client Base/Client/Modules/AirJump.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../Other/Module.h" 3 | 4 | class AirJump : public Module { 5 | public: 6 | AirJump() : Module::Module("AirJump", "Movement", "Jump in the air") {}; 7 | void onGmTick(); 8 | }; -------------------------------------------------------------------------------- /Client Base/Client/Modules/AutoSprint.cpp: -------------------------------------------------------------------------------- 1 | #include "AutoSprint.h" 2 | 3 | void AutoSprint::onGmTick() { 4 | LocalPlayer* Player = Minecraft::ClientInstance()->LocalPlayer(); 5 | if (Player != nullptr) { 6 | if (Player->velocity.magnitudexz() > 0.05f) { 7 | Player->setSprinting(true); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Client Base/Client/Modules/AutoSprint.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../Other/Module.h" 3 | 4 | class AutoSprint : public Module { 5 | public: 6 | AutoSprint() : Module::Module("AutoSprint", "Movement", "Automatically sprint forward") {}; 7 | void onGmTick(); 8 | }; -------------------------------------------------------------------------------- /Client Base/Client/Modules/Hitbox.cpp: -------------------------------------------------------------------------------- 1 | #include "Hitbox.h" 2 | 3 | void Hitbox::onGmTick() { 4 | LocalPlayer* Player = Minecraft::ClientInstance()->LocalPlayer(); 5 | if (Player != nullptr) { 6 | MultiPlayerLevel* curr = Player->MultiPlayerLevel; 7 | size_t size = curr->getListSize(); 8 | if (size > 0 && size <= 5000) { 9 | for (size_t I = 0; I < size; I++) { 10 | Actor* currPlayer = curr->get(I); 11 | if (currPlayer != nullptr && currPlayer != Player) { 12 | currPlayer->setSize(4.f, 4.f); 13 | } 14 | } 15 | } 16 | } 17 | } 18 | 19 | void Hitbox::onDisable() { 20 | LocalPlayer* Player = Minecraft::ClientInstance()->LocalPlayer(); 21 | if (Player != nullptr) { 22 | MultiPlayerLevel* curr = Player->MultiPlayerLevel; 23 | size_t size = curr->getListSize(); 24 | if (size > 0 && size <= 5000) { 25 | for (size_t I = 0; I < size; I++) { 26 | Actor* currPlayer = curr->get(I); 27 | if (currPlayer != nullptr && currPlayer != Player) { 28 | currPlayer->setSize(0.6f, 1.8f); 29 | } 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Client Base/Client/Modules/Hitbox.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../Other/Module.h" 3 | 4 | class Hitbox : public Module { 5 | public: 6 | Hitbox() : Module::Module("Hitbox", "Combat", "Enlarge Enemy Hitboxes") {} 7 | void onGmTick(); 8 | void onDisable(); 9 | }; -------------------------------------------------------------------------------- /Client Base/Client/Modules/Instabreak.cpp: -------------------------------------------------------------------------------- 1 | #include "Instabreak.h" 2 | 3 | void Instabreak::onStartDestroyBlock(GameMode* GM, Vec3_i* blockPos, uint8_t blockFace) { 4 | GM->destroyBlock(blockPos, blockFace); 5 | } -------------------------------------------------------------------------------- /Client Base/Client/Modules/Instabreak.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../Other/Module.h" 3 | 4 | class Instabreak : public Module { 5 | public: 6 | Instabreak() : Module::Module("Instabreak", "World", "Instantly destroy blocks") {}; 7 | void onStartDestroyBlock(GameMode* GM, Vec3_i* blockPos, uint8_t blockFace); 8 | }; -------------------------------------------------------------------------------- /Client Base/Client/Modules/Jesus.cpp: -------------------------------------------------------------------------------- 1 | #include "Jesus.h" 2 | 3 | void Jesus::onGmTick() { 4 | LocalPlayer* Player = Minecraft::ClientInstance()->LocalPlayer(); 5 | if (Player != nullptr && Player->isInWater() || Player->isInLava()) { 6 | Player->velocity.y = 0.25f; 7 | } 8 | } -------------------------------------------------------------------------------- /Client Base/Client/Modules/Jesus.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../Other/Module.h" 3 | 4 | class Jesus : public Module { 5 | public: 6 | Jesus() : Module::Module("Jesus", "Movement", "Automatically float above water") {}; 7 | void onGmTick(); 8 | }; -------------------------------------------------------------------------------- /Client Base/Client/Modules/Jetpack.cpp: -------------------------------------------------------------------------------- 1 | #include "Jetpack.h" 2 | 3 | void Jetpack::onLoop() { 4 | LocalPlayer* Player = Minecraft::ClientInstance()->LocalPlayer(); 5 | MinecraftGame* mcGame = Minecraft::ClientInstance()->MinecraftGame(); 6 | if (Utils::usingKey(this->key)) { 7 | if (Player != nullptr && mcGame != nullptr && mcGame->canUseKeys()) { 8 | this->isEnabled = true; 9 | } 10 | else { 11 | if (this->isEnabled) this->isEnabled = false; 12 | } 13 | } 14 | else { 15 | if(this->isEnabled) this->isEnabled = false; 16 | } 17 | } 18 | 19 | void Jetpack::onTick() { 20 | LocalPlayer* Player = Minecraft::ClientInstance()->LocalPlayer(); 21 | if (Player != nullptr) { 22 | Vec2 currRot = Player->bodyRot; 23 | Vec2 angles = Vec2((currRot.x) * -(PI / 180.f), (currRot.y + 90.0f) * (PI / 180.f)); 24 | Player->velocity = Vec3(cos(angles.y) * cos(angles.x) * speed, sin(angles.x) * speed, sin(angles.y) * cos(angles.x) * speed); 25 | } 26 | } -------------------------------------------------------------------------------- /Client Base/Client/Modules/Jetpack.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../Other/Module.h" 3 | 4 | class Jetpack : public Module { 5 | public: 6 | Jetpack() : Module::Module("Jetpack", "Movement", "Boost directory forwards when holding the desired key (Default: F)", 0x46) {}; 7 | void onLoop(); 8 | void onTick(); 9 | private: 10 | float speed = 1.0f; 11 | bool modified = false; 12 | }; -------------------------------------------------------------------------------- /Client Base/Client/Modules/Killaura.cpp: -------------------------------------------------------------------------------- 1 | #include "Killaura.h" 2 | 3 | void Killaura::onGmTick() { 4 | LocalPlayer* Player = Minecraft::ClientInstance()->LocalPlayer(); 5 | MultiPlayerLevel* Level = Player->MultiPlayerLevel; 6 | GameMode* GM = Minecraft::GameMode(); 7 | if (Player != nullptr && GM != nullptr && Level != nullptr) { 8 | Vec3 myPos = *Player->getPos(); 9 | size_t entListSize = Level->getListSize(); 10 | if (entListSize > 0 && entListSize <= 5000) { 11 | for (size_t I = 0; I < entListSize; I++) { 12 | Actor* currEnt = Level->get(I); 13 | float distance = currEnt->getPos()->distance(myPos); 14 | if (currEnt != nullptr && currEnt != Player && distance <= 12.f){ 15 | bool isFriend = false; 16 | for (auto Friend : Minecraft::Friends) { 17 | if (currEnt->getFormattedNameTag() == Friend) isFriend = true; 18 | } 19 | if (!isFriend) { 20 | GM->attack(currEnt); 21 | Player->swing(); 22 | } 23 | } 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Client Base/Client/Modules/Killaura.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../Other/Module.h" 3 | 4 | class Killaura : public Module { 5 | public: 6 | Killaura() : Module::Module("Killaura", "Combat", "Automatically attack nearby entities") {}; 7 | void onGmTick(); 8 | }; -------------------------------------------------------------------------------- /Client Base/Client/Modules/TabGUI.cpp: -------------------------------------------------------------------------------- 1 | #include "TabGUI.h" 2 | #include "../ClientManager.h" 3 | 4 | std::vector SortArrayOfStrings(std::vector stringVecArr) { 5 | std::vector stringArr; 6 | 7 | for (int I = 0; I < stringVecArr.size(); I++) { 8 | stringArr.push_back(stringVecArr.at(I)); 9 | }; 10 | 11 | for (int I = 0; I < stringArr.size(); I++) { 12 | std::string temp = stringArr[I]; 13 | 14 | int J = I - 1; 15 | while (J >= 0 && temp.length() < stringArr[J].length()) { 16 | stringArr[J + 1] = stringArr[J]; 17 | J--; 18 | } 19 | stringArr[J + 1] = temp; 20 | }; 21 | return stringArr; 22 | }; 23 | 24 | void TabGUI::onRender() { 25 | RenderUtils::RenderText("Client", Vec2(12, 0), MC_Colour(50, 200, 150), 1.0f, 1.0f); 26 | if (Minecraft::ClientInstance() != nullptr && Minecraft::ClientInstance()->MinecraftGame()->canUseKeys()) { 27 | auto Categories = ClientManager::Categories; 28 | auto Modules = ClientManager::GetModulesFromCategory(Categories.at(currentCategory)); 29 | float boxWidth = RenderUtils::GetTextWidth(SortArrayOfStrings(Categories).back(), 1.0f); 30 | Vec4 boxPos = Vec4(10, 0, boxWidth + 30, Categories.size() * 10 + 10); 31 | MC_Colour whiteText = MC_Colour(255, 255, 255), selectedColourText = MC_Colour(50, 175, 200); 32 | for (int C = 0; C < Categories.size(); C++) { 33 | RenderUtils::RenderText(">>", Vec2(boxPos.z - 10, currentCategory * 10 + 10), selectedColourText, 1.0f, selectedCategory ? 1.0f : 0.f); 34 | RenderUtils::RenderText(Categories.at(C), Vec2(boxPos.x + 2, C * 10 + 10), selectedCategory && currentCategory == C ? selectedColourText : whiteText, 1.0f, 1.0f); 35 | } 36 | if (selectedModule) { 37 | std::vector< std::string> ModulesText; 38 | for (auto Mod : Modules) { 39 | ModulesText.push_back(Mod->name); 40 | } 41 | float modulesWidth = RenderUtils::GetTextWidth(SortArrayOfStrings(ModulesText).back(), 1.0f); 42 | Vec4 modulesPos = Vec4(boxWidth + 30, 0, boxWidth + modulesWidth + 50, Modules.size() * 10 + 10); 43 | RenderUtils::RenderText(Categories.at(currentCategory), Vec2(modulesPos.x + 2, 0), MC_Colour(50, 200, 150), 1.0f, 1.0f); 44 | for (int M = 0; M < Modules.size(); M++) { 45 | RenderUtils::RenderText(">>", Vec2(modulesPos.z - 10, currentModule * 10 + 10), selectedColourText, 1.0f, selectedModule ? 1.0f : 0.f); 46 | RenderUtils::RenderText(Modules.at(M)->name, Vec2(modulesPos.x + 2, M * 10 + 10), selectedModule && Modules.at(M)->isEnabled ? selectedColourText : whiteText, 1.0f, 1.0f); 47 | } 48 | RenderUtils::FillRectangle(modulesPos, MC_Colour(90, 90, 90), .3f); 49 | RenderUtils::DrawRectangle(modulesPos, MC_Colour(255, 255, 255), .3f, .8f); 50 | } 51 | RenderUtils::FillRectangle(boxPos, MC_Colour(90, 90, 90), .3f); 52 | RenderUtils::DrawRectangle(boxPos, MC_Colour(255, 255, 255), .3f, .8f); 53 | RenderUtils::FlushText(); 54 | } 55 | } 56 | 57 | void TabGUI::onKey(uint64_t key, bool isDown, bool* cancel) { 58 | auto Categories = ClientManager::Categories; 59 | auto Modules = ClientManager::GetModulesFromCategory(Categories.at(currentCategory)); 60 | if (isDown && Minecraft::ClientInstance() != nullptr && Minecraft::ClientInstance()->MinecraftGame()->canUseKeys()) { 61 | if (key == 0x25) { //Left 62 | if (selectedModule) { 63 | currentModule = 0; 64 | selectedModule = false; 65 | } 66 | else { 67 | if (selectedCategory) { 68 | selectedCategory = false; 69 | } 70 | } 71 | *cancel = true; 72 | } 73 | if (key == 0x27) { //Right 74 | if (!selectedCategory) { 75 | selectedCategory = true; 76 | } 77 | else { 78 | if (!selectedModule) { 79 | selectedModule = true; 80 | } 81 | else { 82 | Module* currModule = Modules.at(currentModule); 83 | if (currModule != nullptr) currModule->isEnabled = !currModule->isEnabled; 84 | } 85 | } 86 | *cancel = true; 87 | } 88 | if (key == 0x26) { //Up 89 | if (selectedCategory && !selectedModule) { 90 | if (!currentCategory) currentCategory = Categories.size(); 91 | currentCategory--; 92 | } 93 | else { 94 | if (selectedModule) { 95 | if (!currentModule) currentModule = Modules.size(); 96 | currentModule--; 97 | } 98 | } 99 | *cancel = true; 100 | } 101 | if (key == 0x28) { //Down 102 | if (selectedCategory && !selectedModule) { 103 | currentCategory++; 104 | if (currentCategory >= Categories.size()) currentCategory = 0; 105 | } 106 | else { 107 | if (selectedModule) { 108 | currentModule++; 109 | if (currentModule >= Modules.size()) currentModule = 0; 110 | } 111 | } 112 | *cancel = true; 113 | } 114 | } 115 | } -------------------------------------------------------------------------------- /Client Base/Client/Modules/TabGUI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../Other/Module.h" 3 | 4 | class TabGUI : public Module { 5 | public: 6 | TabGUI() : Module::Module("TabGUI", "Visuals", "Manage Modules via Arrow Keys", VK_TAB) { 7 | this->isEnabled = true; 8 | }; 9 | void onRender(); 10 | void onKey(uint64_t key, bool isDown, bool* cancel); 11 | private: 12 | int currentCategory = 0, currentModule = 0; 13 | bool selectedCategory = false, selectedModule = 0; 14 | }; -------------------------------------------------------------------------------- /Client Base/Client/Modules/TestModule.cpp: -------------------------------------------------------------------------------- 1 | #include "TestModule.h" 2 | 3 | void TestModule::onGmTick() { 4 | LocalPlayer* Player = Minecraft::ClientInstance()->LocalPlayer(); 5 | if (Player != nullptr) { 6 | MultiPlayerLevel* curr = Player->MultiPlayerLevel; 7 | size_t size = curr->getListSize(); 8 | if (size > 0 && size <= 5000) { 9 | for (size_t I = 0; I < size; I++) { 10 | Actor* currPlayer = curr->get(I); 11 | if (currPlayer != nullptr && currPlayer != Player) { 12 | currPlayer->setNameTagVisible(true); 13 | } 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Client Base/Client/Modules/TestModule.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../Other/Module.h" 3 | 4 | class TestModule : public Module { 5 | public: 6 | TestModule() : Module::Module("Test Module", "Other", "Testing") {}; 7 | void onGmTick(); 8 | }; -------------------------------------------------------------------------------- /Client Base/Client/Modules/Uninject.cpp: -------------------------------------------------------------------------------- 1 | #include "Uninject.h" 2 | 3 | void Uninject::onEnable() { 4 | MH_DisableHook(MH_ALL_HOOKS); 5 | Sleep(100); 6 | MH_Uninitialize(); 7 | FreeLibraryAndExitThread(Utils::hModule, 1); 8 | } -------------------------------------------------------------------------------- /Client Base/Client/Modules/Uninject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../Other/Module.h" 3 | 4 | class Uninject : public Module { 5 | public: 6 | Uninject() : Module::Module("Uninject", "Other", "Uninject the Client from the Game") {}; 7 | void onEnable(); 8 | }; -------------------------------------------------------------------------------- /Client Base/Other/Module.cpp: -------------------------------------------------------------------------------- 1 | #include "Module.h" 2 | 3 | Module::Module(std::string name, std::string category, std::string description, uint64_t key) { 4 | this->name = name; 5 | this->category = category; 6 | this->description = description; 7 | this->key = key; 8 | } 9 | 10 | void Module::onBaseTick() { 11 | onLoop(); 12 | if (wasEnabled != isEnabled) { 13 | if (isEnabled) { 14 | onEnable(); 15 | } 16 | else { 17 | onDisable(); 18 | } 19 | wasEnabled = isEnabled; 20 | } 21 | if (isEnabled) onTick(); 22 | } -------------------------------------------------------------------------------- /Client Base/Other/Module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../SDK/Minecraft.h" 3 | 4 | class Module { 5 | public: 6 | std::string name, category, description; 7 | uint64_t key; 8 | bool isEnabled = false, wasEnabled = false; 9 | Module(std::string name, std::string category, std::string description, uint64_t key = NULL); 10 | 11 | void onBaseTick(); 12 | virtual void onLoop() {}; 13 | virtual void onTick() {}; 14 | virtual void onEnable() {}; 15 | virtual void onDisable() {}; 16 | 17 | virtual void onRender() {}; 18 | virtual void onGmTick() {}; 19 | virtual void onKey(uint64_t key, bool isDown, bool* cancel) {}; 20 | 21 | virtual void onStartDestroyBlock(GameMode* GM, Vec3_i* blockPos, uint8_t blockFace) {}; 22 | }; 23 | 24 | class Hook { 25 | public: 26 | virtual void Install() {}; 27 | }; -------------------------------------------------------------------------------- /Client Base/Other/Utils.cpp: -------------------------------------------------------------------------------- 1 | #include "Utils.h" 2 | 3 | HMODULE Utils::hModule = nullptr; 4 | 5 | bool Utils::hasExtension(std::string fileName) { 6 | std::string::size_type idx; 7 | idx = fileName.rfind('.'); 8 | 9 | return idx != std::string::npos; 10 | } 11 | 12 | bool Utils::doesPathExist(std::string path) { 13 | struct stat buffer; 14 | return (stat(path.c_str(), &buffer) == 0); 15 | } 16 | 17 | void Utils::CreateDir(std::string path) { 18 | if (!hasExtension(path)) { 19 | std::string envPath = getenv("APPDATA"); 20 | if (envPath.length() <= 0) 21 | return; 22 | 23 | std::string roamingDir = envPath + std::string("\\..\\Local\\Packages\\Microsoft.MinecraftUWP_8wekyb3d8bbwe\\RoamingState\\"); 24 | if (!doesPathExist(roamingDir)) 25 | return; 26 | 27 | std::string precisePath = std::string(roamingDir + path); 28 | std::filesystem::create_directories(precisePath); 29 | } 30 | } 31 | 32 | void Utils::DeletePath(std::string path) { 33 | std::string precisePath = getenv("APPDATA") + std::string("\\..\\Local\\Packages\\Microsoft.MinecraftUWP_8wekyb3d8bbwe\\RoamingState\\" + path); 34 | if (doesPathExist(precisePath)) { 35 | if (std::filesystem::is_directory(precisePath)) { 36 | std::filesystem::remove_all(precisePath); 37 | } 38 | else { 39 | std::filesystem::remove(precisePath); 40 | } 41 | } 42 | } 43 | 44 | void Utils::WriteToFile(std::string str, std::string path) { 45 | if (hasExtension(path)) { 46 | std::string precisePath = getenv("APPDATA") + std::string("\\..\\Local\\Packages\\Microsoft.MinecraftUWP_8wekyb3d8bbwe\\RoamingState\\" + path); 47 | if (!doesPathExist(precisePath)) { 48 | std::filesystem::path p(precisePath); 49 | std::filesystem::create_directories(p.parent_path().string()); 50 | } 51 | 52 | CloseHandle(CreateFileA(precisePath.c_str(), GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)); 53 | if (doesPathExist(precisePath) && str.length() > 0) { 54 | std::ofstream fileOutput; 55 | fileOutput.open(precisePath.c_str(), std::ios_base::app); 56 | fileOutput << str << std::endl; 57 | fileOutput.close(); 58 | } 59 | } 60 | } 61 | 62 | void Utils::DebugLogOutput(std::string str) { 63 | WriteToFile(str, "Client/Output.txt"); 64 | return; 65 | } 66 | 67 | uintptr_t Utils::FindAddr(uintptr_t ptrBase, std::vector offsets) { 68 | uintptr_t curr = NULL; 69 | if (ptrBase != NULL) { 70 | curr = ptrBase; 71 | for (unsigned int I = 0; I < offsets.size(); I++) { 72 | curr = *(uintptr_t*)(curr += offsets[I]); 73 | if (curr == NULL) { 74 | break; 75 | } 76 | } 77 | } 78 | return curr; 79 | } 80 | 81 | uintptr_t Utils::FindSig(const char* szSignature) { 82 | const char* pattern = szSignature; 83 | uintptr_t firstMatch = 0; 84 | static const uintptr_t rangeStart = (uintptr_t)GetModuleHandleA("Minecraft.Windows.exe"); 85 | static MODULEINFO miModInfo; 86 | static bool init = false; 87 | if (!init) { 88 | init = true; 89 | GetModuleInformation(GetCurrentProcess(), (HMODULE)rangeStart, &miModInfo, sizeof(MODULEINFO)); 90 | } 91 | static const uintptr_t rangeEnd = rangeStart + miModInfo.SizeOfImage; 92 | 93 | BYTE patByte = GET_BYTE(pattern); 94 | const char* oldPat = pattern; 95 | 96 | for (uintptr_t pCur = rangeStart; pCur < rangeEnd; pCur++) 97 | { 98 | if (!*pattern) 99 | return firstMatch; 100 | 101 | while (*(PBYTE)pattern == ' ') 102 | pattern++; 103 | 104 | if (!*pattern) 105 | return firstMatch; 106 | 107 | if (oldPat != pattern) { 108 | oldPat = pattern; 109 | if (*(PBYTE)pattern != '\?') 110 | patByte = GET_BYTE(pattern); 111 | } 112 | 113 | if (*(PBYTE)pattern == '\?' || *(BYTE*)pCur == patByte) 114 | { 115 | if (!firstMatch) 116 | firstMatch = pCur; 117 | 118 | if (!pattern[2]) 119 | return firstMatch; 120 | 121 | pattern += 2; 122 | } 123 | else 124 | { 125 | pattern = szSignature; 126 | firstMatch = 0; 127 | } 128 | } 129 | } 130 | 131 | std::string Utils::ptrToStr(uintptr_t ptr) { 132 | std::ostringstream ss; 133 | ss << std::hex << ((UINT64)ptr) << std::endl; 134 | return ss.str(); 135 | } 136 | 137 | std::map Utils::KeyMapping; 138 | 139 | bool Utils::usingKey(uint64_t key) { 140 | return KeyMapping[key]; 141 | } 142 | 143 | 144 | 145 | /* Render Utils */ 146 | 147 | #include "../SDK/Classes/ClientInstance.h" 148 | 149 | class MinecraftUIRenderContext* RenderUtils::CachedContext = nullptr; //Resolve Compile Error 150 | class BitmapFont* RenderUtils::CachedFont = nullptr; 151 | 152 | void RenderUtils::SetContext(class MinecraftUIRenderContext* Context, class BitmapFont* Font) { 153 | CachedContext = Context; 154 | CachedFont = Font; 155 | } 156 | 157 | void RenderUtils::FlushText() { 158 | if (CachedContext != nullptr) CachedContext->flushText(0); 159 | } 160 | 161 | float RenderUtils::GetTextWidth(std::string text, float textSize) { 162 | if (CachedContext != nullptr) { 163 | TextHolder myText(text); 164 | return CachedContext->getLineLength(CachedFont, &myText, textSize, false); 165 | } 166 | } 167 | 168 | void RenderUtils::RenderText(std::string text, Vec2 textPos, MC_Colour colour, float textSize, float alpha) { 169 | if (CachedContext != nullptr && CachedFont != nullptr) { 170 | static uintptr_t caretMeasureData = 0xFFFFFFFF; 171 | Vec4 pos(textPos.x, textPos.x + 100, textPos.y, textPos.y + 100); 172 | TextHolder myText(text); 173 | CachedContext->drawText(CachedFont, &pos, &myText, colour, alpha, 0, &textSize, &caretMeasureData); 174 | } 175 | } 176 | 177 | void RenderUtils::FillRectangle(Vec4 position, MC_Colour colour, float alpha) { 178 | if (CachedContext != nullptr) { 179 | CachedContext->fillRectangle(Vec4(position.x, position.z, position.y, position.w), colour, alpha); 180 | } 181 | } 182 | 183 | void RenderUtils::DrawRectangle(Vec4 position, MC_Colour colour, float alpha, float lineWidth) { 184 | if (CachedContext != nullptr) { 185 | lineWidth /= 2; 186 | FillRectangle(Vec4(position.x - lineWidth, position.y - lineWidth, position.z + lineWidth, position.y + lineWidth), colour, alpha); 187 | FillRectangle(Vec4(position.x - lineWidth, position.y, position.x + lineWidth, position.w), colour, alpha); 188 | FillRectangle(Vec4(position.z - lineWidth, position.y, position.z + lineWidth, position.w), colour, alpha); 189 | FillRectangle(Vec4(position.x - lineWidth, position.w - lineWidth, position.z + lineWidth, position.w + lineWidth), colour, alpha); 190 | } 191 | } -------------------------------------------------------------------------------- /Client Base/Other/Utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | 19 | #include 20 | 21 | #define INRANGE(x,a,b) (x >= a && x <= b) 22 | #define GET_BYTE( x ) (GET_BITS(x[0]) << 4 | GET_BITS(x[1])) 23 | #define GET_BITS( x ) (INRANGE((x&(~0x20)),'A','F') ? ((x&(~0x20)) - 'A' + 0xa) : (INRANGE(x,'0','9') ? x - '0' : 0)) 24 | 25 | #define PI 3.14159265359 26 | 27 | struct Vec2 { 28 | union { 29 | struct { 30 | float x, y; 31 | }; 32 | float arr[2]; 33 | }; 34 | 35 | Vec2() { x = y = 0; } 36 | Vec2(float x, float y) { 37 | this->x = x, this->y = y; 38 | } 39 | 40 | bool operator == (Vec2 v) { return v.x == x && v.y == y; }; 41 | bool operator != (Vec2 v) { return v.x != x || v.y != y; }; 42 | 43 | /* Add */ 44 | 45 | Vec2 add(float f) { 46 | return Vec2(x + f, y + f); 47 | } 48 | 49 | Vec2 add(float a, float b) { 50 | return Vec2(x + a, y + b); 51 | } 52 | 53 | Vec2 add(Vec2 o) { 54 | return Vec2(x + o.y, y + o.y); 55 | } 56 | 57 | /* Subtract */ 58 | 59 | Vec2 sub(float f) { 60 | return Vec2(x - f, y - f); 61 | } 62 | 63 | Vec2 sub(float a, float b) { 64 | return Vec2(x - a, x - b); 65 | } 66 | 67 | Vec2 sub(Vec2 o) { 68 | return Vec2(x - o.x, y - o.y); 69 | } 70 | 71 | /* Divide */ 72 | 73 | Vec2 div(float f) { 74 | return Vec2(x / f, y / f); 75 | } 76 | 77 | Vec2 div(float a, float b) { 78 | return Vec2(x / a, y / b); 79 | } 80 | 81 | Vec2 div(Vec2 o) { 82 | return Vec2(x / o.x, y / o.y); 83 | } 84 | 85 | /* Multiply */ 86 | 87 | Vec2 mult(float f) { 88 | return Vec2(x * f, y * f); 89 | } 90 | 91 | Vec2 mult(float a, float b) { 92 | return Vec2(x * a, y * b); 93 | } 94 | 95 | Vec2 mult(Vec2 o) { 96 | return Vec2(x * o.x, y * o.y); 97 | } 98 | 99 | /* Other */ 100 | 101 | int distance(Vec2 o) { 102 | int dX = x - o.y; 103 | int dY = y - o.y; 104 | return sqrt(dX * dX + dY * dY); 105 | } 106 | }; 107 | 108 | struct Vec3 { 109 | union { 110 | struct { 111 | float x, y, z; 112 | }; 113 | float arr[3]; 114 | }; 115 | 116 | Vec3() { x = y = z = 0; } 117 | Vec3(float x, float y, float z) { 118 | this->x = x, this->y = y, this->z = z; 119 | } 120 | 121 | bool operator == (Vec3 v) { return v.x == x && v.y == y && v.z == z; }; 122 | bool operator != (Vec3 v) { return v.x != x || v.y != y || v.z != z; }; 123 | 124 | /* Add */ 125 | 126 | Vec3 add(float f) { 127 | return Vec3(x + f, y + f, z + f); 128 | } 129 | 130 | Vec3 add(float a, float b, float c) { 131 | return Vec3(x + a, y + b, z + c); 132 | } 133 | 134 | Vec3 add(Vec3 o) { 135 | return Vec3(x + o.y, y + o.y, z + o.z); 136 | } 137 | 138 | /* Subtract */ 139 | 140 | Vec3 sub(float f) { 141 | return Vec3(x - f, y - f, z - f); 142 | } 143 | 144 | Vec3 sub(float a, float b, float c) { 145 | return Vec3(x - a, x - b, z - c); 146 | } 147 | 148 | Vec3 sub(Vec3 o) { 149 | return Vec3(x - o.x, y - o.y, z - o.z); 150 | } 151 | 152 | /* Divide */ 153 | 154 | Vec3 div(float f) { 155 | return Vec3(x / f, y / f, z / f); 156 | } 157 | 158 | Vec3 div(float a, float b, float c) { 159 | return Vec3(x / a, y / b, z / c); 160 | } 161 | 162 | Vec3 div(Vec3 o) { 163 | return Vec3(x / o.x, y / o.y, z / o.y); 164 | } 165 | 166 | /* Multiply */ 167 | 168 | Vec3 mult(float f) { 169 | return Vec3(x * f, y * f, z * f); 170 | } 171 | 172 | Vec3 mult(float a, float b, float c) { 173 | return Vec3(x * a, y * b, z * c); 174 | } 175 | 176 | Vec3 mult(Vec3 o) { 177 | return Vec3(x * o.x, y * o.y, z * o.z); 178 | } 179 | 180 | /* Other */ 181 | 182 | Vec3 floor() { 183 | return Vec3(floorf(x), floorf(y), floorf(z)); 184 | } 185 | 186 | float magnitude() { 187 | return sqrtf(x * x + y * y + z * z); 188 | } 189 | 190 | float magnitudexy() { 191 | return sqrtf(x * x + y * y); 192 | } 193 | 194 | float magnitudexz() { 195 | return sqrtf(x * x + z * z); 196 | } 197 | 198 | Vec3 normalize() { 199 | return div(magnitude()); 200 | }; 201 | 202 | float distance(Vec3 o) { 203 | float dX = x - o.x; 204 | float dY = y - o.y; 205 | float dZ = z - o.z; 206 | return sqrt(dX * dX + dY * dY + dZ * dZ); 207 | } 208 | }; 209 | 210 | struct Vec3_i { 211 | union { 212 | struct { 213 | int x, y, z; 214 | }; 215 | int arr[3]; 216 | }; 217 | 218 | Vec3_i() { x = y = z = 0; } 219 | Vec3_i(int x = 0, int y = 0, int z = 0) { 220 | this->x = x, this->y = y, this->z = z; 221 | } 222 | 223 | bool operator == (Vec3_i v) { return v.x == x && v.y == y && v.z == z; }; 224 | bool operator != (Vec3_i v) { return v.x != x || v.y != y || v.z != z; }; 225 | 226 | /* Add */ 227 | 228 | Vec3_i add(int i) { 229 | return Vec3_i(x + i, y + i, z + i); 230 | } 231 | 232 | Vec3_i add(int a, int b, int c) { 233 | return Vec3_i(x + a, y + b, z + c); 234 | } 235 | 236 | Vec3_i add(Vec3 o) { 237 | return Vec3_i(x + o.y, y + o.y, z + o.z); 238 | } 239 | 240 | /* Subtract */ 241 | 242 | Vec3_i sub(int i) { 243 | return Vec3_i(x - i, y - i, z - i); 244 | } 245 | 246 | Vec3_i sub(int a, int b, int c) { 247 | return Vec3_i(x - a, x - b, z - c); 248 | } 249 | 250 | Vec3_i sub(Vec3 o) { 251 | return Vec3_i(x - o.x, y - o.y, z - o.z); 252 | } 253 | 254 | /* Divide */ 255 | 256 | Vec3_i div(int i) { 257 | return Vec3_i(x / i, y / i, z / i); 258 | } 259 | 260 | Vec3_i div(int a, int b, int c) { 261 | return Vec3_i(x / a, y / b, z / c); 262 | } 263 | 264 | Vec3_i div(Vec3 o) { 265 | return Vec3_i(x / o.x, y / o.y, z / o.y); 266 | } 267 | 268 | /* Multiply */ 269 | 270 | Vec3_i mult(int i) { 271 | return Vec3_i(x * i, y * i, z * i); 272 | } 273 | 274 | Vec3_i mult(int a, int b, int c) { 275 | return Vec3_i(x * a, y * b, z * c); 276 | } 277 | 278 | Vec3_i mult(Vec3 o) { 279 | return Vec3_i(x * o.x, y * o.y, z * o.z); 280 | } 281 | }; 282 | 283 | struct Vec4 { 284 | union { 285 | struct { 286 | float x, y, z, w; 287 | }; 288 | float arr[4]; 289 | }; 290 | Vec4() { x = y = z = w = 0; } 291 | Vec4(float x = 0, float y = 0, float z = 0, float w = 0) { 292 | this->x = x, this->y = y, this->z = z, this->w = w; 293 | } 294 | 295 | bool operator == (Vec4 v) { return v.x == x && v.y == y && v.z == z && v.w == w; }; 296 | bool operator != (Vec4 v) { return v.x != x || v.y != y || v.z != z || v.w != w; }; 297 | }; 298 | 299 | struct MC_Colour { 300 | union { 301 | struct { 302 | float r, g, b, a; 303 | }; 304 | float arr[4]; 305 | }; 306 | bool shouldDelete = true; 307 | 308 | MC_Colour() { 309 | this->r = 1; 310 | this->g = 1; 311 | this->b = 1; 312 | this->a = 1; 313 | }; 314 | 315 | MC_Colour(const MC_Colour& other) { 316 | this->r = other.r; 317 | this->g = other.g; 318 | this->b = other.b; 319 | this->a = other.a; 320 | this->shouldDelete = other.shouldDelete; 321 | } 322 | 323 | MC_Colour(const float* arr) { 324 | this->arr[0] = arr[0]; 325 | this->arr[1] = arr[1]; 326 | this->arr[2] = arr[2]; 327 | this->arr[3] = arr[3]; 328 | }; 329 | 330 | MC_Colour(const float r, const float g, const float b, const float a = 1) { 331 | this->r = r; 332 | this->g = g; 333 | this->b = b; 334 | this->a = a; 335 | }; 336 | 337 | MC_Colour(const int r, const int g, const int b, const int a = 255) { 338 | this->r = r / 255.0f; 339 | this->g = g / 255.0f; 340 | this->b = b / 255.0f; 341 | this->a = a / 255.0f; 342 | }; 343 | 344 | MC_Colour(const float r, const float g, const float b, const float a, const bool shouldDelete) { 345 | this->r = r; 346 | this->g = g; 347 | this->b = b; 348 | this->a = a; 349 | this->shouldDelete = shouldDelete; 350 | }; 351 | 352 | bool operator == (MC_Colour colour) { 353 | return this->r == colour.r && this->g == colour.g && this->b == colour.b; 354 | }; 355 | 356 | bool operator != (MC_Colour colour) { 357 | return this->r != colour.r || this->g != colour.g || this->b != colour.b; 358 | }; 359 | }; 360 | 361 | class Utils { 362 | public: 363 | static HMODULE hModule; 364 | static bool hasExtension(std::string fileName); 365 | static bool doesPathExist(std::string); 366 | static void CreateDir(std::string); 367 | static void DeletePath(std::string); 368 | static void WriteToFile(std::string, std::string); 369 | static void DebugLogOutput(std::string); 370 | static uintptr_t FindAddr(uintptr_t, std::vector); 371 | static uintptr_t FindSig(const char*); 372 | static std::string ptrToStr(uintptr_t); 373 | 374 | static std::map KeyMapping; 375 | static bool usingKey(uint64_t); 376 | }; 377 | 378 | class RenderUtils { 379 | private: 380 | static class MinecraftUIRenderContext* CachedContext; 381 | static class BitmapFont* CachedFont; 382 | public: 383 | static void SetContext(class MinecraftUIRenderContext* Context, class BitmapFont* Font); 384 | static void FlushText(); 385 | static float GetTextWidth(std::string text, float textSize); 386 | static void RenderText(std::string text, Vec2 textPos, MC_Colour colour, float textSize, float alpha); 387 | 388 | static void FillRectangle(Vec4 position, MC_Colour colour, float alpha); 389 | static void DrawRectangle(Vec4 position, MC_Colour colour, float alpha, float lineWidth); 390 | }; 391 | -------------------------------------------------------------------------------- /Client Base/SDK/Classes/Actor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "MultiPlayerLevel.h" 3 | 4 | class Actor { 5 | public: 6 | char pad_0008[280]; //0x0008 7 | Vec2 bodyRot; //0x0120 8 | char pad_0128[152]; //0x0128 9 | bool onGround; //0x01C0 10 | char pad_01C1[95]; //0x01C1 11 | float stepHeight; //0x0220 | Default = 0.5625 12 | char pad_0224[308]; //0x0224 13 | class MultiPlayerLevel* MultiPlayerLevel; //0x0358 14 | char pad_0360[340]; //0x0360 15 | Vec2 collision; //0x04B4 16 | char pad_04BC[24]; //0x04BC 17 | Vec3 velocity; //0x04D4 18 | char pad_04E0[880]; //0x04E0 19 | 20 | virtual void Function0(); 21 | virtual void Function1(); 22 | virtual void Function2(); 23 | virtual void Function3(); 24 | virtual void Function4(); 25 | virtual void Function5(); 26 | virtual void Function6(); 27 | virtual void Function7(); 28 | virtual void reset(void); 29 | virtual void getOnDeathExperience(void); 30 | virtual enum ActorType getOwnerEntityType(void); 31 | virtual void remove(void); 32 | virtual void setPos(Vec3 const&); 33 | virtual void Function13(); 34 | virtual Vec3* getPos(); 35 | virtual Vec3* getPosOld(); 36 | virtual Vec3* getPosExtrapolated(float); 37 | virtual void Function17(); 38 | virtual Vec3* getFiringPos(void); 39 | virtual void setRot(Vec3 const&); 40 | virtual void Function20(); 41 | virtual void move(Vec3 const&); 42 | virtual void Function22(); 43 | virtual float getInterpolatedBodyRot(float); 44 | virtual float getShadowHeightOffs(void); 45 | virtual void Function25(); 46 | virtual float getYawSpeedInDegreesPerSecond(void); 47 | virtual float getInterpolatedWalkAnimSpeed(float); 48 | virtual void Function28(); 49 | virtual void checkBlockCollisions(void); 50 | virtual void Function30(); 51 | virtual bool isFireImmune(void); 52 | virtual void Function32(); 53 | virtual void Function33(); 54 | virtual void teleportTo(Vec3 const&, bool, int, int, uint64_t); //Last param is ActorUniqueID 55 | virtual void tryTeleportTo(Vec3 const&, bool, bool, int, int); 56 | virtual void chorusFruitTeleport(Vec3&); 57 | virtual void lerpTo(Vec3 const&, Vec2 const&, int); 58 | virtual void lerpMotion(Vec3 const&); 59 | virtual void Function39(); 60 | virtual void normalTick(void); 61 | virtual void baseTick(void); 62 | virtual void rideTick(void); 63 | virtual void positionRider(Actor&, float); 64 | virtual float getRidingHeight(void); 65 | virtual void startRiding(Actor&); 66 | virtual void addRider(Actor&); 67 | virtual void flagRiderToRemove(Actor&); 68 | virtual void Function48(); 69 | virtual bool intersects(Vec3 const&, Vec3 const&); 70 | virtual bool isFree(Vec3 const&); 71 | virtual void Function51(); 72 | virtual bool isInWall(void); 73 | virtual bool isInvisible(void); 74 | virtual bool canShowNameTag(void); 75 | virtual void Function55(); 76 | virtual void setNameTagVisible(bool); 77 | virtual void Function57(); 78 | virtual __int64 getNameTagAsHash(void); 79 | virtual std::string getFormattedNameTag(void); 80 | virtual void Function60(); 81 | virtual void setNameTag(std::string const&); 82 | virtual void Function62(); 83 | virtual void Function63(); 84 | virtual void Function64(); 85 | virtual bool isInWater(void); 86 | virtual bool hasEnteredWater(void); 87 | virtual bool isImmersedInWater(void); 88 | virtual bool isInWaterOrRain(void); 89 | virtual bool isInLava(void); 90 | virtual bool isUnderLiquid(class MaterialType); 91 | virtual bool isOverWater(void); 92 | virtual void makeStuckInBlock(Vec3 const&); 93 | virtual void Function73(); 94 | virtual void Function74(); 95 | virtual float getShadowRadius(void); 96 | virtual Vec3* getHeadLookVector(float); 97 | virtual void Function77(); 98 | virtual bool canSee(Vec3 const&); 99 | virtual bool canSee(Actor const&); 100 | virtual bool isSkyLit(float); 101 | virtual float getBrightness(float); 102 | virtual void Function82(); 103 | virtual void Function83(); 104 | virtual void onAboveBubbleColumn(bool); 105 | virtual void onInsideBubbleColumn(bool); 106 | virtual bool isImmobile(void); 107 | virtual bool isSilent(void); 108 | virtual bool isPickable(); 109 | virtual void Function89(); 110 | virtual bool isSleeping(void); 111 | virtual void Function91(); 112 | virtual void setSneaking(bool); 113 | virtual bool isBlocking(void); 114 | virtual void Function94(); 115 | virtual bool isAlive(void); 116 | virtual bool isOnFire(void); 117 | virtual bool isOnHotBlock(void); 118 | virtual void Function98(); 119 | virtual bool isSurfaceMob(void); 120 | virtual void Function100(); 121 | virtual void Function101(); 122 | virtual void Function102(); 123 | virtual bool canAttack(Actor*, bool); 124 | virtual void setTarget(Actor*); 125 | virtual void Function105(); 126 | virtual void Function106(); 127 | virtual void attack(Actor&); 128 | virtual void performRangedAttack(Actor&, float); 129 | virtual void adjustDamageAmount(int&); 130 | virtual int getEquipmentCount(void); 131 | virtual void setOwner(uint64_t); //Param is ActorUniqueID 132 | virtual void setSitting(bool); 133 | virtual void Function113(); 134 | virtual void Function114(); 135 | virtual int getInventorySize(void); 136 | virtual int getEquipSlots(void); 137 | virtual int getChestSlots(void); 138 | virtual void setStanding(bool); 139 | virtual bool canPowerJump(void); 140 | virtual void setCanPowerJump(bool); 141 | virtual bool isJumping(void); 142 | virtual bool isEnchanted(void); 143 | virtual void Function123(); 144 | virtual void Function124(); 145 | virtual bool shouldRender(void); 146 | virtual void Function126(); 147 | virtual void Function127(); 148 | virtual void Function128(); 149 | virtual void animateHurt(void); 150 | virtual void doFireHurt(void); 151 | virtual void onLightningHit(void); 152 | virtual void onBounceStarted(void); 153 | virtual void feed(int); 154 | virtual void handleEntityEvent(class ActorEvent, int); 155 | virtual float getPickRadius(void); 156 | virtual void getActorRendererId(void); 157 | virtual void spawnAtLocation(class ItemStack const&, float); 158 | virtual void spawnAtLocation(class Block const&, int, float); 159 | virtual void spawnAtLocation(class Block const&, int); 160 | virtual void spawnAtLocation(int, int, float); 161 | virtual void spawnAtLocation(int, int); 162 | virtual void despawn(void); 163 | virtual void killed(Actor&); 164 | virtual void Function144(); 165 | virtual void setArmor(int, class ItemStack const&); 166 | virtual class ItemStack getArmor(int); 167 | virtual void Function147(); 168 | virtual void Function148(); 169 | virtual float getModelScale(void); 170 | virtual class ItemStack getEquippedSlot(int); 171 | virtual void setEquippedSlot(int, class ItemStack const&); 172 | virtual class ItemStack getSelectedItem(void); 173 | virtual void setCarriedItem(class ItemStack const&); 174 | virtual void setOffhandSlot(class ItemStack const&); 175 | virtual class ItemStack getEquippedTotem(void); 176 | virtual void consumeTotem(void); 177 | virtual void Function157(); 178 | virtual void Function158(); 179 | virtual void Function159(); 180 | virtual void Function160(); 181 | virtual int getEntityTypeId(void); 182 | virtual void queryEntityRenderer(void); 183 | virtual __int64 getSourceUniqueID(void); 184 | virtual void setOnFire(int); 185 | virtual void getHandleWaterAABB(void); 186 | virtual void handleInsidePortal(Vec3 const&); 187 | virtual void Function167(); 188 | virtual __int64 getPortalCooldown(void); 189 | virtual int getDimensionId(void); 190 | virtual void Function170(); 191 | virtual void Function171(); 192 | virtual void changeDimension(int, bool); 193 | virtual void Function173(); 194 | virtual void checkFallDamage(float, bool); 195 | virtual void causeFallDamage(float); 196 | virtual void handleFallDistanceOnServer(float, bool); 197 | virtual void Function177(); 198 | virtual void Function178(); 199 | virtual void onSynchedDataUpdate(int); 200 | virtual bool canAddRider(Actor&); 201 | virtual void Function181(); 202 | virtual void Function182(); 203 | virtual bool isInCaravan(void); 204 | virtual void Function184(); 205 | virtual void tickLeash(void); 206 | virtual void sendMotionPacketIfNeeded(void); 207 | virtual void Function187(); 208 | virtual void stopRiding(bool, bool, bool); 209 | virtual void startSwimming(void); 210 | virtual void stopSwimming(void); 211 | virtual void Function191(); 212 | virtual int getCommandPermissionLevel(void); 213 | virtual void Function193(); 214 | virtual void Function194(); 215 | virtual int getDeathTime(void); 216 | virtual void heal(int); 217 | virtual bool isInvertedHealAndHarm(void); 218 | virtual void Function198(); 219 | virtual bool canBeAffected(int); 220 | virtual void Function200(); 221 | virtual void Function201(); 222 | virtual void Function202(); 223 | virtual void Function203(); 224 | virtual void Function204(); 225 | virtual void Function205(); 226 | virtual void swing(void); 227 | virtual void Function206(); 228 | virtual void Function207(); 229 | virtual void Function208(); 230 | virtual void Function209(); 231 | virtual float getMapDecorationRotation(void); 232 | virtual float getRiderYRotation(Actor const&); 233 | virtual void Function212(); 234 | virtual void Function213(); 235 | virtual bool isCreative(void); 236 | virtual bool isAdventure(void); 237 | virtual void add(class ItemStack&); 238 | virtual void drop(class ItemStack const&, bool); 239 | virtual void Function218(); 240 | virtual void Function219(); 241 | virtual void Function220(); 242 | virtual void setSize(float, float); 243 | virtual int getLifeSpan(void); 244 | virtual void onOrphan(void); 245 | virtual void wobble(void); 246 | virtual bool wasHurt(void); 247 | virtual void startSpinAttack(void); 248 | virtual void stopSpinAttack(void); 249 | virtual void setDamageNearbyMobs(bool); 250 | virtual void Function229(); 251 | virtual void Function230(); 252 | virtual void reloadLootTable(void); 253 | virtual void Function232(); 254 | virtual void kill(void); 255 | virtual void die(void); 256 | virtual bool shouldTick(void); 257 | virtual void createMovementProxy(void); 258 | virtual void Function237(); 259 | virtual void shouldTryMakeStepSound(void); 260 | virtual float getNextStep(float); 261 | virtual void Function240(); 262 | virtual bool outOfWorld(void); 263 | virtual void Function242(); 264 | virtual void markHurt(void); 265 | virtual void Function244(); 266 | virtual void Function245(); 267 | virtual void Function246(); 268 | virtual void Function247(); 269 | virtual void Function248(); 270 | virtual void checkInsideBlocks(float); 271 | virtual void pushOutOfBlocks(Vec3 const&); 272 | virtual void updateWaterState(void); 273 | virtual void doWaterSplashEffect(void); 274 | virtual void spawnTrailBubbles(void); 275 | virtual void updateInsideBlock(void); 276 | virtual struct LootTable getLootTable(void); 277 | virtual void Function256(); 278 | virtual void Function257(); 279 | virtual void Function258(); 280 | virtual void Function259(); 281 | virtual void knockback(Actor*, int, float, float, float, float, float); 282 | }; -------------------------------------------------------------------------------- /Client Base/SDK/Classes/ClientInstance.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TextHolder.h" 3 | #include "MinecraftUIRenderContext.h" 4 | #include "Actor.h" 5 | #include "LocalPlayer.h" 6 | #include "GameMode.h" 7 | 8 | class ClientInstance { 9 | public: 10 | class LocalPlayer* LocalPlayer() { 11 | if (this != nullptr) { 12 | return *reinterpret_cast(reinterpret_cast<__int64>(this) + 0x138); 13 | } 14 | else { 15 | return nullptr; 16 | } 17 | } 18 | class MinecraftGame* MinecraftGame() { 19 | if (this != nullptr) { 20 | return *reinterpret_cast(reinterpret_cast<__int64>(this) + 0x98); 21 | } 22 | else { 23 | return nullptr; 24 | } 25 | } 26 | 27 | bool isValidTarget(class Actor* Entity) { 28 | if (Entity == nullptr) { 29 | return false; 30 | } 31 | if (Entity->isInvisible() || !Entity->isAlive() || Entity->isImmobile()) { 32 | return false; 33 | } 34 | if (Entity->getEntityTypeId() > 60 && Entity->getEntityTypeId() < 104 && Entity->getEntityTypeId() != 63) { 35 | return false; 36 | } 37 | if (Entity->getFormattedNameTag().length() <= 1) { 38 | return false; 39 | } 40 | if (!(this->LocalPlayer()->canAttack(Entity, false))) { 41 | return false; 42 | } 43 | return true; 44 | }; 45 | }; 46 | 47 | class BitmapFont { 48 | public: 49 | // 50 | }; 51 | 52 | class MinecraftGame { 53 | public: 54 | class BitmapFont* MCFont() { 55 | return *reinterpret_cast(reinterpret_cast<__int64>(this) + 0xD8); 56 | } 57 | bool canUseKeys() { 58 | return *(bool*)(reinterpret_cast(this) + 0x260); 59 | } 60 | }; -------------------------------------------------------------------------------- /Client Base/SDK/Classes/GameMode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class GameMode { 4 | public: 5 | LocalPlayer* Player; //0x0008 6 | 7 | virtual void Destructor(); 8 | virtual void startDestroyBlock(Vec3_i*, UCHAR, bool); 9 | virtual void destroyBlock(Vec3_i*, UCHAR); 10 | virtual void continueDestroyBlock(Vec3_i*, UCHAR, bool); 11 | virtual void stopDestroyBlock(Vec3_i*); 12 | virtual void startBuildBlock(Vec3_i*, UCHAR); 13 | virtual void buildBlock(Vec3_i*, UCHAR); 14 | virtual void continueBuildBlock(Vec3_i*, UCHAR); 15 | virtual void stopBuildBlock(void); 16 | virtual void tick(void); 17 | virtual float getPickRange(); 18 | virtual void useItem(); 19 | virtual void useItemOn(); 20 | virtual void interact(Actor*, Vec3*); 21 | virtual void attack(Actor*); 22 | virtual void releaseUsingItem(); 23 | }; -------------------------------------------------------------------------------- /Client Base/SDK/Classes/LocalPlayer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class LocalPlayer : public Actor { 4 | public: 5 | virtual void Function261(); 6 | virtual void Function262(); 7 | virtual void setSleeping(bool); 8 | virtual void setSprinting(bool); 9 | virtual void Function265(); 10 | virtual void Function266(); 11 | virtual void Function267(); 12 | virtual void Function268(); 13 | virtual void Function269(); 14 | virtual float getSpeed(void); 15 | virtual void setSpeed(float); 16 | virtual float getJumpPower(void); 17 | virtual void Function273(); 18 | virtual void Function274(); 19 | virtual void Function275(); 20 | virtual void Function276(); 21 | virtual void travel(float, float, float); 22 | virtual void applyFinalFriction(float, bool); 23 | virtual void updateWalkAnim(void); 24 | virtual void Function280(); 25 | virtual void aiStep(void); 26 | virtual void pushActors(void); 27 | virtual void lookAt(Actor*, float, float); 28 | virtual bool isLookingAtAnEntity(void); 29 | virtual void Function285(); 30 | virtual bool checkSpawnObstruction(void); 31 | virtual float getAttackAnim(float); 32 | virtual float getItemUseDuration(void); 33 | virtual float getItemUseStartupProgress(void); 34 | virtual float getItemUseIntervalProgress(void); 35 | virtual int getItemuseIntervalAxis(void); 36 | virtual int getTimeAlongSwing(void); 37 | virtual void Function293(); 38 | virtual float getMaxHeadXRot(void); 39 | virtual Actor getLastHurtByMob(void); 40 | virtual void setLastHurtByMob(Actor*); 41 | virtual void Function297(); 42 | virtual void Function298(); 43 | virtual void Function299(); 44 | virtual void Function300(); 45 | virtual void Function301(); 46 | virtual void doHurtTarget(Actor*); 47 | virtual void Function303(); 48 | virtual void leaveCaravan(void); 49 | virtual void joinCaravan(Actor*); 50 | virtual bool hasCaravanTail(void); 51 | virtual uint64_t getCaravanHead(void); 52 | virtual int getArmorValue(void); 53 | virtual int getArmorCoverPercentage(void); 54 | virtual void Function310(); 55 | virtual void Function311(); 56 | virtual void Function312(); 57 | virtual void Function313(); 58 | virtual void Function314(); 59 | virtual void Function315(); 60 | virtual void Function316(); 61 | virtual void updateEquipment(void); 62 | virtual void clearEquipment(void); 63 | virtual void Function319(); 64 | virtual void Function320(); 65 | virtual void Function321(); 66 | virtual void Function322(); 67 | virtual void Function323(); 68 | virtual void dropEquipmentOnDeath(void); 69 | virtual void Function325(); 70 | virtual void Function326(); 71 | virtual void Function327(); 72 | virtual void Function328(); 73 | virtual void createAIGoals(void); 74 | virtual void Function330(); 75 | virtual void setItemSlot(int, class ItemStack const&); 76 | virtual void setTransitioningSitting(bool); 77 | virtual void attackAnimation(Actor*, bool); 78 | virtual void Function334(); 79 | virtual void Function335(); 80 | virtual void Function336(); 81 | virtual void Function337(); 82 | virtual void ascendLadder(void); 83 | virtual void ascendScaffolding(void); 84 | virtual void descendScaffolding(void); 85 | virtual void dropContainer(void); 86 | virtual void Function342(); 87 | virtual void Function343(); 88 | virtual void jumpFromGround(void); 89 | virtual void Function345(); 90 | virtual void Function346(); 91 | virtual void Function347(); 92 | virtual void Function348(); 93 | virtual void Function349(); 94 | virtual void dropBags(void); 95 | virtual void tickDeath(void); 96 | virtual void updateGliding(void); 97 | virtual void Function353(); 98 | virtual void Function354(); 99 | virtual void destroyRegion(void); 100 | virtual void suspendRegion(void); 101 | virtual void Function357(); 102 | virtual bool _fireWillChangeDimension(void); 103 | virtual void _fireDimensionChanged(void); 104 | virtual void Function360(); 105 | virtual void tickWorld(void); 106 | virtual void Function362(); 107 | virtual void Function363(); 108 | virtual void moveView(void); 109 | virtual void Function365(); 110 | virtual void Function366(); 111 | virtual void Function367(); 112 | virtual void Function368(); 113 | virtual void respawn(void); 114 | virtual void Function370(); 115 | virtual void resetPos(bool); 116 | virtual void Function372(); 117 | virtual bool hasResource(int); 118 | virtual void completeUsingItem(void); 119 | virtual void setPermissions(int); 120 | virtual void startDestroying(void); 121 | virtual void stopDestroying(void); 122 | virtual void Function378(); 123 | virtual void Function379(); 124 | virtual void Function380(); 125 | virtual bool canOpenContainerScreen(void); 126 | virtual void Function382(); 127 | virtual void Function383(); 128 | virtual void Function384(); 129 | virtual void Function385(); 130 | virtual void Function386(); 131 | virtual void Function387(); 132 | virtual void Function388(); 133 | virtual void Function389(); 134 | virtual void startSleepInBed(Vec3 const&); 135 | virtual void stopSleepInBed(bool, bool); 136 | virtual bool canStartSleepInBed(void); 137 | virtual int getSleepTimer(void); 138 | virtual int getPreviousTickSleepTimer(void); 139 | virtual void Function395(); 140 | virtual void Function396(); 141 | virtual void Function397(); 142 | virtual void Function398(); 143 | virtual void Function399(); 144 | virtual void Function400(); 145 | virtual void Function401(); 146 | virtual void Function402(); 147 | virtual void setPlayerGameType(int); 148 | virtual void _crit(Actor&); 149 | virtual void Function405(); 150 | virtual void Function406(); 151 | virtual void sendEventPacket(class EventPacket); 152 | virtual void addExperience(int); 153 | virtual void addLevels(int); 154 | virtual void Function410(); 155 | virtual void Function411(); 156 | virtual void Function412(); 157 | virtual void Function413(); 158 | virtual void deleteContainerManager(void); 159 | virtual void setFieldOfViewModifier(float); 160 | virtual void Function416(); 161 | virtual void Function417(); 162 | virtual void Function418(); 163 | virtual void Function419(); 164 | virtual void Function420(); 165 | virtual void startCooldown(class Item const*); 166 | virtual void Function422(); 167 | virtual void Function423(); 168 | virtual void Function424(); 169 | virtual void Function425(); 170 | virtual void Function426(); 171 | virtual void Function427(); 172 | virtual void Function428(); 173 | virtual void Function429(); 174 | virtual void Function430(); 175 | virtual void Function431(); 176 | virtual void Function432(); 177 | }; -------------------------------------------------------------------------------- /Client Base/SDK/Classes/MinecraftUIRenderContext.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class MinecraftUIRenderContext { 4 | public: 5 | virtual void Constructor(void); 6 | virtual float getLineLength(class BitmapFont* font, class TextHolder* text, float textSize, bool unknown); 7 | virtual float getTextAlpha(); 8 | virtual void setTextAlpha(float alpha); 9 | virtual __int64 drawDebugText(const float* pos, class TextHolder* text, float* color, float alpha, unsigned int textAlignment, const float* textMeasureData, const void* caretMeasureData); 10 | virtual __int64 drawText(class BitmapFont* font, struct Vec4* position, class TextHolder* text, MC_Colour colour, float alpha, unsigned int textAlignment, const float* textMeasureData, const uintptr_t* caretMeasureData); 11 | virtual void flushText(float timeSinceLastFlush); 12 | virtual __int64 drawImageNOTIMPLEMENTED(); 13 | virtual __int64 drawNinesliceNOTIMPLEMENTED(); 14 | virtual __int64 flushImagesNOTIMPLEMENTED(); 15 | virtual __int64 beginSharedMeshBatchNOTIMPLEMENTED(); 16 | virtual __int64 endSharedMeshBatchNOTIMPLEMENTED(); 17 | virtual void drawRectangle(struct Vec4 position, MC_Colour colour, float alpha, int lineWidth); 18 | virtual void fillRectangle(struct Vec4 position, MC_Colour colour, float alpha); 19 | }; -------------------------------------------------------------------------------- /Client Base/SDK/Classes/MultiPlayerLevel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class MultiPlayerLevel { 4 | public: 5 | char pad_0008[72]; //0x0008 6 | uint64_t listStart; //0x0050 7 | uint64_t listEnd; //0x0058 8 | char pad_0060[32]; //0x0060 9 | 10 | /* VTable Functions (Not currently defined) */ 11 | 12 | virtual void Function0(); 13 | virtual void Function1(); 14 | virtual void Function2(); 15 | virtual void Function3(); 16 | virtual void Function4(); 17 | virtual void Function5(); 18 | virtual void Function6(); 19 | virtual void Function7(); 20 | virtual void Function8(); 21 | virtual void Function9(); 22 | public: 23 | 24 | inline class Actor* get(size_t idx) { 25 | if (idx >= getListSize()) 26 | return 0; 27 | return *reinterpret_cast(listStart + (idx * sizeof(uintptr_t))); 28 | }; 29 | inline size_t getListSize() { 30 | return (listEnd - listStart) / sizeof(uintptr_t); 31 | }; 32 | }; -------------------------------------------------------------------------------- /Client Base/SDK/Classes/TextHolder.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class TextHolder 5 | { 6 | public: 7 | 8 | union { 9 | char inlineText[16]; //0x0000 10 | char* pText; //0x0000 11 | }; 12 | 13 | size_t textLength; //0x0010 14 | size_t alignedTextLength; //0x0018 15 | 16 | TextHolder() { 17 | memset(this, 0, sizeof(TextHolder)); 18 | } 19 | 20 | TextHolder(std::string str) { 21 | memset(this, 0, sizeof(TextHolder)); 22 | textLength = str.size(); 23 | alignedTextLength = textLength | 0xF; 24 | if (str.size() < 16) 25 | strcpy_s(inlineText, 16, str.c_str()); 26 | else { 27 | size_t size = str.size(); 28 | pText = reinterpret_cast(malloc(alignedTextLength + 1)); 29 | if (pText != 0x0) { 30 | strcpy_s(pText, size + 1, str.c_str()); 31 | } 32 | } 33 | } 34 | 35 | TextHolder(void* ptr, size_t sizeOfData) { 36 | memset(this, 0, sizeof(TextHolder)); 37 | textLength = sizeOfData; 38 | alignedTextLength = sizeOfData; 39 | if (textLength < 16) 40 | memcpy(inlineText, ptr, sizeOfData); 41 | else 42 | pText = reinterpret_cast(ptr); 43 | } 44 | 45 | ~TextHolder() { 46 | if (textLength >= 16 && pText != nullptr) { 47 | free(pText); 48 | } 49 | } 50 | 51 | char* getText() { 52 | if (alignedTextLength < 16) 53 | return this->inlineText; 54 | else 55 | return this->pText; 56 | } 57 | 58 | size_t getTextLength() { 59 | return textLength; 60 | } 61 | 62 | void setText(std::string str) { 63 | memset(this, 0, sizeof(TextHolder)); 64 | textLength = str.size(); 65 | alignedTextLength = textLength | 0xF; 66 | if (str.size() < 16) 67 | strcpy_s(inlineText, 16, str.c_str()); 68 | else { 69 | size_t size = str.size(); 70 | char* ptr = reinterpret_cast(malloc(alignedTextLength + 1)); 71 | if (ptr != 0x0) { 72 | strcpy_s(ptr, size + 1, str.c_str()); 73 | } 74 | 75 | pText = ptr; 76 | } 77 | } 78 | 79 | void resetWithoutDelete() { 80 | memset(this, 0, sizeof(TextHolder)); 81 | } 82 | }; -------------------------------------------------------------------------------- /Client Base/SDK/Minecraft.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Other/Utils.h" 3 | 4 | #include "Classes/ClientInstance.h" 5 | 6 | class Minecraft { 7 | private: 8 | static ClientInstance* CachedInstance; 9 | static GameMode* CachedGameMode; 10 | public: 11 | static UINT64 ModuleBase() { 12 | return (UINT64)GetModuleHandle(NULL); 13 | } 14 | static void SetClientInstance(ClientInstance* obj) { 15 | if (obj != nullptr) CachedInstance = obj; 16 | } 17 | static ClientInstance* ClientInstance() { 18 | return CachedInstance; 19 | } 20 | static void SetGamemode(GameMode* GM) { 21 | if (GM != nullptr) CachedGameMode = GM; 22 | } 23 | static GameMode* GameMode() { 24 | return CachedGameMode; 25 | } 26 | 27 | static std::vector Friends; 28 | }; -------------------------------------------------------------------------------- /Client Base/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /LocalPlayer.rcnet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tmzkelly/Client-Base/e9d0c9d6e44b1e7f6737051389aa8cfd8a6bae1a/LocalPlayer.rcnet -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Client-Base 2 | A Client Base for Minecraft Bedrock Edition (Windows 10) 3 | 4 | This is an internal (Dynamic Link Library - DLL) project which means that it has to be injected into the process, if you cannot get it to inject after compilling then the DLL is most likely missing the `ALL_APPLICATION_PACKAGES` permission, more can be read at https://www.unknowncheats.me/forum/general-programming-and-reversing/177183-basic-intermediate-techniques-uwp-app-modding.html 5 | -------------------------------------------------------------------------------- /packages/minhook.1.3.3/.signature.p7s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tmzkelly/Client-Base/e9d0c9d6e44b1e7f6737051389aa8cfd8a6bae1a/packages/minhook.1.3.3/.signature.p7s -------------------------------------------------------------------------------- /packages/minhook.1.3.3/build/native/minhook.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $(MSBuildThisFileDirectory)..\..\lib\native\include;%(AdditionalIncludeDirectories) 6 | 7 | 8 | $(MSBuildThisFileDirectory)..\..\lib\native\lib\libMinHook.lib;%(AdditionalDependencies) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /packages/minhook.1.3.3/lib/native/include/MinHook.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MinHook - The Minimalistic API Hooking Library for x64/x86 3 | * Copyright (C) 2009-2017 Tsuda Kageyu. 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 20 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #if !(defined _M_IX86) && !(defined _M_X64) && !(defined __i386__) && !(defined __x86_64__) 32 | #error MinHook supports only x86 and x64 systems. 33 | #endif 34 | 35 | #include 36 | 37 | // MinHook Error Codes. 38 | typedef enum MH_STATUS 39 | { 40 | // Unknown error. Should not be returned. 41 | MH_UNKNOWN = -1, 42 | 43 | // Successful. 44 | MH_OK = 0, 45 | 46 | // MinHook is already initialized. 47 | MH_ERROR_ALREADY_INITIALIZED, 48 | 49 | // MinHook is not initialized yet, or already uninitialized. 50 | MH_ERROR_NOT_INITIALIZED, 51 | 52 | // The hook for the specified target function is already created. 53 | MH_ERROR_ALREADY_CREATED, 54 | 55 | // The hook for the specified target function is not created yet. 56 | MH_ERROR_NOT_CREATED, 57 | 58 | // The hook for the specified target function is already enabled. 59 | MH_ERROR_ENABLED, 60 | 61 | // The hook for the specified target function is not enabled yet, or already 62 | // disabled. 63 | MH_ERROR_DISABLED, 64 | 65 | // The specified pointer is invalid. It points the address of non-allocated 66 | // and/or non-executable region. 67 | MH_ERROR_NOT_EXECUTABLE, 68 | 69 | // The specified target function cannot be hooked. 70 | MH_ERROR_UNSUPPORTED_FUNCTION, 71 | 72 | // Failed to allocate memory. 73 | MH_ERROR_MEMORY_ALLOC, 74 | 75 | // Failed to change the memory protection. 76 | MH_ERROR_MEMORY_PROTECT, 77 | 78 | // The specified module is not loaded. 79 | MH_ERROR_MODULE_NOT_FOUND, 80 | 81 | // The specified function is not found. 82 | MH_ERROR_FUNCTION_NOT_FOUND 83 | } 84 | MH_STATUS; 85 | 86 | // Can be passed as a parameter to MH_EnableHook, MH_DisableHook, 87 | // MH_QueueEnableHook or MH_QueueDisableHook. 88 | #define MH_ALL_HOOKS NULL 89 | 90 | #ifdef __cplusplus 91 | extern "C" { 92 | #endif 93 | 94 | // Initialize the MinHook library. You must call this function EXACTLY ONCE 95 | // at the beginning of your program. 96 | MH_STATUS WINAPI MH_Initialize(VOID); 97 | 98 | // Uninitialize the MinHook library. You must call this function EXACTLY 99 | // ONCE at the end of your program. 100 | MH_STATUS WINAPI MH_Uninitialize(VOID); 101 | 102 | // Creates a Hook for the specified target function, in disabled state. 103 | // Parameters: 104 | // pTarget [in] A pointer to the target function, which will be 105 | // overridden by the detour function. 106 | // pDetour [in] A pointer to the detour function, which will override 107 | // the target function. 108 | // ppOriginal [out] A pointer to the trampoline function, which will be 109 | // used to call the original target function. 110 | // This parameter can be NULL. 111 | MH_STATUS WINAPI MH_CreateHook(LPVOID pTarget, LPVOID pDetour, LPVOID *ppOriginal); 112 | 113 | // Creates a Hook for the specified API function, in disabled state. 114 | // Parameters: 115 | // pszModule [in] A pointer to the loaded module name which contains the 116 | // target function. 117 | // pszTarget [in] A pointer to the target function name, which will be 118 | // overridden by the detour function. 119 | // pDetour [in] A pointer to the detour function, which will override 120 | // the target function. 121 | // ppOriginal [out] A pointer to the trampoline function, which will be 122 | // used to call the original target function. 123 | // This parameter can be NULL. 124 | MH_STATUS WINAPI MH_CreateHookApi( 125 | LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal); 126 | 127 | // Creates a Hook for the specified API function, in disabled state. 128 | // Parameters: 129 | // pszModule [in] A pointer to the loaded module name which contains the 130 | // target function. 131 | // pszTarget [in] A pointer to the target function name, which will be 132 | // overridden by the detour function. 133 | // pDetour [in] A pointer to the detour function, which will override 134 | // the target function. 135 | // ppOriginal [out] A pointer to the trampoline function, which will be 136 | // used to call the original target function. 137 | // This parameter can be NULL. 138 | // ppTarget [out] A pointer to the target function, which will be used 139 | // with other functions. 140 | // This parameter can be NULL. 141 | MH_STATUS WINAPI MH_CreateHookApiEx( 142 | LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal, LPVOID *ppTarget); 143 | 144 | // Removes an already created hook. 145 | // Parameters: 146 | // pTarget [in] A pointer to the target function. 147 | MH_STATUS WINAPI MH_RemoveHook(LPVOID pTarget); 148 | 149 | // Enables an already created hook. 150 | // Parameters: 151 | // pTarget [in] A pointer to the target function. 152 | // If this parameter is MH_ALL_HOOKS, all created hooks are 153 | // enabled in one go. 154 | MH_STATUS WINAPI MH_EnableHook(LPVOID pTarget); 155 | 156 | // Disables an already created hook. 157 | // Parameters: 158 | // pTarget [in] A pointer to the target function. 159 | // If this parameter is MH_ALL_HOOKS, all created hooks are 160 | // disabled in one go. 161 | MH_STATUS WINAPI MH_DisableHook(LPVOID pTarget); 162 | 163 | // Queues to enable an already created hook. 164 | // Parameters: 165 | // pTarget [in] A pointer to the target function. 166 | // If this parameter is MH_ALL_HOOKS, all created hooks are 167 | // queued to be enabled. 168 | MH_STATUS WINAPI MH_QueueEnableHook(LPVOID pTarget); 169 | 170 | // Queues to disable an already created hook. 171 | // Parameters: 172 | // pTarget [in] A pointer to the target function. 173 | // If this parameter is MH_ALL_HOOKS, all created hooks are 174 | // queued to be disabled. 175 | MH_STATUS WINAPI MH_QueueDisableHook(LPVOID pTarget); 176 | 177 | // Applies all queued changes in one go. 178 | MH_STATUS WINAPI MH_ApplyQueued(VOID); 179 | 180 | // Translates the MH_STATUS to its name as a string. 181 | const char * WINAPI MH_StatusToString(MH_STATUS status); 182 | 183 | #ifdef __cplusplus 184 | } 185 | #endif 186 | 187 | -------------------------------------------------------------------------------- /packages/minhook.1.3.3/minhook.1.3.3.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tmzkelly/Client-Base/e9d0c9d6e44b1e7f6737051389aa8cfd8a6bae1a/packages/minhook.1.3.3/minhook.1.3.3.nupkg --------------------------------------------------------------------------------