├── .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