├── .gitignore ├── README.md └── Rust-Internal-Always-Updated-main ├── rust base.sln └── rust base ├── Glob.hpp ├── Main.cpp ├── Misc.cpp ├── Misc.h ├── aimbot.cpp ├── aimbot.h ├── baseplayer.h ├── ddraw.h ├── esp.cpp ├── esp.h ├── game ├── classes.cpp ├── classes.hpp ├── hooks.hpp ├── il2cpp.cpp ├── il2cpp.hpp ├── offsets.cpp └── offsets.hpp ├── gui_framework.h ├── hinclude.h ├── includes.hpp ├── ongui.h ├── performanceui.h ├── rust base.vcxproj ├── rust base.vcxproj.filters ├── rust base.vcxproj.user ├── sky.cpp ├── sky.hpp └── utils ├── lazy_importer.hpp ├── math.cpp ├── math.hpp ├── memory.cpp ├── memory.hpp ├── returnspoofer.asm ├── returnspoofer.hpp └── xor.hpp /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Rust-Internal-Always-Updated 2 | This is a private source Rust source, it does not need any updating besides placing the visual asset. If you are not familiar with rust, you will not understand. This uses ill2cpp dumper to auto update offsets. This is fully undetected and using my own framework, not ImGui. This is my source, and nothing is pasted. Feel free to check. 3 | ### Features 4 | - Auto Updating Offsets (ill2cpp) 5 | - Uses own render framework, not ImGui, so no need to worry about detected hooks 6 | - This project source is fully undetected, and just needs any undetected injector (some free ones work if you are a rage player) 7 | - Has visual features, and aim features but smoothing needs added 8 | -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32819.101 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rust base", "rust base\rust base.vcxproj", "{0678EC97-C0F5-4F7A-A230-561A65F33499}" 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 | {0678EC97-C0F5-4F7A-A230-561A65F33499}.Debug|x64.ActiveCfg = Debug|x64 17 | {0678EC97-C0F5-4F7A-A230-561A65F33499}.Debug|x64.Build.0 = Debug|x64 18 | {0678EC97-C0F5-4F7A-A230-561A65F33499}.Debug|x86.ActiveCfg = Debug|Win32 19 | {0678EC97-C0F5-4F7A-A230-561A65F33499}.Debug|x86.Build.0 = Debug|Win32 20 | {0678EC97-C0F5-4F7A-A230-561A65F33499}.Release|x64.ActiveCfg = Release|x64 21 | {0678EC97-C0F5-4F7A-A230-561A65F33499}.Release|x64.Build.0 = Release|x64 22 | {0678EC97-C0F5-4F7A-A230-561A65F33499}.Release|x86.ActiveCfg = Release|Win32 23 | {0678EC97-C0F5-4F7A-A230-561A65F33499}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {92A55AB6-0813-4335-8B6F-BDA4ADA92A80} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/Glob.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Device1337/Rust-Internal-Always-Updated/7b0a954c2fa31b562f06edbd20b29437913c7e01/Rust-Internal-Always-Updated-main/rust base/Glob.hpp -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/Main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "includes.hpp" 3 | #include "game/il2cpp.hpp" 4 | #include "game/hooks.hpp" 5 | 6 | void CreateConsole() 7 | { 8 | 9 | if (!AllocConsole()) { 10 | //Add some error handling here. 11 | //You can call GetLastError() to get more info about the error. 12 | return; 13 | } 14 | 15 | //std::cout, std::clog, std::cerr, std::cin 16 | FILE* fDummy; 17 | freopen_s(&fDummy, "CONOUT$", "w", stdout); 18 | freopen_s(&fDummy, "CONOUT$", "w", stderr); 19 | freopen_s(&fDummy, "CONIN$", "r", stdin); 20 | std::cout.clear(); 21 | std::clog.clear(); 22 | std::cerr.clear(); 23 | std::cin.clear(); 24 | 25 | //std::wcout, std::wclog, std::wcerr, std::wcin 26 | HANDLE hConOut = CreateFile(("CONOUT$"), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); 27 | HANDLE hConIn = CreateFile(("CONIN$"), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); 28 | SetStdHandle(STD_OUTPUT_HANDLE, hConOut); 29 | SetStdHandle(STD_ERROR_HANDLE, hConOut); 30 | SetStdHandle(STD_INPUT_HANDLE, hConIn); 31 | std::wcout.clear(); 32 | std::wclog.clear(); 33 | std::wcerr.clear(); 34 | std::wcin.clear(); 35 | } 36 | 37 | extern "C" __declspec(dllexport) int NextHook(int code, WPARAM wParam, LPARAM lParam) { return CallNextHookEx(NULL, code, wParam, lParam); } 38 | 39 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD callReason, LPVOID lpReserved) 40 | { 41 | if (callReason == DLL_PROCESS_ATTACH) 42 | { 43 | CreateConsole(); 44 | 45 | 46 | // convert now to string form 47 | //char* dt = ctime_s(&now); 48 | il2cpp::init(); 49 | hooks::init(); 50 | // std::cout << "DLL has been injected at: " << std::put_time(std::localtime(&t_c), "%F %T.\n") << std::endl; 51 | 52 | } 53 | return TRUE; 54 | } 55 | 56 | 57 | -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/Misc.cpp: -------------------------------------------------------------------------------- 1 | #include "Misc.h" 2 | 3 | namespace Misc { 4 | 5 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/Misc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "includes.hpp" 3 | #include "game/classes.hpp" 4 | 5 | namespace Misc { 6 | 7 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/aimbot.cpp: -------------------------------------------------------------------------------- 1 | #include "aimbot.h" 2 | 3 | namespace aimbot { 4 | rust::BasePlayer* getBestPlayerByFov() { 5 | rust::BasePlayer* bestEnt = nullptr; 6 | float closest = FLT_MAX; 7 | for (int i = 0; i < variables::player_list.size(); i++) { 8 | auto model = variables::player_list[i]->get_model(); 9 | 10 | if (variables::player_list[i] == variables::local_player) 11 | continue; 12 | if (variables::player_list[i]->get_life_state()) 13 | continue; 14 | if (variables::player_list[i]->is_sleeping()) 15 | continue; 16 | Vector3 headPos = variables::player_list[i]->get_model()->get_position(); 17 | Vector2 head2D; 18 | if (functions::WorldToScreen(headPos, head2D) == false) continue; 19 | float length = sqrt(pow((variables::screen_width / 2) - head2D.x, 2) + pow((variables::screen_height / 2) - head2D.y, 2)); 20 | 21 | 22 | if (length < closest) { 23 | closest = length; 24 | bestEnt = variables::player_list[i]; 25 | } 26 | } 27 | return bestEnt; 28 | } 29 | 30 | int getClosestBoneToCrosshair(rust::BasePlayer* player) { 31 | int bestBone = 0; 32 | float closest = FLT_MAX; 33 | Vector2 curAngles = variables::local_player->get_input()->get_view_angles(); 34 | for (int i = 0; i < rust::valid_bones.size(); i++) { 35 | Vector3 pos3d = variables::player_list[i]->get_model()->get_position(); 36 | Vector2 pos; 37 | if (functions::WorldToScreen(pos3d, pos) == false) continue; 38 | float length = sqrt(pow((variables::screen_width / 2) - pos.x, 2) + pow((variables::screen_height / 2) - pos.y, 2)); 39 | if (length < closest) { 40 | closest = length; 41 | 42 | bestBone = rust::valid_bones[i]; 43 | } 44 | } 45 | return bestBone; 46 | } 47 | 48 | void run(BoneList abone) { 49 | rust::BasePlayer* player = getBestPlayerByFov(); 50 | if (!player) 51 | { 52 | 53 | functions::outline(Vector4(variables::screen_width / 2, variables::screen_height / 2 + 50, 150, 20), xorstr_("Dead"), Vector4(0, 0.5, 1, 1)); 54 | functions::label(Vector4(variables::screen_width / 2, variables::screen_height / 2 + 50, 150, 20), xorstr_("Dead"), Vector4(1, 1, 1, 1)); 55 | } 56 | int bone = getClosestBoneToCrosshair(player); 57 | bone = bone ? bone : BoneList::neck; 58 | 59 | Vector3 enemylock = player->get_bone_position(49); 60 | 61 | variables::local_player->get_input()->set_view_angles(Math::CalcAngle(variables::local_player->get_bone_position(BoneList::neck), enemylock )); 62 | } 63 | 64 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/aimbot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "includes.hpp" 3 | #include "game/classes.hpp" 4 | 5 | namespace aimbot { 6 | rust::BasePlayer* getBestPlayerByFov(); 7 | int getClosestBoneToCrosshair(rust::BasePlayer* player); 8 | void run(BoneList abone); 9 | void silentaim(); 10 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/baseplayer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "hinclude.h" 3 | #include "aimbot.h" 4 | 5 | namespace baseplayer 6 | { 7 | uintptr_t client_input_address; 8 | inline void client_input_hook(rust::BasePlayer* player, uintptr_t state) 9 | { 10 | variables::screen_width = functions::get_screen_width(); 11 | variables::screen_height = functions::get_screen_height(); 12 | variables::camera_list = functions::scan_for_camera_list(); 13 | variables::client_entities = il2cpp::value(xorstr_("BaseNetworkable"), xorstr_("clientEntities"), false); 14 | 15 | functions::ddraw_get(); 16 | 17 | 18 | auto orig_baseplayer_client_input = reinterpret_cast(client_input_address); 19 | SpoofReturn(orig_baseplayer_client_input, player, state); 20 | } 21 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/ddraw.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace ddraw 5 | { 6 | 7 | inline void ongui_hook(void* instance) 8 | { 9 | auto current_event = functions::get_current(); 10 | auto EventType = functions::get_event_type(current_event); 11 | if (EventType != EventType::Repaint) 12 | return; 13 | 14 | } 15 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/esp.cpp: -------------------------------------------------------------------------------- 1 | #include "esp.h" 2 | #include "../rust base/utils/memory.hpp" 3 | #include "../rust base/game/offsets.hpp" 4 | #include 5 | #include "Glob.hpp" 6 | #include "aimbot.h" 7 | 8 | 9 | namespace esp 10 | { 11 | uintptr_t shader; 12 | void do_chams(rust::BasePlayer* player, float vischamr, float vischamg, float vischamb, float nonchamr, float nonchamg, float nonchamb) 13 | { 14 | if(!variables::asset_bundle) 15 | variables::asset_bundle = functions::load_bundle_file("C:\\shitcoder\\assets.saph"); 16 | 17 | auto multiMesh = player->get_model()->get_multimesh(); 18 | auto ourmesh = variables::local_player->get_model()->get_multimesh(); 19 | 20 | if (!multiMesh) 21 | return; 22 | 23 | auto renderers = functions::get2renderers(multiMesh); 24 | auto ourrenders = functions::get2renderers(ourmesh); 25 | 26 | if (!renderers) 27 | return; 28 | 29 | for (int i = 0; i < renderers->get_size(); i++) 30 | { 31 | auto renderer = renderers->get_value(i); 32 | 33 | if (!renderer) 34 | return; 35 | 36 | const auto material = functions::get_material(renderer); 37 | if (!material) 38 | return; 39 | 40 | if (!shader) 41 | shader = functions::load_asset(variables::asset_bundle, "flatshader.shader", il2cpp::type_object("UnityEngine", "Shader")); // there are two flatshader.shader and shader.shader 42 | 43 | if (functions::get_shader(material) == shader) 44 | return; 45 | 46 | functions::set_shader(material, shader); 47 | 48 | 49 | 50 | functions::set_color(material, "ColorBehind", {nonchamr, nonchamg, nonchamb, 60}); 51 | functions::set_color(material, "ColorVisible", { vischamr, vischamg, vischamb, 60}); 52 | } 53 | } 54 | void render_box(rust::BasePlayer* player) { 55 | //for (int i = 0; i < variables::player_list.size(); i++) { 56 | // auto player = variables::player_list[i]; 57 | 58 | if (player == variables::local_player) 59 | return; 60 | 61 | auto bounds = get_bounds(player, 2.f); 62 | float box_width = bounds.right - bounds.left; 63 | float box_height = bounds.bottom - bounds.top; 64 | auto half = (bounds.right - bounds.left) / 2; 65 | Vector2 HeadPos; 66 | Vector2 NeckPos; 67 | Vector2 PelvisPos; 68 | Vector2 LegLPos; 69 | Vector2 LegRPos; 70 | 71 | auto distancea = Math::Calc3D_Dist(variables::local_position, player->get_model()->get_position()); 72 | 73 | if (distancea > 200.0f) 74 | return; 75 | 76 | if (bounds.onscreen) { 77 | float resp, gesp, besp; 78 | resp = 0.0f; 79 | gesp = 1.0f; 80 | besp = 0.2f; 81 | 82 | if (player->get_model()->is_npc()) { 83 | resp = 0.5f; 84 | gesp = 0.2f; 85 | besp = 0.0f; 86 | } 87 | if (player->is_knocked()) { 88 | resp = 1.0f; 89 | gesp = 0.0f; 90 | besp = 0.0f; 91 | } 92 | 93 | if (player->is_sleeping()) { 94 | resp = 0.4f; 95 | gesp = 0.0f; 96 | besp = 1.0f; 97 | } 98 | Vector3 vis = player->get_model()->get_position(); 99 | if (player->is_visible(vis)) { 100 | resp = 0.3f; 101 | gesp = 0.2f; 102 | besp = 0.9f; 103 | } 104 | functions::outline_box({ 105 | bounds.left - 1, 106 | bounds.top - 1 107 | }, { 108 | box_width + 2, 109 | box_height + 2 110 | }, Vector4(resp, gesp, besp, 1), 1); 111 | functions::outline_box({ 112 | bounds.left, 113 | bounds.top 114 | }, { 115 | box_width, 116 | box_height 117 | }, Vector4(1, 1, 1, 1), 1); 118 | 119 | 120 | } 121 | 122 | // functions::set_timescale(12.0f); 123 | 124 | } 125 | void render_name(rust::BasePlayer* player) { 126 | //for (int i = 0; i < variables::player_list.size(); i++) { 127 | // auto player = variables::player_list[i]; 128 | 129 | if (player == variables::local_player) 130 | return; 131 | 132 | auto bounds = get_bounds(player, 2.f); 133 | float box_width = bounds.right - bounds.left; 134 | float box_height = bounds.bottom - bounds.top; 135 | auto half = (bounds.right - bounds.left) / 2; 136 | Vector2 HeadPos; 137 | Vector2 NeckPos; 138 | Vector2 PelvisPos; 139 | Vector2 LegLPos; 140 | Vector2 LegRPos; 141 | 142 | auto distancea = Math::Calc3D_Dist(variables::local_position, player->get_model()->get_position()); 143 | 144 | if (distancea > 200.0f) 145 | return; 146 | 147 | if (bounds.onscreen) { 148 | float resp, gesp, besp; 149 | resp = 0.0f; 150 | gesp = 1.0f; 151 | besp = 0.2f; 152 | 153 | if (player->get_model()->is_npc()) { 154 | resp = 0.5f; 155 | gesp = 0.2f; 156 | besp = 0.0f; 157 | } 158 | if (player->is_knocked()) { 159 | resp = 1.0f; 160 | gesp = 0.0f; 161 | besp = 0.0f; 162 | } 163 | 164 | if (player->is_sleeping()) { 165 | resp = 0.4f; 166 | gesp = 0.0f; 167 | besp = 1.0f; 168 | } 169 | Vector3 vis = player->get_model()->get_position(); 170 | if (player->is_visible(vis)) { 171 | resp = 0.3f; 172 | gesp = 0.2f; 173 | besp = 0.9f; 174 | } 175 | 176 | auto name = player->get_username(); 177 | std::string wcs = functions::ws2s(name); 178 | functions::outline(Vector4{ 179 | bounds.left - 80.f, bounds.bottom + 5, 79.f + half * 2 + 80.f, 13 180 | }, wcs, Vector4(resp, gesp, besp, 1), true, 10); 181 | functions::label(Vector4{ 182 | bounds.left - 80.f, bounds.bottom + 5, 79.f + half * 2 + 80.f, 13 183 | }, wcs, { 184 | 1, 185 | 1, 186 | 1, 187 | 1 188 | }, true, 10); 189 | 190 | 191 | } 192 | 193 | // functions::set_timescale(12.0f); 194 | 195 | } 196 | void render_distance(rust::BasePlayer* player) { 197 | 198 | // for (int i = 0; i < variables::player_list.size(); i++) { 199 | // auto player = variables::player_list[i]; 200 | 201 | //auto Vbase = LI_MODULE(("GameAssembly.dll")).get(); //GetModuleHandleA(xorstr_("GameAssembly.dll")); 202 | 203 | // functions::set_draw_color(Vector4(1, 1, 1, 1)); 204 | 205 | //bool is_npc = false; 206 | // if (model->is_npc()) 207 | // return; 208 | // else 209 | // is_npc = true; 210 | int espas; 211 | 212 | if (player == variables::local_player) 213 | return; 214 | 215 | auto bounds = get_bounds(player, 2.f); 216 | float box_width = bounds.right - bounds.left; 217 | float box_height = bounds.bottom - bounds.top; 218 | auto half = (bounds.right - bounds.left) / 2; 219 | Vector2 HeadPos; 220 | Vector2 NeckPos; 221 | Vector2 PelvisPos; 222 | Vector2 LegLPos; 223 | Vector2 LegRPos; 224 | 225 | auto distancea = Math::Calc3D_Dist(variables::local_position, player->get_model()->get_position()); 226 | 227 | if (distancea > 200.0f) 228 | return; 229 | 230 | if (bounds.onscreen) { 231 | 232 | std::string playerdistance = "[ " + std::to_string(int(distancea)) + "m ]"; 233 | 234 | functions::outline(Vector4{ 235 | bounds.left - 80.f, bounds.bottom + 25, 79.f + half * 2 + 80.f, 13 236 | }, playerdistance, Vector4(0.5, 0, 1.2, 1), true, 10); 237 | functions::label(Vector4{ 238 | bounds.left - 80.f, bounds.bottom + 25, 79.f + half * 2 + 80.f, 13 239 | }, playerdistance, { 240 | 1, 241 | 1, 242 | 1, 243 | 1 244 | }, true, 10); 245 | 246 | } 247 | 248 | 249 | // } 250 | } 251 | void render_Health(rust::BasePlayer* player) { 252 | //for (int i = 0; i < variables::player_list.size(); i++) { 253 | // auto player = variables::player_list[i]; 254 | 255 | //auto Vbase = LI_MODULE(("GameAssembly.dll")).get(); //GetModuleHandleA(xorstr_("GameAssembly.dll")); 256 | 257 | // functions::set_draw_color(Vector4(1, 1, 1, 1)); 258 | 259 | //bool is_npc = false; 260 | // if (model->is_npc()) 261 | // return; 262 | // else 263 | // is_npc = true; 264 | int espas; 265 | 266 | if (player == variables::local_player) 267 | return; 268 | 269 | auto bounds = get_bounds(player, 2.f); 270 | float box_width = bounds.right - bounds.left; 271 | float box_height = bounds.bottom - bounds.top; 272 | auto half = (bounds.right - bounds.left) / 2; 273 | Vector2 HeadPos; 274 | Vector2 NeckPos; 275 | Vector2 PelvisPos; 276 | Vector2 LegLPos; 277 | Vector2 LegRPos; 278 | 279 | auto distancea = Math::Calc3D_Dist(variables::local_position, player->get_model()->get_position()); 280 | 281 | if (distancea > 200.0f) 282 | return; 283 | 284 | if (bounds.onscreen) { 285 | 286 | auto health = Vector4(bounds.left - 4, bounds.top + (box_height - box_height * (player->get_health() / 100)), 5, box_height * (player->get_health() / 100)); 287 | const auto health_bg = Vector4(bounds.left - 5, bounds.top, 7, box_height); 288 | 289 | functions::fill_box(health_bg, Vector4(1, 0, 0, 1)); 290 | 291 | functions::fill_box(health, Vector4(0.2, 0.8, 0, 1)); 292 | } 293 | // } 294 | } 295 | void render_weapon(rust::BasePlayer* player) { 296 | //for (int i = 0; i < variables::player_list.size(); i++) { 297 | // auto player = variables::player_list[i]; 298 | 299 | auto bounds = get_bounds(player, 2.f); 300 | float box_width = bounds.right - bounds.left; 301 | float box_height = bounds.bottom - bounds.top; 302 | auto half = (bounds.right - bounds.left) / 2; 303 | Vector2 HeadPos; 304 | Vector2 NeckPos; 305 | Vector2 PelvisPos; 306 | Vector2 LegLPos; 307 | Vector2 LegRPos; 308 | 309 | auto distancea = Math::Calc3D_Dist(variables::local_position, player->get_model()->get_position()); 310 | 311 | if (distancea > 200.0f) 312 | return; 313 | 314 | if (bounds.onscreen) { 315 | 316 | std::string wName = functions::ws2s(player->get_held_item()->get_name()); 317 | functions::outline(Vector4{ 318 | bounds.left - 80.f, bounds.top - 20, 79.f + half * 2 + 80.f, 13 319 | }, wName, Vector4(0, 0.2, 1, 1), true, 10); 320 | functions::label(Vector4{ 321 | bounds.left - 80.f, bounds.top - 20, 79.f + half * 2 + 80.f, 13 322 | }, wName, { 323 | 1, 324 | 1, 325 | 1, 326 | 1 327 | }, true, 10); 328 | 329 | } 330 | 331 | } 332 | void render_aimbot(rust::BasePlayer* player, BoneList bone) { 333 | //for (int i = 0; i < variables::player_list.size(); i++) { 334 | // auto player = variables::player_list[i]; 335 | 336 | //auto Vbase = LI_MODULE(("GameAssembly.dll")).get(); //GetModuleHandleA(xorstr_("GameAssembly.dll")); 337 | 338 | // functions::set_draw_color(Vector4(1, 1, 1, 1)); 339 | 340 | //bool is_npc = false; 341 | // if (model->is_npc()) 342 | // return; 343 | // else 344 | // is_npc = true; 345 | int espas; 346 | 347 | if (player == variables::local_player) 348 | return; 349 | 350 | //variables::local_player->get_movement()->fun(); 351 | //variables::local_player->get_movement()->spiderman(); 352 | 353 | auto bounds = get_bounds(player, 2.f); 354 | float box_width = bounds.right - bounds.left; 355 | float box_height = bounds.bottom - bounds.top; 356 | auto half = (bounds.right - bounds.left) / 2; 357 | Vector2 HeadPos; 358 | Vector2 NeckPos; 359 | Vector2 PelvisPos; 360 | Vector2 LegLPos; 361 | Vector2 LegRPos; 362 | //aimbot::getClosestBoneToCrosshair(player); 363 | //aimbot::getBestPlayerByFov(); 364 | //aimbot::run(); 365 | auto distancea = Math::Calc3D_Dist(variables::local_position, player->get_model()->get_position()); 366 | 367 | if (distancea > 200.0f) 368 | return; 369 | 370 | if (bounds.onscreen) { 371 | if (functions::get_key(KeyCode::Mouse3)) { 372 | aimbot::run(bone); 373 | espas = 1; 374 | } 375 | else { 376 | espas = 0; 377 | } 378 | 379 | if (espas == 1) { 380 | functions::outline(Vector4(variables::screen_width / 2, variables::screen_height / 2 - 10, 150, 20), xorstr_("Locking on"), Vector4(0, 0.5, 1, 1)); 381 | functions::label(Vector4(variables::screen_width / 2, variables::screen_height / 2 - 10, 150, 20), xorstr_("Locking on"), Vector4(1, 1, 1, 1)); 382 | } 383 | } 384 | } 385 | void SafeAdmin() { variables::local_player->add_flag(4); } 386 | void NoRecoil() { variables::local_player->get_held_item()->Norecoil(0.0f); } 387 | void nosway() { 388 | variables::local_player->get_held_item()->set_aim_cone(-1.0f); 389 | variables::local_player->get_held_item()->set_aim_cone_curve_scale(-1.0f); 390 | variables::local_player->get_held_item()->set_aim_cone_penalty_max(-1.0f); 391 | variables::local_player->get_held_item()->set_aim_cone_penalty_per_shot(-1.0f); 392 | variables::local_player->get_held_item()->set_aim_sway(-1.0f); 393 | variables::local_player->get_held_item()->set_aim_sway_speed(-1.0f); 394 | } 395 | void instaEoka() { 396 | variables::local_player->get_held_item()->set_always_eoka(100.0f); 397 | } 398 | void FullAuto() { variables::local_player->get_held_item()->set_automatic(true); } 399 | void MoonJump() { variables::local_player->get_movement()->fun(); } 400 | void ShootWhileInAir() { variables::local_player->get_movement()->ShootInAir(); } 401 | void WalkOnWalter() { variables::local_player->get_movement()->Water(); } 402 | void ExterndMelee() { variables::local_player->get_held_item()->ExtMelee(); } 403 | void fastbow() { variables::local_player->get_held_item()->instabow(); } 404 | void instacharge() { variables::local_player->get_held_item()->instacharge(); } 405 | void longeye() { variables::local_player->get_eyes()->longeyes(); } 406 | void Dysnic() { 407 | std::string ServerTicks = " [ Ticks Per Second -> " + std::to_string(float(variables::local_player->get_lastSentTick()->TicksPerSec())) + " ]"; 408 | 409 | functions::outline(Vector4(50 + 5, 75, 150, 20), ServerTicks, Vector4(0, 0, 0, 1)); 410 | functions::label(Vector4(50 + 5, 75, 150, 20), ServerTicks, Vector4(1, 1, 1, 1)); 411 | if (functions::get_key(KeyCode::Mouse2)) 412 | { 413 | variables::local_player->get_lastSentTick()->SetTicks(0.99); 414 | 415 | std::string ServerTicks = " [ Ticks Per Second -> " + std::to_string(float(variables::local_player->get_lastSentTick()->TicksPerSec())) + " ]"; 416 | functions::outline(Vector4(variables::screen_width / 2 + 5, variables::screen_height / 2, 150, 20), xorstr_("Dysnic"), Vector4(0, 0, 0, 1)); 417 | functions::label(Vector4(variables::screen_width / 2 + 5, variables::screen_height / 2, 150, 20), xorstr_("Dysnic"), Vector4(1, 1, 1, 1)); 418 | 419 | } 420 | } 421 | 422 | } 423 | 424 | 425 | -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/esp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "includes.hpp" 3 | #include "game/classes.hpp" 4 | 5 | namespace esp 6 | { 7 | void render_aimbot(rust::BasePlayer* player, BoneList bone); 8 | void render_shitaim(rust::BasePlayer* player, BoneList bone); 9 | void ShootWhileInAir(); 10 | void render_weapon(rust::BasePlayer* player); 11 | void render_Health(rust::BasePlayer* player); 12 | void render_distance(rust::BasePlayer* player); 13 | void render_name(rust::BasePlayer* player); 14 | void render_box(rust::BasePlayer* player); 15 | void do_chams(rust::BasePlayer* player, float vischamr, float vischamg, float vischamb, float nonchamr, float nonchamg, float nonchamb); 16 | void SafeAdmin(); 17 | void NoRecoil(); 18 | void nosway(); 19 | void instaEoka(); 20 | void MoonJump(); 21 | void FullAuto(); 22 | void WalkOnWalter(); 23 | void ExterndMelee(); 24 | void fastbow(); 25 | void longeye(); 26 | void Dysnic(); 27 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/game/classes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../includes.hpp" 3 | #include "il2cpp.hpp" 4 | 5 | #define print(a, args) printf("%s(%s:%d) " a, __func__,__FILE__, __LINE__, ##args) 6 | #define println(a, args) print(a "\n", ##args) 7 | #define min(a,b) (((a) < (b)) ? (a) : (b)) 8 | 9 | bool is_valid(uintptr_t variable); 10 | 11 | template 12 | inline T call(const char* func, Args... args); 13 | 14 | struct weapon_data { 15 | float initial_velocity; 16 | float gravity_modifier; 17 | float drag; 18 | float initial_distance; 19 | }; 20 | 21 | enum ammo_types : int32_t { 22 | shotgun = -1685290200, 23 | shotgun_slug = -727717969, 24 | shotgun_fire = -1036635990, 25 | shotgun_handmade = 588596902, 26 | 27 | rifle_556 = -1211166256, 28 | rifle_556_hv = 1712070256, 29 | rifle_556_fire = 605467368, 30 | rifle_556_explosive = -1321651331, 31 | 32 | pistol = 785728077, 33 | pistol_hv = -1691396643, 34 | pistol_fire = 51984655, 35 | 36 | arrow_wooden = -1234735557, 37 | arrow_hv = -1023065463, 38 | arrow_fire = 14241751, 39 | arrow_bone = 215754713, 40 | 41 | nailgun_nails = -2097376851 42 | }; 43 | 44 | enum weapon_types : int32_t { 45 | spear_stone = 1602646136, 46 | spear_wooden = 1540934679 47 | }; 48 | 49 | enum BoneList : int 50 | { 51 | l_hip = 1, 52 | l_knee, 53 | l_foot, 54 | l_toe, 55 | l_ankle_scale, 56 | pelvis, 57 | penis, 58 | GenitalCensor, 59 | GenitalCensor_LOD0, 60 | Inner_LOD0, 61 | GenitalCensor_LOD1, 62 | GenitalCensor_LOD2, 63 | r_hip, 64 | r_knee, 65 | r_foot, 66 | r_toe, 67 | r_ankle_scale, 68 | spine1, 69 | spine1_scale, 70 | spine2, 71 | spine3, 72 | spine4, 73 | l_clavicle, 74 | l_upperarm, 75 | l_forearm, 76 | l_hand, 77 | l_index1, 78 | l_index2, 79 | l_index3, 80 | l_little1, 81 | l_little2, 82 | l_little3, 83 | l_middle1, 84 | l_middle2, 85 | l_middle3, 86 | l_prop, 87 | l_ring1, 88 | l_ring2, 89 | l_ring3, 90 | l_thumb1, 91 | l_thumb2, 92 | l_thumb3, 93 | IKtarget_righthand_min, 94 | IKtarget_righthand_max, 95 | l_ulna, 96 | neck, 97 | head, 98 | jaw, 99 | eyeTranform, 100 | l_eye, 101 | l_Eyelid, 102 | r_eye, 103 | r_Eyelid, 104 | r_clavicle, 105 | r_upperarm, 106 | r_forearm, 107 | r_hand, 108 | r_index1, 109 | r_index2, 110 | r_index3, 111 | r_little1, 112 | r_little2, 113 | r_little3, 114 | r_middle1, 115 | r_middle2, 116 | r_middle3, 117 | r_prop, 118 | r_ring1, 119 | r_ring2, 120 | r_ring3, 121 | r_thumb1, 122 | r_thumb2, 123 | r_thumb3, 124 | IKtarget_lefthand_min, 125 | IKtarget_lefthand_max, 126 | r_ulna, 127 | l_breast, 128 | r_breast, 129 | BoobCensor, 130 | BreastCensor_LOD0, 131 | BreastCensor_LOD1, 132 | BreastCensor_LOD2, 133 | collision, 134 | displacement 135 | }; 136 | 137 | enum class KeyCode 138 | { 139 | Backspace = 8, 140 | Delete = 127, 141 | Tab = 9, 142 | Clear = 12, 143 | Return = 13, 144 | Pause = 19, 145 | Escape = 27, 146 | Space = 32, 147 | Keypad0 = 256, 148 | Keypad1 = 257, 149 | Keypad2 = 258, 150 | Keypad3 = 259, 151 | Keypad4 = 260, 152 | Keypad5 = 261, 153 | Keypad6 = 262, 154 | Keypad7 = 263, 155 | Keypad8 = 264, 156 | Keypad9 = 265, 157 | KeypadPeriod = 266, 158 | KeypadDivide = 267, 159 | KeypadMultiply = 268, 160 | KeypadMinus = 269, 161 | KeypadPlus = 270, 162 | KeypadEnter = 271, 163 | KeypadEquals = 272, 164 | UpArrow = 273, 165 | DownArrow = 274, 166 | RightArrow = 275, 167 | LeftArrow = 276, 168 | Insert = 277, 169 | Home = 278, 170 | End = 279, 171 | PageUp = 280, 172 | PageDown = 281, 173 | F1 = 282, 174 | F2 = 283, 175 | F3 = 284, 176 | F4 = 285, 177 | F5 = 286, 178 | F6 = 287, 179 | F7 = 288, 180 | F8 = 289, 181 | F9 = 290, 182 | F10 = 291, 183 | F11 = 292, 184 | F12 = 293, 185 | F13 = 294, 186 | F14 = 295, 187 | F15 = 296, 188 | Alpha0 = 48, 189 | Alpha1 = 49, 190 | Alpha2 = 50, 191 | Alpha3 = 51, 192 | Alpha4 = 52, 193 | Alpha5 = 53, 194 | Alpha6 = 54, 195 | Alpha7 = 55, 196 | Alpha8 = 56, 197 | Alpha9 = 57, 198 | Exclaim = 33, 199 | DoubleQuote = 34, 200 | Hash = 35, 201 | Dollar = 36, 202 | Percent = 37, 203 | Ampersand = 38, 204 | Quote = 39, 205 | LeftParen = 40, 206 | RightParen = 41, 207 | Asterisk = 42, 208 | Plus = 43, 209 | Comma = 44, 210 | Minus = 45, 211 | Period = 46, 212 | Slash = 47, 213 | Colon = 58, 214 | Semicolon = 59, 215 | Less = 60, 216 | Equals = 61, 217 | Greater = 62, 218 | Question = 63, 219 | At = 64, 220 | LeftBracket = 91, 221 | Backslash = 92, 222 | RightBracket = 93, 223 | Caret = 94, 224 | Underscore = 95, 225 | BackQuote = 96, 226 | A = 97, 227 | B = 98, 228 | C = 99, 229 | D = 100, 230 | E = 101, 231 | F = 102, 232 | G = 103, 233 | H = 104, 234 | I = 105, 235 | J = 106, 236 | K = 107, 237 | L = 108, 238 | M = 109, 239 | N = 110, 240 | O = 111, 241 | P = 112, 242 | Q = 113, 243 | R = 114, 244 | S = 115, 245 | T = 116, 246 | U = 117, 247 | V = 118, 248 | W = 119, 249 | X = 120, 250 | Y = 121, 251 | Z = 122, 252 | LeftCurlyBracket = 123, 253 | Pipe = 124, 254 | RightCurlyBracket = 125, 255 | Tilde = 126, 256 | Numlock = 300, 257 | CapsLock = 301, 258 | ScrollLock = 302, 259 | RightShift = 303, 260 | LeftShift = 304, 261 | RightControl = 305, 262 | LeftControl = 306, 263 | RightAlt = 307, 264 | LeftAlt = 308, 265 | LeftCommand = 310, 266 | LeftApple = 310, 267 | LeftWindows = 311, 268 | RightCommand = 309, 269 | RightApple = 309, 270 | RightWindows = 312, 271 | AltGr = 313, 272 | Help = 315, 273 | Pr = 316, 274 | SysReq = 317, 275 | Break = 318, 276 | Menu = 319, 277 | Mouse0 = 323, 278 | Mouse1 = 324, 279 | Mouse2 = 325, 280 | Mouse3 = 326, 281 | Mouse4 = 327, 282 | Mouse5 = 328, 283 | Mouse6 = 329 284 | }; 285 | 286 | enum class QueryTriggerInteraction 287 | { 288 | // Token: 0x0400005B RID: 91 289 | UseGlobal, 290 | // Token: 0x0400005C RID: 92 291 | Ignore, 292 | // Token: 0x0400005D RID: 93 293 | Collide 294 | }; 295 | 296 | enum class Layers 297 | { 298 | Terrain = 8388608, 299 | World = 65536, 300 | Ragdolls = 512, 301 | Construction = 2097152, 302 | ConstructionSocket = 4194304, 303 | Craters = 1, 304 | GameTrace = 16384, 305 | Trigger = 262144, 306 | VehiclesDetailed = 8192, 307 | RainFall = 1101070337, 308 | Deploy = 1235288065, 309 | DefaultDeployVolumeCheck = 537001984, 310 | BuildLineOfSightCheck = 2097152, 311 | ProjectileLineOfSightCheck = 2162688, 312 | ProjectileLineOfSightCheckTerrain = 10551296, 313 | MeleeLineOfSightCheck = 2162688, 314 | EyeLineOfSightCheck = 2162688, 315 | EntityLineOfSightCheck = 1218519041, 316 | PlayerBuildings = 18874624, 317 | PlannerPlacement = 161546496, 318 | Solid = 1218652417, 319 | VisCulling = 10551297, 320 | AltitudeCheck = 1218511105, 321 | HABGroundEffect = 1218511105, 322 | AILineOfSight = 1218519297, 323 | DismountCheck = 1486946561, 324 | AIPlacement = 278986753, 325 | WheelRay = 1235321089, 326 | }; 327 | 328 | enum class layer : uint32_t { 329 | Default = 0, 330 | TransparentFX = 1, 331 | Ignore_Raycast = 2, 332 | Reserved1 = 3, 333 | Water = 4, 334 | UI = 5, 335 | Reserved2 = 6, 336 | Reserved3 = 7, 337 | Deployed = 8, 338 | Ragdoll = 9, 339 | Invisible = 10, 340 | AI = 11, 341 | PlayerMovement = 12, 342 | Vehicle_Detailed = 13, 343 | Game_Trace = 14, 344 | Vehicle_World = 15, 345 | World = 16, 346 | Player_Server = 17, 347 | Trigger = 18, 348 | Player_Model_Rendering = 19, 349 | Physics_Projectile = 20, 350 | Construction = 21, 351 | Construction_Socket = 22, 352 | Terrain = 23, 353 | Transparent = 24, 354 | Clutter = 25, 355 | Debris = 26, 356 | Vehicle_Large = 27, 357 | Prevent_Movement = 28, 358 | Prevent_Building = 29, 359 | Tree = 30, 360 | Unused2 = 31 361 | }; 362 | 363 | enum class EventType 364 | { 365 | MouseDown = 0, 366 | MouseUp = 1, 367 | MouseMove = 2, 368 | MouseDrag = 3, 369 | KeyDown = 4, 370 | KeyUp = 5, 371 | ScrollWheel = 6, 372 | Repaint = 7, 373 | Layout = 8, 374 | DragUpdated = 9, 375 | DragPerform = 10, 376 | DragExited = 15, 377 | Ignore = 11, 378 | Used = 12, 379 | ValidateCommand = 13, 380 | ExecuteCommand = 14, 381 | ContextClick = 16, 382 | MouseEnterWindow = 20, 383 | MouseLeaveWindow = 21 384 | }; 385 | 386 | enum class MessageType : int // TypeDefIndex: 6667 387 | { 388 | Welcome = 1, 389 | Auth = 2, 390 | Approved = 3, 391 | Ready = 4, 392 | Entities = 5, 393 | EntityDestroy = 6, 394 | GroupChange = 7, 395 | GroupDestroy = 8, 396 | RPCMessage = 9, 397 | EntityPosition = 10, 398 | ConsoleMessage = 11, 399 | ConsoleCommand = 12, 400 | Effect = 13, 401 | DisconnectReason = 14, 402 | Tick = 15, 403 | Message = 16, 404 | RequestUserInformation = 17, 405 | GiveUserInformation = 18, 406 | GroupEnter = 19, 407 | GroupLeave = 20, 408 | VoiceData = 21, 409 | EAC = 22, 410 | EntityFlags = 23, 411 | World = 24, 412 | ConsoleReplicatedVars = 25, 413 | Last = 25 414 | }; 415 | 416 | class BufferList 417 | { 418 | public: 419 | char pad_0000[0x10]; 420 | int32_t size; 421 | char pad_0014[0x4]; 422 | void* buffer; 423 | }; 424 | 425 | class ListDictionary 426 | { 427 | public: 428 | char pad_0000[0x20]; 429 | class BufferList* keys; 430 | class BufferList* vals; 431 | }; 432 | 433 | std::wstring get_name(uintptr_t object); 434 | 435 | template 436 | class laddy_list { 437 | public: 438 | T get(uint32_t idx) 439 | { 440 | const auto internal_list = reinterpret_cast(this + 0x20); 441 | return *reinterpret_cast(internal_list + idx * sizeof(T)); 442 | } 443 | 444 | T get_value(uint32_t idx) 445 | { 446 | const auto list = *reinterpret_cast((uintptr_t)this + 0x10); 447 | const auto internal_list = list + 0x20; 448 | return *reinterpret_cast(internal_list + idx * sizeof(T)); 449 | } 450 | 451 | const uint32_t get_size() { return *reinterpret_cast((uintptr_t)this + 0x18); } 452 | }; 453 | 454 | 455 | namespace functions 456 | { 457 | bool WorldToScreen(const Vector3& EntityPos, Vector2& ScreenPos); 458 | Vector3 WorldToScreenAlt(Vector3 position); 459 | char* memstr(char* haystack, const char* needle, int size); 460 | uintptr_t scan_for_camera_list(); 461 | int strCmp(const char* s1, const char* s2); 462 | size_t my_strlen(const char* str); 463 | bool update_view_matrix(); 464 | Vector3 get_camera_pos(); 465 | Vector3 get_mouse_pos(); 466 | int get_screen_width(); 467 | int get_screen_height(); 468 | std::string ws2s(const std::wstring& wstr); 469 | std::wstring s2ws(const std::string& str); 470 | std::wstring read_unicode(uint64_t address, std::size_t size); 471 | std::string read_ascii(uint64_t address, std::size_t size = 0x50); 472 | const char* read_ascii_alt(uint64_t address); 473 | bool get_key_down(KeyCode key); 474 | bool get_key_up(KeyCode key); 475 | bool get_key(KeyCode key); 476 | void ignore_layer_collision(layer the_layer, layer ignore_layer, bool should_collide); 477 | bool line_of_sight(Vector3 start, Vector3 end, Layers layer_mask, float padding = 0); 478 | bool is_visible(Vector3 start, Vector3 end); 479 | void set_timescale(float value); 480 | float clamp(float value, float min, float max); 481 | float mathf_atan2(float y, float x); 482 | float mathf_abs(float f); 483 | float mathf_max(float a, float b); 484 | void setup_bullet_data(); 485 | laddy_list* get2renderers(uintptr_t multimesh); 486 | uintptr_t get_material(uintptr_t renderer); 487 | uintptr_t get_shader(uintptr_t material); 488 | uintptr_t load_asset(uintptr_t assetbundle, std::string shader, uintptr_t typeobject); 489 | uintptr_t load_bundle_file(std::string data); 490 | uintptr_t find(const char* shader); 491 | void set_shader(uintptr_t material, uintptr_t shader); 492 | void set_color(uintptr_t material, const char* name, Vector4 color); 493 | void set_material_int(uintptr_t material, const char* name, int value); 494 | uintptr_t get_current(); 495 | EventType get_event_type(uintptr_t current); 496 | uintptr_t get_draw_skin(); 497 | uintptr_t get_white_texture(); 498 | uintptr_t get_guicontent_temp(il2cpp::il2cppstring* content); 499 | void set_draw_font_size(uintptr_t label, int size); 500 | void set_draw_color(Vector4 color); 501 | void set_draw_alignment(uintptr_t label, uintptr_t value); 502 | void set_cursor_lockstate(int value); 503 | void create(uintptr_t self, const char* shader); 504 | void dont_destroy_on_load(uintptr_t target); 505 | void add_component(uintptr_t self, uintptr_t componentType); 506 | void draw_texture(Vector4 position, uintptr_t texture); 507 | void outline_box(Vector2 position, Vector2 size, Vector4 color, float girth = 2.f); 508 | void fill_box(Vector4 position, Vector4 color); 509 | void line(Vector2 point1, Vector2 point2, Vector4 color); 510 | void label(Vector4 position, std::string text, Vector4 color, bool centered = false, float font_size = 12); 511 | void outline(Vector4 position, std::string text, Vector4 color, bool centered = false, float font_size = 12); 512 | void ddraw_get(); 513 | float getprojectilevelocityscale(uintptr_t base_projectile, bool max); 514 | uintptr_t CreatePrefab(const char* prefab, bool active = true); 515 | void Destroy(uintptr_t object); 516 | float get_time(); 517 | float get_deltaTime(); 518 | void ddraw_line(Vector3 start, Vector3 end, Vector4 color, float duration = 1.0f, bool distanceFade = true, bool ztest = true); 519 | void ddraw_arrow(Vector3 start, Vector3 end, float size, Vector4 color, float duration = 0.5f); 520 | void ddraw_text(il2cpp::il2cppstring* text, Vector3 pos, Vector4 color, float duration = 0.5f); 521 | void ddraw_screentext(il2cpp::il2cppstring* text, float x, Vector4 color, float duration = 0.5f); 522 | float random_range(float min, float max); 523 | bool physics_checkcapsule(Vector3 start, Vector3 end, float radius, int layer_mask, QueryTriggerInteraction querytriggerinteraction); 524 | } 525 | 526 | class bone_data; 527 | 528 | struct bounds_t { 529 | float left, right, top, bottom; 530 | }; 531 | 532 | namespace rust 533 | { 534 | class HitTest; 535 | 536 | class Transform 537 | { 538 | public: 539 | Vector3 get_position(); 540 | void set_position(Vector3 value); 541 | Vector3 inverse_tranform_point(Vector3 point); 542 | Vector3 transform_direction(Vector3 direction); 543 | }; 544 | 545 | class BaseEntity 546 | { 547 | public: 548 | std::wstring get_name(); 549 | std::string get_prefab_name(); 550 | std::string get_class_name(); 551 | Vector3 get_visual_position(uintptr_t object_class); 552 | void longeyes(); 553 | Vector3 get_closest_point(Vector3 position); 554 | Transform* get_transform(); 555 | void set_hit_direction(Vector3 value); 556 | void server_rpc(const char*); 557 | static void server_rpc(uintptr_t, const char*); 558 | void send_signal_broadcast(int signal, const char* arg = ""); 559 | }; 560 | 561 | class BaseMelee 562 | { 563 | public: 564 | static inline void (*ProcessAttack_)(BaseMelee*, HitTest*) = nullptr; 565 | void ProcessAttack(HitTest* test) 566 | { 567 | return ProcessAttack_(this, test); 568 | } 569 | }; 570 | 571 | class BaseCombatEntity : public BaseEntity 572 | { 573 | public: 574 | float get_health(); 575 | float get_max_health(); 576 | int get_life_state(); 577 | }; 578 | 579 | class RigidBody 580 | { 581 | public: 582 | void set_velocity(Vector3 val); 583 | }; 584 | 585 | class PlayerWalkMovement 586 | { 587 | public: 588 | RigidBody* get_body(); 589 | void set_ground_angle(float angle); 590 | void set_ground_angle_new(float angle); 591 | void set_max_angle_walking(float angle); 592 | void set_max_angle_climbing(float angle); 593 | void set_ground_time(float time); 594 | void set_gravity_multiplier(float multiplier); 595 | void set_jump_time(float time); 596 | void set_land_time(float time); 597 | void set_targetmovement(Vector3); 598 | bool ducking(); 599 | bool swimming(); 600 | bool flying(); 601 | bool spiderman(); 602 | bool fun(); 603 | void ShootInAir(); 604 | void Water(); 605 | 606 | }; 607 | 608 | class PlayerInput 609 | { 610 | public: 611 | Vector2 get_view_angles(); 612 | Vector2 get_recoil_angles(); 613 | void set_view_angles(Vector2 angle); 614 | void set_recoil_angles(Vector2 angle); 615 | }; 616 | 617 | class ItemDefinition : public BaseEntity 618 | { 619 | public: 620 | int get_itemid(); 621 | std::wstring get_shortname(); 622 | 623 | }; 624 | 625 | class BaseProjectile : public BaseEntity 626 | { 627 | public: 628 | class Magazine : public BaseEntity 629 | { 630 | public: 631 | ItemDefinition* get_ammotype(); 632 | }; 633 | 634 | Magazine* get_primaryMagazine(); 635 | }; 636 | 637 | class Item : public BaseEntity 638 | { 639 | public: 640 | int get_amount(); 641 | int get_uid(); 642 | void Fastbow(); 643 | int32_t get_definition_id(); 644 | std::wstring get_name(); 645 | Vector3 get_visual_position(uintptr_t); 646 | bool get_recoil_min_max(); 647 | float get_bullet_velocity(); 648 | float get_bullet_gravity(); 649 | BaseEntity* get_held_entity(); 650 | weapon_data get_weapon_data(); 651 | uintptr_t get_damage_properties(); 652 | float get_repeat_delay(); 653 | void NoahBullets(float); 654 | void set_automatic(bool); 655 | void set_rapid_fire(float); 656 | void set_always_eoka(float); 657 | void set_aim_sway(float); 658 | int ammocount(); 659 | int maxammo(); 660 | void Norecoil(float); 661 | float ReloadTime(); 662 | void set_aim_sway_speed(float); 663 | void set_aim_cone(float); 664 | void set_aim_cone_curve_scale(float); 665 | void set_hip_aim_cone(float); 666 | void set_aim_cone_penalty_max(float); 667 | void set_aim_cone_penalty_per_shot(float); 668 | 669 | void start_attack_cooldown(float); 670 | void process_attack(HitTest*); 671 | void ExtMelee(); 672 | void instabow(); 673 | bool is_melee(); 674 | void instacharge(); 675 | bool is_gun(); 676 | }; 677 | 678 | class ItemContainer 679 | { 680 | public: 681 | Item* get_item(int); 682 | }; 683 | 684 | class PlayerInventory 685 | { 686 | public: 687 | ItemContainer* get_belt(); 688 | }; 689 | 690 | class TeamMember : public BaseEntity 691 | { 692 | public: 693 | long get_uid(); 694 | }; 695 | 696 | class PlayerTeam 697 | { 698 | public: 699 | std::vector get_members(); 700 | }; 701 | 702 | class PlayerModel 703 | { 704 | public: 705 | Vector3 get_position(); //0x218 706 | Vector3 get_velocity(); 707 | uintptr_t get_multimesh(); 708 | bool is_npc(); 709 | void set_velocity(Vector3); 710 | void set_position(Vector3); 711 | }; 712 | 713 | class ModelState 714 | { 715 | public: 716 | void set_onLadder(bool value); 717 | void remove_flag(int flag); 718 | void add_flag(int flag); 719 | bool has_flag(int flag); 720 | }; 721 | 722 | 723 | 724 | class PlayerEyes : public BaseEntity 725 | { 726 | public: 727 | Vector3 get_viewoffset(); 728 | Vector3 get_position(); 729 | Vector3 get_center(); 730 | Vector3 get_bodyforward(); 731 | Vector3 get_bodyright(); 732 | void set_position(Vector3 value); 733 | void set_center(Vector3 value); 734 | void set_body_rotation(Vector4 value); 735 | void set_view_offset(Vector3 value); 736 | }; 737 | 738 | template 739 | class list { 740 | public: 741 | T get(uint32_t idx) 742 | { 743 | const auto internal_list = reinterpret_cast(this + 0x20); 744 | return *reinterpret_cast(internal_list + idx * sizeof(T)); 745 | } 746 | 747 | T get_value(uint32_t idx) 748 | { 749 | const auto list = *reinterpret_cast((uintptr_t)this + 0x10); 750 | const auto internal_list = list + 0x20; 751 | return *reinterpret_cast(internal_list + idx * sizeof(T)); 752 | } 753 | 754 | T operator[](uint32_t idx) { return get(idx); } 755 | 756 | const uint32_t get_size() { return *reinterpret_cast((uintptr_t)this + 0x18); } 757 | 758 | template 759 | void for_each(const F callback) 760 | { 761 | for (auto i = 0; i < get_size(); i++) { 762 | auto object = this->get(i); 763 | if (!object) 764 | continue; 765 | callback(object, i); 766 | } 767 | } 768 | }; 769 | 770 | 771 | class Attack 772 | { 773 | public: 774 | Vector3 get_point_start(); 775 | Vector3 get_point_end(); 776 | int get_hit_id(); 777 | int get_hit_bone(); 778 | Vector3 get_hit_normal_local(); 779 | Vector3 get_hit_position_local(); 780 | Vector3 get_hit_normal_world(); 781 | Vector3 get_hit_position_world(); 782 | int get_hit_part_id(); 783 | int get_hit_material_id(); 784 | int get_hit_item(); 785 | }; 786 | 787 | class PlayerAttack 788 | { 789 | public: 790 | Attack* get_attack(); 791 | int get_projectile_id(); 792 | }; 793 | 794 | class PlayerProjectileAttack 795 | { 796 | public: 797 | PlayerAttack* get_player_attack(); 798 | Vector3 get_hit_velocity(); 799 | float get_hit_distance(); 800 | float get_travel_time(); 801 | }; 802 | 803 | class PlayerTick 804 | { 805 | public: 806 | Vector3 get_position(); 807 | void SetTicks(float ticks); 808 | float TicksPerSec(); 809 | }; 810 | 811 | class BasePlayer : public BaseCombatEntity 812 | { 813 | public: 814 | std::wstring get_username(); 815 | long get_uid(); 816 | int get_active_weapon_id(); 817 | PlayerWalkMovement* get_movement(); 818 | PlayerInput* get_input(); 819 | PlayerInventory* get_inventory(); 820 | PlayerTeam* get_team(); 821 | PlayerModel* get_model(); 822 | ModelState* get_modelstate(); 823 | PlayerEyes* get_eyes(); 824 | PlayerTick* get_lastSentTick(); 825 | Item* get_held_item(); 826 | bool is_same_team(BasePlayer* local_player); 827 | bool is_knocked(); 828 | bool is_sleeping(); 829 | void longeye(); 830 | bool is_local_player(); 831 | bool is_visible(Vector3 end); 832 | Vector3 get_bone_position(int bone); 833 | Transform* get_bone_transform(int bone); 834 | bone_data get_bone_data(int bone); 835 | static uintptr_t visiblePlayerList(); 836 | void add_flag(int flag); 837 | void invite_to_team(BasePlayer* player); 838 | float get_radius(); 839 | float get_height(bool ducked); 840 | float get_jumpheight(); 841 | uintptr_t object; 842 | }; 843 | 844 | inline std::array valid_bones = { 845 | 1, 2, 3, 5, 6, 14, 15, 17, 18, 21, 23, 24, 25, 26, 27, 48, 55, 56, 57, 76 846 | }; 847 | struct box_bounds { 848 | float left, right, top, bottom; 849 | bool onscreen = false; 850 | 851 | bool empty() { 852 | if (this->left == 0 && this->right == 0 && this->top == 0 && this->bottom == 0) 853 | return true; 854 | 855 | if (this->left == FLT_MAX || this->right == FLT_MIN || this->top == FLT_MAX || this->bottom == FLT_MIN) 856 | return true; 857 | 858 | return false; 859 | } 860 | static box_bounds null() { 861 | return { 0, 0, 0, 0 }; 862 | } 863 | }; 864 | 865 | inline box_bounds get_bounds(rust::BasePlayer* player, float expand = 0) { 866 | box_bounds ret = { FLT_MAX, FLT_MIN, FLT_MAX, FLT_MIN }; 867 | 868 | for (auto j : valid_bones) { 869 | auto transform = player->get_bone_transform(j); 870 | if (transform) { 871 | Vector2 sc; 872 | auto world_pos = transform->get_position(); 873 | 874 | if (j == 48) 875 | world_pos.y += 0.2f; 876 | 877 | if (functions::WorldToScreen(world_pos, sc)) { 878 | Vector2 bone_screen = sc; 879 | 880 | if (bone_screen.x < ret.left) 881 | ret.left = bone_screen.x; 882 | if (bone_screen.x > ret.right) 883 | ret.right = bone_screen.x; 884 | if (bone_screen.y < ret.top) 885 | ret.top = bone_screen.y; 886 | if (bone_screen.y > ret.bottom) 887 | ret.bottom = bone_screen.y; 888 | ret.onscreen = true; 889 | } 890 | } 891 | } 892 | 893 | if (ret.left == FLT_MAX) 894 | return box_bounds::null(); 895 | if (ret.right == FLT_MIN) 896 | return box_bounds::null(); 897 | if (ret.top == FLT_MAX) 898 | return box_bounds::null(); 899 | if (ret.bottom == FLT_MIN) 900 | return box_bounds::null(); 901 | 902 | ret.left -= expand; 903 | ret.right += expand; 904 | ret.top -= expand; 905 | ret.bottom += expand; 906 | 907 | return ret; 908 | }; 909 | 910 | class LocalPlayer : BasePlayer { 911 | public: 912 | static BasePlayer* Entity(); 913 | static void ConsoleMessage(const char* message); 914 | }; 915 | 916 | class ItemModProjectile 917 | { 918 | public: 919 | void set_projectile_spread(float value); 920 | void set_projectile_velocity_spread(float value); 921 | }; 922 | 923 | class Projectile : public BaseEntity 924 | { 925 | public: 926 | float get_thickness(); 927 | float get_integrity(); 928 | float get_traveled_distance(); 929 | float get_max_distance(); 930 | //float get_partial_time(); 931 | float get_traveled_time(); 932 | float get_move_delta_time(); 933 | float get_gravity_modifier(); 934 | float get_drag(); 935 | BasePlayer* get_owner(); 936 | ItemModProjectile* get_item_mod_projectile(); 937 | Vector3 get_initial_velocity(); 938 | Vector3 get_current_position(); 939 | Vector3 get_current_velocity(); 940 | bool is_alive(); 941 | void set_thickness(float value); 942 | void set_current_velocity(Vector3); 943 | }; 944 | 945 | struct Ray { 946 | Vector3 origin; 947 | Vector3 dir; 948 | Ray(Vector3 o, Vector3 d) { 949 | origin = o; 950 | dir = d; 951 | } 952 | }; 953 | 954 | class HitTest 955 | { 956 | public: 957 | BaseEntity* get_hit_entity(); 958 | Vector3 get_hit_normal(); 959 | void set_hit_entity(BaseEntity* entity); 960 | void set_hit_transform(Transform* transform); 961 | void set_hit_hitpoint(Vector3 hit_point); 962 | void set_hit_distance(float distance); 963 | void set_max_distance(float distance); 964 | void set_did_hit(bool didhit); 965 | void set_damage_properties(uintptr_t properties); 966 | void set_attack_ray(Ray); 967 | void set_hit_normal(Vector3); 968 | }; 969 | 970 | class HitInfo 971 | { 972 | public: 973 | BaseEntity* get_initiator(); 974 | BaseEntity* get_hit_entity(); 975 | int get_hit_bone(); 976 | Vector3 get_hit_start(); 977 | Vector3 get_hit_end(); 978 | Vector3 get_hit_position_world(); 979 | Vector3 get_hit_position_local(); 980 | Vector3 get_hit_velocity(); 981 | float get_hit_distance(); 982 | 983 | }; 984 | 985 | class BuildingBlock 986 | { 987 | public: 988 | bool can_afford(int grade, BasePlayer* player); 989 | bool can_upgrade(int grade, BasePlayer* player); 990 | void upgrade(int grade, BasePlayer* player); 991 | }; 992 | 993 | class TOD_NightParameters 994 | { 995 | public: 996 | void set_light_intensity(float intensity); 997 | void set_reflection_multiplier(float multiplier); 998 | void set_ambient_multiplier(float multiplier); 999 | }; 1000 | 1001 | class TOD_DayParameters 1002 | { 1003 | public: 1004 | void set_ambient_multiplier(float multiplier); 1005 | }; 1006 | 1007 | class TOD_Sky 1008 | { 1009 | public: 1010 | static TOD_Sky* get_instance(); 1011 | TOD_NightParameters* get_night(); 1012 | TOD_DayParameters* get_day(); 1013 | }; 1014 | 1015 | class DownloadHandler 1016 | { 1017 | public: 1018 | il2cpp::il2cppstring* GetText(); 1019 | }; 1020 | 1021 | class UnityWebRequest 1022 | { 1023 | public: 1024 | static UnityWebRequest* Get(il2cpp::il2cppstring* string); 1025 | uintptr_t SendWebRequest(); 1026 | DownloadHandler* GetDownloadHandler(); 1027 | long GetResponseCode(); 1028 | }; 1029 | } 1030 | 1031 | class bone_data 1032 | { 1033 | public: 1034 | int index; 1035 | Vector3 position; 1036 | rust::Transform* transform; 1037 | bool is_visible; 1038 | 1039 | bone_data() 1040 | { 1041 | this->index = 0; 1042 | this->position = Vector3(); 1043 | this->is_visible = false; 1044 | this->transform = nullptr; 1045 | } 1046 | 1047 | bone_data(int index, Vector3 position, bool visible, rust::Transform* trans) 1048 | { 1049 | this->index = index; 1050 | this->position = position; 1051 | this->is_visible = visible; 1052 | this->transform = trans; 1053 | } 1054 | 1055 | bool check_is_visible(Vector3 from) 1056 | { 1057 | return functions::is_visible(this->position, from); 1058 | } 1059 | }; 1060 | 1061 | class player_data 1062 | { 1063 | public: 1064 | int player_uid; 1065 | uintptr_t object; 1066 | rust::BasePlayer* player; 1067 | std::vector bones; 1068 | bool is_visible; 1069 | 1070 | player_data(int uid, uintptr_t object, rust::BasePlayer* player, std::vector bones, bool is_visible) 1071 | { 1072 | this->player_uid = uid; 1073 | this->object = object; 1074 | this->player = player; 1075 | this->bones = bones; 1076 | this->is_visible = is_visible; 1077 | } 1078 | 1079 | bool operator==(player_data pd) 1080 | { 1081 | if (pd.player_uid == this->player_uid) 1082 | return true; 1083 | else 1084 | return false; 1085 | } 1086 | 1087 | bool operator==(int uid) 1088 | { 1089 | if (uid == this->player_uid) 1090 | return true; 1091 | else 1092 | return false; 1093 | } 1094 | }; 1095 | 1096 | class explosion_data 1097 | { 1098 | public: 1099 | std::chrono::steady_clock::time_point start; 1100 | rust::BaseEntity* entity; 1101 | Vector3 position; 1102 | std::string class_name; 1103 | std::string prefab_name; 1104 | }; 1105 | 1106 | namespace variables 1107 | { 1108 | extern uintptr_t asset_bundle; 1109 | extern rust::BasePlayer* local_player; 1110 | extern Vector3 local_position; 1111 | extern Matrix4x4 view_matrix; 1112 | extern int screen_width; 1113 | extern int screen_height; 1114 | extern int image_width; 1115 | extern int image_height; 1116 | //extern ID3D11ShaderResourceView* resource_view; 1117 | //extern ImDrawList* draw_list; 1118 | //extern ImFont* smallest_pixel_7_font; 1119 | //extern std::vector player_data; 1120 | //extern std::vector explosion_data; 1121 | extern Vector2 mouse_position; 1122 | extern Vector2 mouse_position_backup; 1123 | extern bool loaded; 1124 | extern uintptr_t draw_label; 1125 | extern uintptr_t white_texture; 1126 | extern uintptr_t camera_list; 1127 | extern uintptr_t client_entities; 1128 | extern uintptr_t debug_camera_address; 1129 | extern uintptr_t todSky; 1130 | extern std::vector player_list; 1131 | extern float fly_hack_vert; 1132 | extern float fly_hack_vert_max; 1133 | extern float fly_hack_hori; 1134 | extern float fly_hack_hori_max; 1135 | //extern chaiscript::ChaiScript chai; 1136 | //extern ImFont* smallestpixel7; 1137 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/game/hooks.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../hinclude.h" 3 | #include "../performanceui.h" 4 | #include "../ddraw.h" 5 | #include "../baseplayer.h" 6 | 7 | namespace hooks 8 | { 9 | uintptr_t fixcullingorig; 10 | void fixculling(rust::BasePlayer* baseplayer, float dist, bool visibility = false) 11 | { 12 | auto orig_fixculling = reinterpret_cast(fixcullingorig); 13 | //if (chams) 14 | return SpoofReturn(orig_fixculling, baseplayer, 300.f, true); 15 | 16 | //return SpoofReturn(orig_fixculling, baseplayer, dist, visibility); 17 | } 18 | 19 | __forceinline bool init() 20 | { 21 | PerformanceUI::performaceui_hook = *reinterpret_cast(il2cpp::method(xorstr_("PerformanceUI"), xorstr_("Update"), 0, xorstr_("Facepunch"))); 22 | il2cpp::hook(&PerformanceUI::hk_performance_ui_update, xorstr_("PerformanceUI"), xorstr_("Update"), 0, xorstr_("Facepunch")); 23 | il2cpp::hook(&PerformanceUI::ongui_hook, xorstr_("DevControls"), xorstr_("OnGUI"), 0, xorstr_("")); 24 | il2cpp::hook(&ddraw::ongui_hook, xorstr_("DDraw"), xorstr_("OnGUI"), 0, xorstr_("UnityEngine")); 25 | fixcullingorig = il2cpp::hook_virtual_function(xorstr_("BasePlayer"), xorstr_("VisUpdateUsingCulling"), &fixculling, 2); 26 | baseplayer::client_input_address = il2cpp::hook_virtual_function(xorstr_("BasePlayer"), xorstr_("ClientInput"), &baseplayer::client_input_hook, 1); 27 | 28 | return true; 29 | } 30 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/game/il2cpp.cpp: -------------------------------------------------------------------------------- 1 | #include "il2cpp.hpp" 2 | #include 3 | 4 | std::map klasses; 5 | std::map method_list; 6 | std::map field_list; 7 | 8 | uintptr_t il2cpp::get_module_base(const char* Name) 9 | { 10 | return NULL;//LI_MODULE(Name).get(); 11 | } 12 | 13 | void il2cpp::init() 14 | { 15 | MUTATE_START 16 | using il2cpp_domain_get = uintptr_t(*)(); 17 | methods::domain_get = LI_FIND_DEF(il2cpp_domain_get); 18 | 19 | using il2cpp_class_get_methods = uintptr_t(*)(uintptr_t, uintptr_t*); 20 | methods::class_get_methods = LI_FIND_DEF(il2cpp_class_get_methods); 21 | 22 | using il2cpp_method_get_param = uintptr_t(*)(uintptr_t, int); 23 | methods::method_get_param = LI_FIND_DEF(il2cpp_method_get_param); 24 | 25 | using il2cpp_method_get_param_count = int (*)(uintptr_t); 26 | methods::method_get_param_count = LI_FIND_DEF(il2cpp_method_get_param_count); 27 | 28 | using il2cpp_assembly_get_image = uintptr_t(*)(uintptr_t); 29 | methods::assembly_get_image = LI_FIND_DEF(il2cpp_assembly_get_image); 30 | 31 | using il2cpp_domain_get_assemblies = uintptr_t * (*)(void* domain, uintptr_t* size); 32 | methods::domain_get_assemblies = LI_FIND_DEF(il2cpp_domain_get_assemblies); 33 | 34 | using il2cpp_class_from_name = uintptr_t(*)(uintptr_t, const char*, const char*); 35 | methods::class_from_name = LI_FIND_DEF(il2cpp_class_from_name); 36 | 37 | using il2cpp_resolve_icall = uintptr_t(*)(const char*); 38 | methods::resolve_icall = LI_FIND_DEF(il2cpp_resolve_icall); 39 | 40 | using il2cpp_class_get_field_from_name = uintptr_t(*)(uintptr_t, const char*); 41 | methods::class_get_field_from_name = LI_FIND_DEF(il2cpp_class_get_field_from_name); 42 | 43 | using il2cpp_field_static_get_value = uintptr_t(*)(uintptr_t, uintptr_t*); 44 | methods::field_static_get_value = LI_FIND_DEF(il2cpp_field_static_get_value); 45 | 46 | using il2cpp_class_get_fields = uintptr_t(*)(uintptr_t, uintptr_t*); 47 | methods::class_get_fields = LI_FIND_DEF(il2cpp_class_get_fields); 48 | 49 | using il2cpp_field_get_offset = uintptr_t(*)(uintptr_t); 50 | methods::field_get_offset = LI_FIND_DEF(il2cpp_field_get_offset); 51 | 52 | using il2cpp_object_new = uintptr_t(*)(uintptr_t); 53 | methods::object_new = LI_FIND_DEF(il2cpp_object_new); 54 | 55 | using il2cpp_type_get_object = uintptr_t(*)(uintptr_t); 56 | methods::type_get_object = LI_FIND_DEF(il2cpp_type_get_object); 57 | 58 | using il2cpp_class_get_type = uintptr_t(*)(uintptr_t); 59 | methods::class_get_type = LI_FIND_DEF(il2cpp_class_get_type); 60 | 61 | using il2cpp_runtime_class_init = uintptr_t(*)(uintptr_t); 62 | methods::runtime_class_init = LI_FIND_DEF(il2cpp_runtime_class_init); 63 | 64 | using il2cpp_string_new_wrapper = il2cppstring * (*)(const char*); 65 | methods::new_string = LI_FIND_DEF(il2cpp_string_new_wrapper); 66 | MUTATE_END 67 | } 68 | 69 | uintptr_t il2cpp::init_class(const char* name, const char* name_space) 70 | { 71 | uintptr_t domain = methods::domain_get(); 72 | 73 | if (!domain) 74 | { 75 | return NULL; 76 | } 77 | 78 | uintptr_t nrofassemblies; 79 | uintptr_t* assemblies; 80 | assemblies = methods::domain_get_assemblies((void*)domain, &nrofassemblies); 81 | 82 | for (int i = 0; i < nrofassemblies; i++) 83 | { 84 | uintptr_t img = methods::assembly_get_image(assemblies[i]); 85 | 86 | uintptr_t kl = methods::class_from_name(img, name_space, name); 87 | if (!kl) 88 | continue; 89 | 90 | return kl; 91 | } 92 | 93 | return NULL; 94 | } 95 | 96 | uintptr_t il2cpp::type_object(const char* name_space, const char* name) 97 | { 98 | auto klass = il2cpp::init_class(name, name_space); 99 | return il2cpp::methods::type_get_object(il2cpp::methods::class_get_type(klass)); 100 | } 101 | 102 | int il2cpp::m_strcmp(const char* s1, const char* s2) 103 | { 104 | while (*s1 && (*s1 == *s2)) 105 | { 106 | s1++; 107 | s2++; 108 | } 109 | return *(const unsigned char*)s1 - *(const unsigned char*)s2; 110 | } 111 | 112 | uintptr_t il2cpp::method_alt(const char* kl, const char* name, int argument_number, const char* arg_name, const char* name_space, int selected_argument) { 113 | uintptr_t iter = 0; 114 | uintptr_t f; 115 | auto klass = init_class(kl, name_space); 116 | 117 | while (f = methods::class_get_methods(klass, &iter)) { 118 | 119 | char* st = *reinterpret_cast(f + 0x10); 120 | 121 | if (m_strcmp(st, (char*)name)) { 122 | if (selected_argument >= 0 && arg_name) { 123 | uintptr_t args = *reinterpret_cast(f + 0x28); 124 | int method_count = methods::method_get_param_count(f); 125 | if (selected_argument > method_count || (argument_number >= 0 && method_count != argument_number)) continue; 126 | 127 | char* argname; 128 | if (method_count > 0) { 129 | argname = *reinterpret_cast(args + (selected_argument - 1) * 0x18); 130 | } 131 | else 132 | argname = (char*)("-"); 133 | 134 | if (!argname || !m_strcmp(argname, arg_name)) continue; 135 | } 136 | 137 | return f; 138 | } 139 | } 140 | return 0; 141 | } 142 | 143 | uintptr_t il2cpp::method(std::string kl, std::string name, int param_count, const char* name_space, bool param_check, int param_idx, std::string param_name) 144 | { 145 | uintptr_t klass = init_class(kl.c_str(), name_space); 146 | if (!klass) 147 | { 148 | std::cout << "[Debug] Failed to init class in il2cpp::method: " << name_space << "::" << kl << std::endl; 149 | return NULL; 150 | } 151 | if (!param_check) 152 | { 153 | uintptr_t method = methods::class_get_method_from_name(klass, name.c_str(), param_count); 154 | return method; 155 | } 156 | else 157 | { 158 | uintptr_t nrofmethods; 159 | uintptr_t methods; 160 | methods = methods::class_get_methods(klass, &nrofmethods); 161 | while (methods = methods::class_get_methods(klass, &nrofmethods)) 162 | { 163 | char* method_name = *reinterpret_cast(methods + 0x10); 164 | //std::cout << "Method Name: " << method_name << std::endl; 165 | if (std::string(method_name) == name) 166 | { 167 | uintptr_t args = *reinterpret_cast(methods + 0x28); 168 | char* arg_name = *reinterpret_cast(args + 1 * 0x18); 169 | //printf("[%s] %s", name, std::string(arg_name)); 170 | } 171 | } 172 | } 173 | } 174 | 175 | uintptr_t il2cpp::hook(void* our_func, std::string kl, std::string name, int arg, const char* name_space) 176 | { 177 | auto il2cpp_method = method(kl.c_str(), name.c_str(), arg, name_space); 178 | *reinterpret_cast(il2cpp_method) = our_func; 179 | 180 | void* written = *reinterpret_cast(il2cpp_method); 181 | if (written == our_func) 182 | { 183 | std::cout << "[Debug] Hooked " << kl << " successfully" << std::endl; 184 | } 185 | 186 | return il2cpp_method; 187 | } 188 | 189 | uintptr_t il2cpp::hook_virtual_function(const char* classname, const char* function_to_hook, void* our_func, int param_count, const char* name_space) 190 | { 191 | auto method = il2cpp::method(classname, function_to_hook, param_count, name_space); 192 | if (!method) 193 | { 194 | std::cout << "[Debug] Error getting method! Failed to hook " << name_space << "::" << classname << "::" << function_to_hook << std::endl; 195 | return NULL; 196 | } 197 | uintptr_t search = *reinterpret_cast(method); 198 | uintptr_t table = il2cpp::init_class(classname, name_space); 199 | 200 | if (search == (uintptr_t)our_func) 201 | { 202 | std::cout << "[Debug] Already hooked " << name_space << "::" << classname << "::" << function_to_hook << std::endl; 203 | return (uintptr_t)our_func; 204 | } 205 | 206 | for (uintptr_t i = table; i <= table + 0x10000; i += 0x1) { 207 | uintptr_t addr = *reinterpret_cast(i); 208 | if (addr == search) 209 | { 210 | std::cout << "[Debug] Hooking " << name_space << "::" << classname << "::" << function_to_hook << " at address: 0x" << std::hex << addr << std::dec << std::endl; 211 | *reinterpret_cast(i) = (uintptr_t)our_func; 212 | return addr; 213 | } 214 | } 215 | 216 | std::cout << "[Debug] Failed to hook " << name_space << "::" << classname << "::" << function_to_hook << std::endl; 217 | } 218 | 219 | uintptr_t il2cpp::field(uintptr_t klass, const char* name) 220 | { 221 | return methods::class_get_field_from_name(klass, name); 222 | } 223 | 224 | uintptr_t il2cpp::value(const char* kl, const char* name, bool get_offset, const char* name_space) 225 | { 226 | uintptr_t klass = il2cpp::init_class(kl, name_space); 227 | 228 | if (!klass) 229 | return NULL; 230 | 231 | auto field = il2cpp::field(klass, name); 232 | if (get_offset) 233 | { 234 | uintptr_t out = 0; 235 | uintptr_t il2cpp_field; 236 | uintptr_t field_offset = NULL; 237 | 238 | while (il2cpp_field = methods::class_get_fields(klass, &out)) 239 | { 240 | char* char_name = (char*)*reinterpret_cast(il2cpp_field); 241 | if (!char_name) 242 | continue; 243 | 244 | uintptr_t offset = methods::field_get_offset(il2cpp_field); 245 | std::string field_name = std::string(char_name); 246 | if (name == field_name) 247 | { 248 | field_offset = offset; 249 | break; 250 | } 251 | } 252 | return field_offset; 253 | } 254 | 255 | uintptr_t static_value; 256 | methods::field_static_get_value(field, &static_value); 257 | if (static_value) 258 | return static_value; 259 | 260 | return NULL; 261 | } 262 | 263 | void il2cpp::appendLineToFile(std::string filepath, std::string line) 264 | { 265 | std::ofstream file; 266 | //can't enable exception now because of gcc bug that raises ios_base::failure with useless message 267 | //file.exceptions(file.exceptions() | std::ios::failbit); 268 | file.open(filepath, std::ios::out | std::ios::app); 269 | 270 | //make sure write fails with exception if something is wrong 271 | file.exceptions(file.exceptions() | std::ios::failbit | std::ifstream::badbit); 272 | 273 | file << line << std::endl; 274 | } 275 | 276 | //template 277 | //std::string n2hexstr(I w, size_t hex_len = sizeof(I) << 1) { 278 | // static const char* digits = xorstr_("0123456789ABCDEF"); 279 | // std::string rc(hex_len, xorstr_("0")); 280 | // for (size_t i = 0, j = (hex_len - 1) * 4; i < hex_len; ++i, j -= 4) 281 | // rc[i] = digits[(w >> j) & 0x0f]; 282 | // return rc; 283 | //} 284 | 285 | void il2cpp::dump_class_offsets(std::string class_to_dump, const char* name_space) 286 | { 287 | auto klass = init_class(class_to_dump.c_str()); 288 | 289 | uintptr_t out = 0; 290 | uintptr_t iter = 0; 291 | uintptr_t il2cpp_field; 292 | uintptr_t il2cpp_method; 293 | //appendLineToFile("Dump.hpp", " namespace " + class_to_dump + "\n {"); 294 | std::string appendme; 295 | while (il2cpp_field = methods::class_get_fields(klass, &out)) 296 | { 297 | char* char_name = (char*)*reinterpret_cast(il2cpp_field); 298 | if (!char_name) 299 | continue; 300 | 301 | uintptr_t offset = methods::field_get_offset(il2cpp_field); 302 | std::string name = std::string(char_name); 303 | std::string name_backup = name; 304 | //std::string offset_string = n2hexstr(offset); 305 | //name = std::regex_replace(name, std::regex("<"), ""); 306 | //name = std::regex_replace(name, std::regex(">"), ""); 307 | //if (name.find(xorstr_("__BackingField")) != std::string::npos) 308 | if (true) 309 | { 310 | //appendme += " const uint32_t " + name + " = 0x" + offset_string + "; //" + name_backup + "\n"; 311 | } 312 | else 313 | { 314 | //appendme += " const uint32_t " + name + " = 0x" + offset_string + ";\n"; 315 | } 316 | //printf("[%s] Field %s: 0x%x\n", class_to_dump.c_str(), name, offset); 317 | } 318 | //appendLineToFile("Dump.hpp", appendme); 319 | //appendLineToFile("Dump.hpp", " };\n"); 320 | return; 321 | } 322 | 323 | void il2cpp::list_virtual_functions(const char* kl, const char* name_space) 324 | { 325 | uintptr_t table = il2cpp::init_class(kl, name_space); 326 | 327 | for (uintptr_t i = table; i <= table + 0x10000; i += 0x1) { 328 | uintptr_t addr = *reinterpret_cast(i); 329 | 330 | } 331 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/game/il2cpp.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../includes.hpp" 3 | #include "../utils/lazy_importer.hpp" 4 | 5 | #define STR_MERGE_IMPL(a, b) a##b 6 | #define STR_MERGE(a, b) STR_MERGE_IMPL(a, b) 7 | #define MAKE_PAD(size) STR_MERGE(_pad, __COUNTER__)[size] 8 | #define DEFINE_MEMBER_N(type, name, offset) struct {unsigned char MAKE_PAD(offset); type name;} 9 | #define min(a,b) (((a) < (b)) ? (a) : (b)) 10 | #define max(a,b) (((a) > (b)) ? (a) : (b)) 11 | 12 | namespace il2cpp 13 | { 14 | 15 | 16 | void init(); 17 | uintptr_t init_class(const char* name, const char* name_space = ("")); 18 | int m_strcmp(const char* s1, const char* s2); 19 | uintptr_t method(std::string kl, std::string name, int param_count, const char* name_space = (""), bool param_check = false, int param_idx = 0, std::string param_name = ""); 20 | uintptr_t method_alt(const char* kl, const char* name, int argument_number = -1, const char* arg_name = "", const char* name_space = (""), int selected_argument = -1); 21 | uintptr_t hook(void* our_func, std::string kl, std::string name, int arg, const char* name_space = ("")); 22 | uintptr_t hook_virtual_function(const char* classname, const char* function_to_hook, void* our_func, int param_count, const char* name_space = ("")); 23 | uintptr_t field(uintptr_t klass, const char* field_name); 24 | uintptr_t value(const char* kl, const char* name, bool get_offset = true, const char* name_space = ("")); 25 | void appendLineToFile(std::string filepath, std::string line); 26 | void dump_class_offsets(std::string k1, const char* name_space = ("")); 27 | ULONG64 get_module_base(const char* Name = xorstr_("GameAssembly.dll")); 28 | void list_virtual_functions(const char* kl, const char* name_space = ("")); 29 | uintptr_t type_object(const char* name_space, const char* name); 30 | 31 | class il2cppstring 32 | { 33 | public: 34 | char pad_0000[0x10]; 35 | int len; 36 | wchar_t buffer[0]; 37 | 38 | static il2cppstring* New(const char* str); 39 | }; 40 | 41 | namespace methods 42 | { 43 | using il2cpp_domain_get = uintptr_t(*)(); 44 | static il2cpp_domain_get domain_get = LI_FIND_DEF(il2cpp_domain_get);//LI_FIND_DEF(il2cpp_domain_get); 45 | 46 | using il2cpp_class_get_methods = uintptr_t(*)(uintptr_t, uintptr_t*); 47 | static auto class_get_methods = LI_FIND_DEF(il2cpp_class_get_methods); 48 | 49 | using il2cpp_method_get_param = uintptr_t(*)(uintptr_t, int); 50 | static auto method_get_param = LI_FIND_DEF(il2cpp_method_get_param); 51 | 52 | using il2cpp_method_get_param_count = int (*)(uintptr_t); 53 | static auto method_get_param_count = LI_FIND_DEF(il2cpp_method_get_param_count); 54 | 55 | using il2cpp_assembly_get_image = uintptr_t(*)(uintptr_t); 56 | static auto assembly_get_image = LI_FIND_DEF(il2cpp_assembly_get_image); 57 | 58 | using il2cpp_domain_get_assemblies = uintptr_t * (*)(void* domain, uintptr_t* size); 59 | static auto domain_get_assemblies = LI_FIND_DEF(il2cpp_domain_get_assemblies); 60 | 61 | using il2cpp_object_new = uintptr_t(*)(uintptr_t); 62 | static auto object_new = LI_FIND_DEF(il2cpp_object_new); 63 | 64 | using il2cpp_type_get_object = uintptr_t(*)(uintptr_t); 65 | static auto type_get_object = LI_FIND_DEF(il2cpp_type_get_object); 66 | 67 | using il2cpp_class_get_type = uintptr_t(*)(uintptr_t); 68 | static auto class_get_type = LI_FIND_DEF(il2cpp_class_get_type); 69 | 70 | using il2cpp_class_from_name = uintptr_t(*)(uintptr_t, const char*, const char*); 71 | static auto class_from_name = LI_FIND_DEF(il2cpp_class_from_name); 72 | 73 | using il2cpp_resolve_icall = uintptr_t(*)(const char*); 74 | static auto resolve_icall = LI_FIND_DEF(il2cpp_resolve_icall); 75 | 76 | using il2cpp_class_get_field_from_name = uintptr_t(*)(uintptr_t, const char*); 77 | static auto class_get_field_from_name = LI_FIND_DEF(il2cpp_class_get_field_from_name); 78 | 79 | using il2cpp_field_static_get_value = uintptr_t(*)(uintptr_t, uintptr_t*); 80 | static auto field_static_get_value = LI_FIND_DEF(il2cpp_field_static_get_value); 81 | 82 | using il2cpp_class_get_fields = uintptr_t(*)(uintptr_t, uintptr_t*); 83 | static auto class_get_fields = LI_FIND_DEF(il2cpp_class_get_fields); 84 | 85 | using il2cpp_field_get_offset = uintptr_t(*)(uintptr_t); 86 | static auto field_get_offset = LI_FIND_DEF(il2cpp_field_get_offset); 87 | 88 | using il2cpp_runtime_class_init = uintptr_t(*)(uintptr_t); 89 | static auto runtime_class_init = LI_FIND_DEF(il2cpp_runtime_class_init); 90 | 91 | using il2cpp_string_new_wrapper = il2cppstring * (*)(const char*); 92 | static auto new_string = LI_FIND_DEF(il2cpp_string_new_wrapper); 93 | 94 | using il2cpp_class_get_method_from_name = uintptr_t(*)(uintptr_t, const char*, int); 95 | static il2cpp_class_get_method_from_name class_get_method_from_name = LI_FIND_DEF(il2cpp_class_get_method_from_name); 96 | } 97 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/game/offsets.cpp: -------------------------------------------------------------------------------- 1 | #include "offsets.hpp" 2 | #include "il2cpp.hpp" 3 | #include "../utils/memory.hpp" 4 | 5 | namespace offsets 6 | { 7 | uintptr_t get_material = il2cpp::method(xorstr_("Renderer"), xorstr_("get_material"), 0, xorstr_("UnityEngine")); 8 | uintptr_t get_shader = il2cpp::method(xorstr_("Material"), xorstr_("get_shader"), 0, xorstr_("UnityEngine")); 9 | uintptr_t find = il2cpp::method(xorstr_("Shader"), xorstr_("Find"), 1, xorstr_("UnityEngine")); 10 | uintptr_t set_shader = il2cpp::method(xorstr_("Material"), xorstr_("set_shader"), 1, xorstr_("UnityEngine")); 11 | uintptr_t set_color = il2cpp::method(xorstr_("Material"), xorstr_("SetColor"), 2, xorstr_("UnityEngine")); 12 | uintptr_t set_int = il2cpp::method(xorstr_("Material"), xorstr_("SetInt"), 2, xorstr_("UnityEngine")); 13 | uintptr_t _displayName = il2cpp::value(xorstr_("BasePlayer"), xorstr_("_displayName")); 14 | uintptr_t userID = il2cpp::value(xorstr_("BasePlayer"), xorstr_("userID")); 15 | uintptr_t clActiveItem = il2cpp::value(xorstr_("BasePlayer"), xorstr_("clActiveItem")); 16 | uintptr_t movement = il2cpp::value(xorstr_("BasePlayer"), xorstr_("movement")); 17 | uintptr_t input = il2cpp::value(xorstr_("BasePlayer"), xorstr_("input")); 18 | uintptr_t inventory = il2cpp::value(xorstr_("BasePlayer"), xorstr_("inventory")); 19 | uintptr_t clientTeam = il2cpp::value(xorstr_("BasePlayer"), xorstr_("clientTeam")); 20 | uintptr_t playerFlags = il2cpp::value(xorstr_("BasePlayer"), xorstr_("playerFlags")); 21 | uintptr_t player_model = il2cpp::value(xorstr_("BasePlayer"), xorstr_("playerModel")); 22 | uintptr_t player_eyes = il2cpp::value(xorstr_("BasePlayer"), xorstr_("eyes")); 23 | uintptr_t player_lastSentTick = il2cpp::value(xorstr_("BasePlayer"), xorstr_("lastSentTick")); 24 | uintptr_t invitetoteam = il2cpp::method(xorstr_("BasePlayer"), xorstr_("InviteToTeam"), 1); 25 | uintptr_t baseplayer_get_height = il2cpp::method(xorstr_("BasePlayer"), xorstr_("GetHeight"), 1); 26 | uintptr_t baseplayer_get_radius = il2cpp::method(xorstr_("BasePlayer"), xorstr_("GetRadius"), 0); 27 | uintptr_t baseplayer_get_jumpheight = il2cpp::method(xorstr_("BasePlayer"), xorstr_("GetJumpHeight"), 0); 28 | uintptr_t model = il2cpp::value(xorstr_("BaseEntity"), xorstr_("model")); 29 | uintptr_t modelstate = il2cpp::value(xorstr_("BasePlayer"), xorstr_("modelState")); 30 | uintptr_t playermodel_position = il2cpp::value(xorstr_("PlayerModel"), xorstr_("position")); 31 | uintptr_t playermodel_newVelocity = il2cpp::value(xorstr_("PlayerModel"), xorstr_("newVelocity")); 32 | uintptr_t playermodel_multimesh = il2cpp::value(xorstr_("PlayerModel"), xorstr_("_multiMesh")); 33 | uintptr_t boneTransforms = il2cpp::value(xorstr_("Model"), xorstr_("boneTransforms")); 34 | uintptr_t get_mousePosition = il2cpp::method(xorstr_("Input"), xorstr_("get_mousePosition"), 0, xorstr_("UnityEngine")); 35 | uintptr_t screen_get_width = il2cpp::method(xorstr_("Screen"), xorstr_("get_width"), 0, xorstr_("UnityEngine")); 36 | uintptr_t screen_get_height = il2cpp::method(xorstr_("Screen"), xorstr_("get_height"), 0, xorstr_("UnityEngine")); 37 | uintptr_t input_get_key_down = il2cpp::method(xorstr_("Input"), xorstr_("GetKeyDown"), 1, xorstr_("UnityEngine")); 38 | uintptr_t input_get_key_up = il2cpp::method(xorstr_("Input"), xorstr_("GetKeyUp"), 1, xorstr_("UnityEngine")); 39 | uintptr_t input_get_key = il2cpp::method(xorstr_("Input"), xorstr_("GetKey"), 1, xorstr_("UnityEngine")); 40 | uintptr_t gamephysics_line_of_site = il2cpp::method(xorstr_("GamePhysics"), xorstr_("LineOfSight"), 4); 41 | uintptr_t ignore_layer_collision = il2cpp::methods::resolve_icall(xorstr_("UnityEngine.Physics::IgnoreLayerCollision()"));//il2cpp::method(xorstr_("Physics"), xorstr_("IgnoreLayerCollision"), 3, xorstr_("UnityEngine")); 42 | uintptr_t mathf_clamp = il2cpp::method(xorstr_("Mathf"), xorstr_("Clamp"), 3, xorstr_("UnityEngine")); 43 | uintptr_t mathf_atan2 = il2cpp::method(xorstr_("Mathf"), xorstr_("Atan2"), 2, xorstr_("UnityEngine")); 44 | uintptr_t mathf_max = il2cpp::method(xorstr_("Mathf"), xorstr_("Max"), 2, xorstr_("UnityEngine")); 45 | uintptr_t mathf_abs = il2cpp::method(xorstr_("Mathf"), xorstr_("Abs"), 1, xorstr_("UnityEngine")); 46 | uintptr_t transform_get_position = il2cpp::method(xorstr_("Transform"), xorstr_("get_position"), 0, xorstr_("UnityEngine")); 47 | uintptr_t transform_set_position = il2cpp::method(xorstr_("Transform"), xorstr_("set_position"), 1, xorstr_("UnityEngine")); 48 | uintptr_t transform_inverse_transform_point = il2cpp::method(xorstr_("Transform"), xorstr_("InverseTransformPoint"), 1, xorstr_("UnityEngine")); 49 | uintptr_t calcsize = il2cpp::method(xorstr_("GUIStyle"), xorstr_("CalcSize"), 0, xorstr_("UnityEngine")); 50 | uintptr_t transform_transform_direction = il2cpp::method(xorstr_("Transform"), xorstr_("TransformDirection"), 1, xorstr_("UnityEngine")); 51 | uintptr_t baseentity__name = il2cpp::value(xorstr_("BaseEntity"), xorstr_("_name")); 52 | uintptr_t baseentity_closest_point = il2cpp::method(xorstr_("BaseEntity"), xorstr_("ClosestPoint"), 1); 53 | uintptr_t baseentity_serverrpc_1arg = il2cpp::method(xorstr_("BaseEntity"), xorstr_("ServerRPC"), 1); 54 | uintptr_t baseentity_sendsignalbroadcast = il2cpp::method(xorstr_("BaseEntity"), xorstr_("SendSignalBroadcast"), 2); 55 | uintptr_t component_get_transform = il2cpp::method(xorstr_("Component"), xorstr_("get_transform"), 0, xorstr_("UnityEngine")); 56 | uintptr_t treeentity_hit_direction = il2cpp::value(xorstr_("TreeEntity"), xorstr_("hitDirection")); 57 | uintptr_t basecombatentity__lifestate = il2cpp::value(xorstr_("BaseCombatEntity"), xorstr_("lifestate")); 58 | uintptr_t basecombatentity__health = il2cpp::value(xorstr_("BaseCombatEntity"), xorstr_("_health")); 59 | uintptr_t basecombatentity__maxHealth = il2cpp::value(xorstr_("BaseCombatEntity"), xorstr_("_maxHealth")); 60 | uintptr_t basecombatentity_lifestate = il2cpp::value(xorstr_("BaseCombatEntity"), xorstr_("lifestate")); 61 | uintptr_t playerwalkmovement_flying = il2cpp::value(xorstr_("PlayerWalkMovement"), xorstr_("flying")); 62 | uintptr_t playerwalkmovement_swimming = il2cpp::value(xorstr_("PlayerWalkMovement"), xorstr_("swimming")); 63 | uintptr_t playerwalkmovement_ducking = il2cpp::value(xorstr_("BaseMovement"), xorstr_("(Ducking)k__BackingField")); 64 | uintptr_t playerwalkmovement_groundAngle = il2cpp::value(xorstr_("PlayerWalkMovement"), xorstr_("groundAngle")); 65 | uintptr_t playerwalkmovement_groundAngleNew = il2cpp::value(xorstr_("PlayerWalkMovement"), xorstr_("groundAngleNew")); 66 | uintptr_t playerwalkmovement_maxAngleWalking = il2cpp::value(xorstr_("PlayerWalkMovement"), xorstr_("maxAngleWalking")); 67 | uintptr_t playerwalkmovement_maxAngleClimbing = il2cpp::value(xorstr_("PlayerWalkMovement"), xorstr_("maxAngleClimbing")); 68 | uintptr_t playerwalkmovement_groundTime = il2cpp::value(xorstr_("PlayerWalkMovement"), xorstr_("groundTime")); 69 | uintptr_t playerwalkmovement_gravityMultiplier = il2cpp::value(xorstr_("PlayerWalkMovement"), xorstr_("gravityMultiplier")); 70 | uintptr_t playerwalkmovement_jumpTime = il2cpp::value(xorstr_("PlayerWalkMovement"), xorstr_("jumpTime")); 71 | uintptr_t playerwalkmovement_landTime = il2cpp::value(xorstr_("PlayerWalkMovement"), xorstr_("landTime")); 72 | uintptr_t item_heldEntity = il2cpp::value(xorstr_("Item"), xorstr_("heldEntity")); 73 | uintptr_t baseprojectile_aimCone = il2cpp::value(xorstr_("BaseProjectile"), xorstr_("aimCone")); 74 | uintptr_t recoilproperties_aimConeCurveScale = il2cpp::value(xorstr_("BaseProjectile"), xorstr_("aimconeCurveScale")); 75 | uintptr_t baseprojectile_aimConePenalty = il2cpp::value(xorstr_("BaseProjectile"), xorstr_("aimconePenalty")); 76 | uintptr_t baseprojectile_aimConePenaltyMax = il2cpp::value(xorstr_("BaseProjectile"), xorstr_("aimConePenaltyMax")); 77 | uintptr_t baseprojectile_hipAimCone = il2cpp::value(xorstr_("BaseProjectile"), xorstr_("hipAimCone")); 78 | uintptr_t baseprojectile_aimconePenaltyPerShot = il2cpp::value(xorstr_("BaseProjectile"), xorstr_("aimconePenaltyPerShot")); 79 | uintptr_t baseprojectile_createdProjectiles = il2cpp::value(xorstr_("BaseProjectile"), xorstr_("createdProjectiles")); 80 | uintptr_t baseprojectile_automatic = il2cpp::value(xorstr_("BaseProjectile"), xorstr_("automatic")); 81 | uintptr_t baseprojectile_aimSway = il2cpp::value(xorstr_("BaseProjectile"), xorstr_("aimSway")); 82 | uintptr_t baseprojectile_aimSwaySpeed = il2cpp::value(xorstr_("BaseProjectile"), xorstr_("aimSwaySpeed")); 83 | uintptr_t baseprojectile_primaryMagazine = il2cpp::value(xorstr_("BaseProjectile"), xorstr_("primaryMagazine")); 84 | uintptr_t baseprojectile_recoil = il2cpp::value(xorstr_("BaseProjectile"), xorstr_("recoil")); 85 | uintptr_t attackentity_repeatDelay = il2cpp::value(xorstr_("AttackEntity"), xorstr_("repeatDelay")); 86 | uintptr_t flintstrikeweapon_successFraction = il2cpp::value(xorstr_("FlintStrikeWeapon"), xorstr_("successFraction")); 87 | uintptr_t client_convar = il2cpp::init_class(xorstr_("Client"), xorstr_("ConVar")); 88 | uintptr_t graphics_convar = il2cpp::init_class(xorstr_("Graphics"), xorstr_("ConVar")); 89 | uintptr_t tod_atmosphereparameters = il2cpp::init_class(xorstr_("TOD_AtmosphereParameters")); 90 | //uintptr_t tod_dayparameters = il2cpp::init_class(xorstr_("TOD_DayParameters")); 91 | uintptr_t tod_nightparameters_lightintensity = il2cpp::value(xorstr_("TOD_NightParameters"), xorstr_("LightIntensity")); 92 | uintptr_t tod_nightparameters_reflectionmultiplier = il2cpp::value(xorstr_("TOD_NightParameters"), xorstr_("ReflectionMultiplier")); 93 | uintptr_t tod_nightparameters_ambientmultiplier = il2cpp::value(xorstr_("TOD_NightParameters"), xorstr_("AmbientMultiplier")); 94 | uintptr_t tod_dayparameters_ambientmultiplier = il2cpp::value(xorstr_("TOD_DayParameters"), xorstr_("AmbientMultiplier")); 95 | uintptr_t tod_nightparameters = il2cpp::value(xorstr_("TOD_Sky"), xorstr_("Night"));//il2cpp::init_class(xorstr_("TOD_NightParameters")); 96 | uintptr_t tod_dayparameters = il2cpp::value(xorstr_("TOD_Sky"), xorstr_("Day"));//il2cpp::init_class(xorstr_("TOD_NightParameters")); 97 | uintptr_t admin_convar = il2cpp::init_class(xorstr_("Admin"), xorstr_("ConVar")); 98 | uintptr_t worldItem_item = il2cpp::value(xorstr_("WorldItem"), xorstr_("item")); 99 | uintptr_t item_info = il2cpp::value(xorstr_("Item"), xorstr_("info")); 100 | uintptr_t itemdefinition_itemid = il2cpp::value(xorstr_("ItemDefinition"), xorstr_("itemid")); 101 | uintptr_t itemdefinition_shortname = il2cpp::value(xorstr_("ItemDefinition"), xorstr_("shortname")); 102 | uintptr_t item_amount = il2cpp::value(xorstr_("Item"), xorstr_("amount")); 103 | uintptr_t item_uid = il2cpp::value(xorstr_("Item"), xorstr_("uid")); 104 | uintptr_t playerinventory_containerBelt = il2cpp::value(xorstr_("PlayerInventory"), xorstr_("containerBelt")); 105 | uintptr_t itemcontainer_itemList = il2cpp::value(xorstr_("ItemContainer"), xorstr_("itemList")); 106 | uintptr_t projectile_thickness = il2cpp::value(xorstr_("Projectile"), xorstr_("thickness")); 107 | uintptr_t projectile_integrity = il2cpp::value(xorstr_("Projectile"), xorstr_("integrity")); 108 | uintptr_t projectile_traveledDistance = il2cpp::value(xorstr_("Projectile"), xorstr_("traveledDistance")); 109 | uintptr_t projectile_maxDistance = il2cpp::value(xorstr_("Projectile"), xorstr_("maxDistance")); 110 | uintptr_t projectile_traveledTime = il2cpp::value(xorstr_("Projectile"), xorstr_("traveledTime")); 111 | uintptr_t projectile_owner = il2cpp::value(xorstr_("Projectile"), xorstr_("owner")); 112 | uintptr_t projectile_mod = il2cpp::value(xorstr_("Projectile"), xorstr_("mod")); 113 | uintptr_t itemmodprojectile_projectileSpread = il2cpp::value(xorstr_("ItemModProjectile"), xorstr_("projectileSpread")); 114 | uintptr_t itemmodprojectile_projectileVelocitySpread = il2cpp::value(xorstr_("ItemModProjectile"), xorstr_("projectileVelocitySpread")); 115 | uintptr_t projectile_initialVelocity = il2cpp::value(xorstr_("Projectile"), xorstr_("initialVelocity")); 116 | uintptr_t projectile_currentVelocity = il2cpp::value(xorstr_("Projectile"), xorstr_("currentVelocity")); 117 | uintptr_t projectile_gravityModifier = il2cpp::value(xorstr_("Projectile"), xorstr_("gravityModifier")); 118 | uintptr_t hittest_hitEntity = il2cpp::value(xorstr_("HitTest"), xorstr_("HitEntity")); 119 | uintptr_t hittest_hitNormal = il2cpp::value(xorstr_("HitTest"), xorstr_("HitNormal")); 120 | uintptr_t hittest_hitTransform = il2cpp::value(xorstr_("HitTest"), xorstr_("HitTransform")); 121 | uintptr_t hittest_hitPoint = il2cpp::value(xorstr_("HitTest"), xorstr_("HitPoint")); 122 | uintptr_t hittest_hitDistance = il2cpp::value(xorstr_("HitTest"), xorstr_("HitDistance")); 123 | uintptr_t hittest_attackray = il2cpp::value(xorstr_("HitTest"), xorstr_("AttackRay")); 124 | uintptr_t hittest_maxDistance = il2cpp::value(xorstr_("HitTest"), xorstr_("MaxDistance")); 125 | uintptr_t hittest_didHit = il2cpp::value(xorstr_("HitTest"), xorstr_("DidHit")); 126 | uintptr_t hittest_damageProperties = il2cpp::value(xorstr_("HitTest"), xorstr_("damageProperties")); 127 | uintptr_t playerinput_bodyAngles = il2cpp::value(xorstr_("PlayerInput"), xorstr_("bodyAngles")); 128 | uintptr_t event_get_current = il2cpp::method(xorstr_("Event"), xorstr_("get_current"), 0, xorstr_("UnityEngine")); 129 | uintptr_t event_get_type = il2cpp::method(xorstr_("Event"), xorstr_("get_type"), 0, xorstr_("UnityEngine")); 130 | uintptr_t cursor_set_lockState = il2cpp::method(xorstr_("Cursor"), xorstr_("set_lockState"), 1, xorstr_("UnityEngine")); 131 | uintptr_t gui_get_skin = il2cpp::method(xorstr_("GUI"), xorstr_("get_skin"), 0, xorstr_("UnityEngine")); 132 | uintptr_t gui_set_color = il2cpp::method(xorstr_("GUI"), xorstr_("set_color"), 1, xorstr_("UnityEngine")); 133 | uintptr_t gui_drawtexture = il2cpp::method(xorstr_("GUI"), xorstr_("DrawTexture"), 2, xorstr_("UnityEngine")); 134 | uintptr_t gui_label = il2cpp::method(xorstr_("GUI"), xorstr_("Label"), 2, xorstr_("UnityEngine")); //il2cpp::method_alt(xorstr_("GUI"), xorstr_("Label"), 3, xorstr_("content"), xorstr_("UnityEngine"), 2); //il2cpp::method(xorstr_("GUI"), xorstr_("Label"), 3, "UnityEngine", true, 2, "content"); 135 | uintptr_t gui_button = il2cpp::method(xorstr_("GUI"), xorstr_("Button"), 2, xorstr_("UnityEngine")); 136 | uintptr_t gui_box = il2cpp::method(xorstr_("GUI"), xorstr_("Box"), 2, xorstr_("UnityEngine")); 137 | uintptr_t gui_horizontalslider = il2cpp::method(xorstr_("GUI"), xorstr_("HorizontalSlider"), 4, xorstr_("UnityEngine")); 138 | uintptr_t texture2d_get_whitetexture = il2cpp::method(xorstr_("Texture2D"), xorstr_("get_whiteTexture"), 0, xorstr_("UnityEngine")); 139 | uintptr_t guistyle_set_fontsize = il2cpp::method(xorstr_("GUIStyle"), xorstr_("set_fontSize"), 1, xorstr_("UnityEngine")); 140 | uintptr_t guistyle_set_alignment = il2cpp::method(xorstr_("GUIStyle"), xorstr_("set_alignment"), 1, xorstr_("UnityEngine")); 141 | uintptr_t guicontent_temp = il2cpp::method(xorstr_("GUIContent"), xorstr_("Temp"), 1, xorstr_("UnityEngine")); 142 | uintptr_t ddraw_get = il2cpp::method(xorstr_("DDraw"), xorstr_("Get"), 0, xorstr_("UnityEngine")); 143 | uintptr_t ddraw_screentext = il2cpp::method(xorstr_("DDraw"), xorstr_("ScreenText"), 4, xorstr_("UnityEngine")); 144 | uintptr_t ddraw_line = il2cpp::method(xorstr_("DDraw"), xorstr_("Line"), 6, xorstr_("UnityEngine")); 145 | uintptr_t ddraw_arrow = il2cpp::method(xorstr_("DDraw"), xorstr_("Arrow"), 5, xorstr_("UnityEngine")); 146 | uintptr_t ddraw_text = il2cpp::method(xorstr_("DDraw"), xorstr_("Text"), 4, xorstr_("UnityEngine")); 147 | uintptr_t serverrpc_projectileshoot = memory::find_rel(xorstr_("GameAssembly.dll"), xorstr_("4C 8B 0D ? ? ? ? 48 8B 75 28")); 148 | uintptr_t baseprojectile_getprojectilevelocityscale = il2cpp::method(xorstr_("BaseProjectile"), xorstr_("GetProjectileVelocityScale"), 1); 149 | uintptr_t modelstate_set_onLadder = il2cpp::method(xorstr_("ModelState"), xorstr_("set_onLadder"), 1); 150 | uintptr_t gamemanager_createprefab = il2cpp::method(xorstr_("GameManager"), xorstr_("CreatePrefab"), 2); 151 | uintptr_t gamemanager_destroy = il2cpp::method(xorstr_("GameManager"), xorstr_("Destroy"), 2); 152 | uintptr_t buildingblock_canaffordupgrade = il2cpp::method(xorstr_("BuildingBlock"), xorstr_("CanAffordUpgrade"), 2); 153 | uintptr_t buildingblock_canchangetograde = il2cpp::method(xorstr_("BuildingBlock"), xorstr_("CanChangeToGrade"), 2); 154 | uintptr_t buildingblock_upgradetograde = il2cpp::method(xorstr_("BuildingBlock"), xorstr_("UpgradeToGrade"), 2); 155 | uintptr_t consolesystem_index = il2cpp::init_class(xorstr_("ConsoleSystem.Index")); 156 | uintptr_t baseplayer_consolemessage = il2cpp::method(xorstr_("BasePlayer"), xorstr_("ConsoleMessage"), 1); 157 | uintptr_t time_get_time = il2cpp::method(xorstr_("Time"), xorstr_("get_time"), 0, xorstr_("UnityEngine")); 158 | uintptr_t time_get_deltaTime = il2cpp::method(xorstr_("Time"), xorstr_("get_deltaTime"), 0, xorstr_("UnityEngine")); 159 | uintptr_t debug_draw_ray = il2cpp::method(xorstr_("Debug"), xorstr_("DrawLine"), 4, xorstr_("UnityEngine")); 160 | uintptr_t vector2_signed_angle = il2cpp::method(xorstr_("Vector2"), xorstr_("SignedAngle"), 2, xorstr_("UnityEngine")); 161 | uintptr_t create = il2cpp::method(xorstr_("GameObject"), xorstr_("Internal_CreateGameObject"), 2, xorstr_("UnityEngine")); 162 | uintptr_t dont_destroy_on_load = il2cpp::method(xorstr_("Object"), xorstr_("DontDestroyOnLoad"), 1, xorstr_("UnityEngine")); 163 | uintptr_t object_name = il2cpp::value(xorstr_("Object"), xorstr_("name")); 164 | uintptr_t add_component = il2cpp::method(xorstr_("GameObject"), xorstr_("AddComponent"), 1, xorstr_("UnityEngine")); 165 | uintptr_t guiutility_rotatearoundpivot = il2cpp::method(xorstr_("GUIUtility"), xorstr_("RotateAroundPivot"), 2, xorstr_("UnityEngine")); 166 | uintptr_t randomrange = il2cpp::method(xorstr_("Random"), xorstr_("Range"), 2, xorstr_("UnityEngine")); 167 | uintptr_t baseplayer_mounted = il2cpp::value(xorstr_("BasePlayer"), xorstr_("mounted")); 168 | uintptr_t basemountable_canwielditems = il2cpp::value(xorstr_("BaseMountable"), xorstr_("canWieldItems")); 169 | uintptr_t tod_sky_get_instance = il2cpp::method(xorstr_("TOD_Sky"), xorstr_("get_Instance"), 0); 170 | uintptr_t unity_web_request_get = il2cpp::method(xorstr_("UnityWebRequest"), xorstr_("Get"), 1, "UnityEngine.Networking"); 171 | uintptr_t unity_web_request_get_response_code = il2cpp::method(xorstr_("UnityWebRequest"), xorstr_("get_responseCode"), 0, "UnityEngine.Networking"); 172 | uintptr_t unity_web_request_send_web_request = il2cpp::method(xorstr_("UnityWebRequest"), xorstr_("SendWebRequest"), 0, "UnityEngine.Networking"); 173 | uintptr_t unity_web_request_get_download_handler = il2cpp::method(xorstr_("UnityWebRequest"), xorstr_("get_downloadHandler"), 0, "UnityEngine.Networking"); 174 | uintptr_t download_handler_get_text = il2cpp::method(xorstr_("DownloadHandler"), xorstr_("get_text"), 0, "UnityEngine.Networking"); 175 | uintptr_t attackentity_nextattacktime = il2cpp::value(xorstr_("AttackEntity"), xorstr_("nextAttackTime")); 176 | uintptr_t attackentity_timesincedeploy = il2cpp::value(xorstr_("AttackEntity"), xorstr_("timeSinceDeploy")); 177 | uintptr_t attackentity_deploydelay = il2cpp::value(xorstr_("AttackEntity"), xorstr_("deployDelay")); 178 | uintptr_t attackentity_repeatdelay = il2cpp::value(xorstr_("AttackEntity"), xorstr_("repeatDelay")); 179 | uintptr_t basemelee_damageproperties = il2cpp::value(xorstr_("BaseMelee"), xorstr_("damageProperties")); 180 | uintptr_t basemelee_processattack = il2cpp::method(xorstr_("BaseMelee"), xorstr_("ProcessAttack"), 1); 181 | uintptr_t attackentity_startattackcooldown = il2cpp::method(xorstr_("AttackEntity"), xorstr_("StartAttackCooldown"), 1); 182 | uintptr_t playereyes_bodyforward = il2cpp::method(xorstr_("PlayerEyes"), xorstr_("BodyForward"), 0); 183 | uintptr_t playereyes_bodyright = il2cpp::method(xorstr_("PlayerEyes"), xorstr_("BodyRight"), 0); 184 | uintptr_t physics_checkcapsule = il2cpp::method(xorstr_("Physics"), xorstr_("CheckCapsule"), 5, xorstr_("UnityEngine")); 185 | uintptr_t playertick_position = il2cpp::value(xorstr_("PlayerTick"), xorstr_("position")); 186 | uintptr_t rigidbody_setVelocity = il2cpp::method(xorstr_("Rigidbody"), xorstr_("set_velocity"), 1, xorstr_("UnityEngine")); 187 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/game/offsets.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../includes.hpp" 3 | 4 | namespace offsets 5 | { 6 | extern uintptr_t playereyes_bodyright; 7 | extern uintptr_t get_material; 8 | extern uintptr_t get_shader; 9 | extern uintptr_t find; 10 | extern uintptr_t set_shader; 11 | extern uintptr_t set_color; 12 | extern uintptr_t set_int; 13 | extern uintptr_t _displayName; 14 | extern uintptr_t userID; 15 | extern uintptr_t clActiveItem; 16 | extern uintptr_t movement; 17 | extern uintptr_t input; 18 | extern uintptr_t inventory; 19 | extern uintptr_t clientTeam; 20 | extern uintptr_t playerFlags; 21 | extern uintptr_t player_model; 22 | extern uintptr_t player_eyes; 23 | extern uintptr_t player_lastSentTick; 24 | extern uintptr_t invitetoteam; 25 | extern uintptr_t baseplayer_get_height; 26 | extern uintptr_t baseplayer_get_radius; 27 | extern uintptr_t baseplayer_get_jumpheight; 28 | extern uintptr_t playermodel_position; 29 | extern uintptr_t playermodel_newVelocity; 30 | extern uintptr_t playermodel_multimesh; 31 | extern uintptr_t model; 32 | extern uintptr_t add_component; 33 | extern uintptr_t create; 34 | extern uintptr_t dont_destroy_on_load; 35 | extern uintptr_t object_name; 36 | extern uintptr_t modelstate; 37 | extern uintptr_t boneTransforms; 38 | extern uintptr_t get_mousePosition; 39 | extern uintptr_t screen_get_width; 40 | extern uintptr_t screen_get_height; 41 | extern uintptr_t input_get_key_down; 42 | extern uintptr_t input_get_key_up; 43 | extern uintptr_t input_get_key; 44 | extern uintptr_t gamephysics_line_of_site; 45 | extern uintptr_t update; 46 | extern uintptr_t calcsize; 47 | extern uintptr_t ignore_layer_collision; 48 | extern uintptr_t mathf_clamp; 49 | extern uintptr_t mathf_atan2; 50 | extern uintptr_t mathf_max; 51 | extern uintptr_t mathf_abs; 52 | extern uintptr_t transform_get_position; 53 | extern uintptr_t transform_set_position; 54 | extern uintptr_t transform_inverse_transform_point; 55 | extern uintptr_t transform_transform_direction; 56 | extern uintptr_t baseentity__name; 57 | extern uintptr_t baseentity_closest_point; 58 | extern uintptr_t baseentity_serverrpc_1arg; 59 | extern uintptr_t baseentity_sendsignalbroadcast; 60 | extern uintptr_t component_get_transform; 61 | extern uintptr_t treeentity_hit_direction; 62 | extern uintptr_t basecombatentity__lifestate; 63 | extern uintptr_t basecombatentity__health; 64 | extern uintptr_t basecombatentity__maxHealth; 65 | extern uintptr_t basecombatentity_lifestate; 66 | extern uintptr_t playerwalkmovement_ducking; 67 | extern uintptr_t playerwalkmovement_swimming; 68 | extern uintptr_t playerwalkmovement_flying; 69 | extern uintptr_t playerwalkmovement_groundAngle; 70 | extern uintptr_t playerwalkmovement_groundAngle; 71 | extern uintptr_t playerwalkmovement_groundAngleNew; 72 | extern uintptr_t playerwalkmovement_maxAngleWalking; 73 | extern uintptr_t playerwalkmovement_maxAngleClimbing; 74 | extern uintptr_t playerwalkmovement_groundTime; 75 | extern uintptr_t playerwalkmovement_gravityMultiplier; 76 | extern uintptr_t playerwalkmovement_jumpTime; 77 | extern uintptr_t playerwalkmovement_landTime; 78 | //extern uintptr_t 79 | extern uintptr_t item_heldEntity; 80 | extern uintptr_t baseprojectile_aimCone; 81 | extern uintptr_t baseprojectile_aimConePenalty; 82 | extern uintptr_t baseprojectile_aimConePenaltyMax; 83 | extern uintptr_t baseprojectile_hipAimCone; 84 | extern uintptr_t baseprojectile_aimconePenaltyPerShot; 85 | extern uintptr_t baseprojectile_createdProjectiles; 86 | extern uintptr_t baseprojectile_automatic; 87 | extern uintptr_t baseprojectile_aimSway; 88 | extern uintptr_t baseprojectile_aimSwaySpeed; 89 | extern uintptr_t baseprojectile_primaryMagazine; 90 | extern uintptr_t baseprojectile_recoil; 91 | extern uintptr_t attackentity_repeatDelay; 92 | extern uintptr_t flintstrikeweapon_successFraction; 93 | extern uintptr_t client_convar; 94 | extern uintptr_t graphics_convar; 95 | extern uintptr_t tod_atmosphereparameters; 96 | extern uintptr_t tod_dayparameters; 97 | extern uintptr_t tod_nightparameters_lightintensity; 98 | extern uintptr_t tod_nightparameters_reflectionmultiplier; 99 | extern uintptr_t tod_nightparameters_ambientmultiplier; 100 | extern uintptr_t tod_dayparameters_ambientmultiplier; 101 | extern uintptr_t tod_nightparameters; 102 | extern uintptr_t tod_dayparameters; 103 | extern uintptr_t admin_convar; 104 | extern uintptr_t worldItem_item; 105 | extern uintptr_t item_info; 106 | extern uintptr_t itemdefinition_itemid; 107 | extern uintptr_t itemdefinition_shortname; 108 | extern uintptr_t item_amount; 109 | extern uintptr_t item_uid; 110 | extern uintptr_t playerinventory_containerBelt; 111 | extern uintptr_t itemcontainer_itemList; 112 | extern uintptr_t projectile_thickness; 113 | extern uintptr_t projectile_integrity; 114 | extern uintptr_t projectile_traveledDistance; 115 | extern uintptr_t projectile_maxDistance; 116 | extern uintptr_t projectile_traveledTime; 117 | extern uintptr_t projectile_owner; 118 | extern uintptr_t projectile_mod; 119 | extern uintptr_t projectile_initialVelocity; 120 | extern uintptr_t projectile_currentVelocity; 121 | extern uintptr_t projectile_gravityModifier; 122 | extern uintptr_t itemmodprojectile_projectileSpread; 123 | extern uintptr_t itemmodprojectile_projectileVelocitySpread; 124 | extern uintptr_t hittest_hitEntity; 125 | extern uintptr_t hittest_hitNormal; 126 | extern uintptr_t hittest_hitTransform; 127 | extern uintptr_t hittest_hitPoint; 128 | extern uintptr_t hittest_hitDistance; 129 | extern uintptr_t hittest_attackray; 130 | extern uintptr_t hittest_maxDistance; 131 | extern uintptr_t hittest_didHit; 132 | extern uintptr_t hittest_material; 133 | extern uintptr_t hittest_damageProperties; 134 | extern uintptr_t playerinput_bodyAngles; 135 | extern uintptr_t event_get_current; 136 | extern uintptr_t event_get_type; 137 | extern uintptr_t cursor_set_lockState; 138 | extern uintptr_t gui_get_skin; 139 | extern uintptr_t gui_set_color; 140 | extern uintptr_t gui_drawtexture; 141 | extern uintptr_t texture2d_get_whitetexture; 142 | extern uintptr_t guistyle_set_fontsize; 143 | extern uintptr_t guistyle_set_alignment; 144 | extern uintptr_t guicontent_temp; 145 | extern uintptr_t gui_label; 146 | extern uintptr_t gui_button; 147 | extern uintptr_t gui_box; 148 | extern uintptr_t gui_horizontalslider; 149 | extern uintptr_t ddraw_get; 150 | extern uintptr_t ddraw_screentext; 151 | extern uintptr_t ddraw_line; 152 | extern uintptr_t ddraw_arrow; 153 | extern uintptr_t ddraw_text; 154 | extern uintptr_t baseprojectile_getprojectilevelocityscale; 155 | extern uintptr_t modelstate_set_onLadder; 156 | extern uintptr_t gamemanager_createprefab; 157 | extern uintptr_t gamemanager_destroy; 158 | extern uintptr_t buildingblock_canaffordupgrade; 159 | extern uintptr_t buildingblock_canchangetograde; 160 | extern uintptr_t buildingblock_upgradetograde; 161 | extern uintptr_t consolesystem_index; 162 | extern uintptr_t baseplayer_consolemessage; 163 | extern uintptr_t time_get_time; 164 | extern uintptr_t time_get_deltaTime; 165 | extern uintptr_t debug_draw_ray; 166 | extern uintptr_t vector2_signed_angle; 167 | extern uintptr_t guiutility_rotatearoundpivot; 168 | extern uintptr_t randomrange; 169 | extern uintptr_t baseplayer_mounted; 170 | extern uintptr_t basemountable_canwielditems; 171 | extern uintptr_t tod_sky_get_instance; 172 | extern uintptr_t unity_web_request_get; 173 | extern uintptr_t unity_web_request_get_response_code; 174 | extern uintptr_t unity_web_request_send_web_request; 175 | extern uintptr_t unity_web_request_get_download_handler; 176 | extern uintptr_t download_handler_get_text; 177 | extern uintptr_t attackentity_nextattacktime; 178 | extern uintptr_t attackentity_timesincedeploy; 179 | extern uintptr_t attackentity_deploydelay; 180 | extern uintptr_t attackentity_repeatdelay; 181 | extern uintptr_t basemelee_damageproperties; 182 | extern uintptr_t basemelee_processattack; 183 | extern uintptr_t attackentity_startattackcooldown; 184 | extern uintptr_t playereyes_bodyforward; 185 | extern uintptr_t physics_checkcapsule; 186 | extern uintptr_t playertick_position; 187 | extern uintptr_t rigidbody_setVelocity; 188 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/gui_framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "includes.hpp" 3 | #include "game/classes.hpp" 4 | 5 | namespace mid_framework 6 | { 7 | Vector2 cursor1; 8 | Vector2 cursor2; 9 | Vector2 resolution; 10 | Vector2 position; 11 | float x = 500, y = 500; 12 | int selected = 0; 13 | bool lmb = false; 14 | bool open = true; 15 | 16 | auto get_lmb() -> bool 17 | { 18 | static int delay = 0; 19 | 20 | if (functions::get_key_down(KeyCode::Mouse0) && delay <= 0) 21 | { 22 | delay = 25; 23 | return true; 24 | } 25 | 26 | delay--; 27 | 28 | return false; 29 | } 30 | 31 | auto get_ins() -> bool 32 | { 33 | static int delay = 0; 34 | 35 | if (functions::get_key_down(KeyCode::UpArrow) && delay <= 0) 36 | { 37 | delay = 25; 38 | return true; 39 | } 40 | 41 | delay--; 42 | 43 | return false; 44 | } 45 | 46 | auto is_hovering(Vector2 position, Vector2 size) -> bool 47 | { 48 | auto cursor = functions::get_mouse_pos(); 49 | cursor.y = variables::screen_height - cursor.y; 50 | 51 | return cursor.x > position.x && cursor.x < position.x + size.x && cursor.y > position.y && cursor.y < position.y + size.y; 52 | } 53 | auto add_child(int num) -> void 54 | { 55 | if (!open) 56 | return; 57 | 58 | if (num > 2) 59 | num = 2; 60 | else if (num <= 0) 61 | num = 1; 62 | 63 | if (num == 1) 64 | { 65 | functions::outline_box({ position.x + 8, position.y + 74 }, { resolution.x - 17, resolution.y - 83 }, { 1, 1, 1, 1 }, 1.f); 66 | } 67 | else if (num == 2) 68 | { 69 | functions::outline_box({ position.x + 8, position.y + 74 }, { resolution.x - 334, resolution.y - 83 }, { 1, 1, 1, 1 }, 1.f); 70 | 71 | functions::outline_box({ position.x + 325, position.y + 74 }, { resolution.x - 334, resolution.y - 83 }, { 1, 1, 1, 1 }, 1.f); 72 | } 73 | } 74 | 75 | auto add_tab(std::string name, int index, int offset) -> void 76 | { 77 | if (!open) 78 | return; 79 | auto hovering = is_hovering({ position.x + 8 + (126 * index), position.y + 33 }, { 120, 35 }); 80 | 81 | functions::fill_box({ position.x + 8 + (126 * index), position.y + 33, 120, 35 }, { 0, 0, 0, 1 }); 82 | if (selected == index) 83 | { 84 | functions::fill_box({ position.x + 9 + (126 * index), position.y + 34, 118, 33 }, { 0.3, 0.3, 0.3, 1 }); 85 | } 86 | else if (hovering) 87 | { 88 | functions::fill_box({ position.x + 9 + (126 * index), position.y + 34, 118, 33 }, { 0.1, 1, 0.1, 1 }); 89 | } 90 | else 91 | { 92 | functions::fill_box({ position.x + 9 + (126 * index), position.y + 34, 118, 33 }, { 0.1, 0.1, 1, 1 }); 93 | } 94 | 95 | if (hovering && lmb) 96 | { 97 | selected = index; 98 | } 99 | 100 | functions::label({ position.x + 8 + (126 * index), position.y + 33, 120, 35 }, name, { 1,1,1,1 }, true); 101 | } 102 | 103 | auto add_label(std::string text, int child) -> void 104 | { 105 | if (!open) 106 | return; 107 | 108 | Vector2 cursor; 109 | if (child == 1) 110 | cursor = cursor1; 111 | else if (child == 2) 112 | cursor = cursor2; 113 | 114 | functions::label({ cursor.x, cursor.y - 2, 150, 20 }, text, { 1,1,1,1 }); 115 | 116 | if (child == 1) 117 | cursor1.y += 20; 118 | else if (child == 2) 119 | cursor2.y += 20; 120 | } 121 | 122 | auto add_checkbox(std::string name, bool* value, int child) -> void 123 | { 124 | if (!open) 125 | return; 126 | 127 | Vector2 cursor; 128 | if (child == 1) 129 | cursor = cursor1; 130 | else if (child == 2) 131 | cursor = cursor2; 132 | 133 | const auto hovered = is_hovering({ cursor.x - 3, cursor.y - 2 }, { 70, 14 + 3 }); 134 | 135 | if (hovered) 136 | { 137 | functions::fill_box({ cursor.x, cursor.y + 1, 14, 14 }, { 0.329f, 0.329f, 0.329f, 1 }); 138 | } 139 | 140 | 141 | functions::fill_box({ cursor.x, cursor.y, 14, 14 }, { 0.153f, 0.153f, 0.153f, 1 }); 142 | 143 | if (*value) 144 | { 145 | functions::fill_box({ cursor.x, cursor.y, 14, 14 }, { 0.149f, 0.149f, 0.149f, 1 }); 146 | } 147 | else 148 | { 149 | functions::fill_box({ cursor.x + 3, cursor.y + 3, 8, 8 }, { 0.667f, 0.667f, 0.667f, 1 }); 150 | } 151 | 152 | functions::label({ cursor.x + 19, cursor.y - 2, 150, 20 }, name, { 1,1,1,1 }); 153 | 154 | if (hovered && lmb) 155 | { 156 | *value = !*value; 157 | } 158 | 159 | if(child == 1) 160 | cursor1.y += 20; 161 | else if(child == 2) 162 | cursor2.y += 20; 163 | } 164 | 165 | auto add_combo(std::vector list, int* selected, int child) -> void 166 | { 167 | if (!open) 168 | return; 169 | 170 | Vector2 cursor; 171 | if (child == 1) 172 | cursor = cursor1; 173 | else if (child == 2) 174 | cursor = cursor2; 175 | 176 | const auto left_hovered = is_hovering({ cursor.x, cursor.y }, { 18, 18 }); 177 | const auto middle_hovered = is_hovering({ cursor.x + 20, cursor.y }, { 120, 19 }); 178 | const auto right_hovered = is_hovering({ cursor.x + 141, cursor.y }, { 19, 19 }); 179 | 180 | functions::fill_box({ cursor.x, cursor.y, 19, 19 }, left_hovered 181 | ? Vector4(0.325f, 0.325f, 0.325f, 1) : 182 | Vector4(0.215f, 0.215f, 0.215f, 1)); 183 | 184 | 185 | functions::fill_box({ cursor.x + 20, cursor.y, 120, 19 }, middle_hovered 186 | ? Vector4(0.325f, 0.325f, 0.325f, 1) : 187 | Vector4(0.215f, 0.215f, 0.215f, 1)); 188 | 189 | 190 | functions::fill_box({ cursor.x + 141, cursor.y, 19, 19 }, right_hovered 191 | ? Vector4( 0.325f, 0.325f, 0.325f, 1 ) 192 | : Vector4(0.215f, 0.215f, 0.215f, 1 )); 193 | 194 | functions::label({ cursor.x + 6, cursor.y - 3, 150, 20 }, xorstr_("-"), { 1, 1, 1, 1 }, false, 16); 195 | functions::label({ cursor.x + 20, cursor.y - 1, 120, 19 }, list[*selected], { 1, 1, 1, 1 }, true, 14); 196 | functions::label({ cursor.x + 146, cursor.y - 2, 150, 20 }, xorstr_("+"), { 1, 1, 1, 1 }, false, 16); 197 | 198 | if (*selected > 0 && left_hovered && lmb) 199 | { 200 | --* selected; 201 | } 202 | else if (*selected < list.size() - 1 && right_hovered && lmb) 203 | { 204 | ++* selected; 205 | } 206 | else if (middle_hovered && lmb) 207 | { 208 | *selected = 0; 209 | } 210 | 211 | if (child == 1) 212 | cursor1.y += 25; 213 | else if (child == 2) 214 | cursor2.y += 25; 215 | } 216 | 217 | auto add_slider_float(std::string name, float* value, float min, float max, int child) -> void 218 | { 219 | if (!open) 220 | return; 221 | 222 | Vector2 cursor; 223 | if (child == 1) 224 | cursor = cursor1; 225 | else if (child == 2) 226 | cursor = cursor2; 227 | 228 | const auto hovered = is_hovering({ cursor.x - 3, cursor.y + 7 }, { 310, 24 }); 229 | const static auto max_width = 293; 230 | 231 | if (hovered) 232 | { 233 | functions::fill_box({ cursor.x, cursor.y + 19 - 4, max_width, 3 }, { 0.254f, 0.254f, 0.254f, 1 }); 234 | } 235 | else 236 | { 237 | functions::fill_box({ cursor.x, cursor.y + 19 - 4, max_width, 3 }, { 0.196f, 0.196f, 0.196f, 1 }); 238 | } 239 | 240 | if (hovered && functions::get_key(KeyCode::Mouse0)) 241 | { 242 | const auto mouse_x = static_cast(functions::get_mouse_pos().x); 243 | 244 | *value = ((mouse_x - cursor.x) / max_width * max); 245 | } 246 | 247 | if (*value > max) 248 | { 249 | *value = max; 250 | } 251 | else if (*value < min) 252 | { 253 | *value = min; 254 | } 255 | 256 | functions::fill_box({ cursor.x, cursor.y + 19 - 4, (*value * max_width) / max, 2 }, { 0.705f, 0.705f, 0.705f, 1 }); 257 | 258 | functions::label({ cursor.x, cursor.y - 4, 150, 20 }, name, { 1, 1, 1, 1 }); 259 | functions::label({ cursor.x + max_width - 15, cursor.y - 4, 150, 20 }, std::to_string(static_cast(*value)).c_str(), { 1, 1, 1, 1 }, false); 260 | 261 | if (child == 1) 262 | cursor1.y += 21; 263 | else if (child == 2) 264 | cursor2.y += 21; 265 | } 266 | 267 | auto add_slider_int(std::string name, int* value, int min, int max, int child) -> void 268 | { 269 | if (!open) 270 | return; 271 | 272 | Vector2 cursor; 273 | if (child == 1) 274 | cursor = cursor1; 275 | else if (child == 2) 276 | cursor = cursor2; 277 | 278 | const auto hovered = is_hovering({ cursor.x - 3, cursor.y + 7 }, { 310, 24 }); 279 | const static auto max_width = 293; 280 | 281 | if (hovered) 282 | { 283 | functions::fill_box({ cursor.x, cursor.y + 19 - 4, max_width, 3 }, { 0.254f, 0.254f, 0.254f, 1 }); 284 | } 285 | else 286 | { 287 | functions::fill_box({ cursor.x, cursor.y + 19 - 4, max_width, 3 }, { 0.196f, 0.196f, 0.196f, 1 }); 288 | } 289 | 290 | if (hovered && functions::get_key(KeyCode::Mouse0)) 291 | { 292 | const auto mouse_x = static_cast(functions::get_mouse_pos().x); 293 | 294 | *value = ((mouse_x - cursor.x) / max_width * max); 295 | } 296 | 297 | if (*value > max) 298 | { 299 | *value = max; 300 | } 301 | else if (*value < min) 302 | { 303 | *value = min; 304 | } 305 | 306 | functions::fill_box({ cursor.x, cursor.y + 19 - 4, (float)(*value * max_width / max), 2}, {0.705f, 0.705f, 0.705f, 1}); 307 | 308 | functions::label({ cursor.x, cursor.y - 4, 150, 20 }, name, { 1, 1, 1, 1 }); 309 | functions::label({ cursor.x + max_width - 15, cursor.y - 4, 150, 20 }, std::to_string(static_cast(*value)).c_str(), { 1, 1, 1, 1 }, false); 310 | 311 | if (child == 1) 312 | cursor1.y += 21; 313 | else if (child == 2) 314 | cursor2.y += 21; 315 | } 316 | 317 | 318 | 319 | auto begin(std::string cheat_name) -> void 320 | { 321 | if (!open) 322 | return; 323 | if (functions::get_key(KeyCode::Mouse0) && is_hovering(position, { resolution.x, 25 })) 324 | { 325 | auto cursor = functions::get_mouse_pos(); 326 | cursor.y = variables::screen_height - cursor.y; 327 | 328 | x = cursor.x - (resolution.x / 2); 329 | y = cursor.y - (12.5); 330 | } 331 | 332 | 333 | 334 | functions::fill_box({ position.x, position.y, resolution.x, resolution.y }, { 0.1, 0.1, 0.1, 1 }); 335 | functions::fill_box({ position.x + 2, position.y + 2, resolution.x - 4, resolution.y - 4 }, { 0.060f, 0.060f, 0.060f, 1 }); 336 | 337 | functions::fill_box({ position.x, position.y, resolution.x, 26 }, { 0.030f, 0.030f, 0.030f, 1 }); 338 | functions::fill_box({ position.x, position.y, resolution.x, 25 }, { 0.0f, 0.0f, 0.0f, 1 }); 339 | 340 | functions::label({ position.x + 10, position.y + 3, 150, 20 }, cheat_name, { 1,1,1,1 }); 341 | 342 | } 343 | 344 | auto end() -> void 345 | { 346 | if (get_ins()) 347 | open = !open; 348 | lmb = get_lmb(); 349 | resolution = { 640, 440 }; 350 | position = { x, y }; 351 | cursor1 = { position.x + 15, position.y + 81 }; 352 | cursor2 = { position.x + 332, position.y + 81 }; 353 | } 354 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/hinclude.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "includes.hpp" 4 | #include "game/classes.hpp" 5 | #include "utils/returnspoofer.hpp" 6 | #include "utils/memory.hpp" 7 | #include "gui_framework.h" -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/includes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | //#include 24 | //#include 25 | 26 | //#include 27 | 28 | #include "utils/math.hpp" 29 | #include "utils/xor.hpp" 30 | 31 | #define MUTATE_START 32 | #define MUTATE_END 33 | 34 | #pragma comment(lib,"user32.lib") -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/ongui.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "hinclude.h" 3 | #include "esp.h" 4 | #include "game/offsets.hpp" 5 | #include "Glob.hpp" 6 | #include "sky.hpp" 7 | 8 | void sky_loop() 9 | { 10 | uintptr_t todsky; 11 | 12 | if (!todsky) 13 | { 14 | std::cout << "Not Working"; 15 | } 16 | auto instantsky = *reinterpret_cast(todsky + offsets::tod_sky_get_instance); 17 | 18 | if (!instantsky) 19 | { 20 | std::cout << "Instant not working"; 21 | } 22 | auto tod_atmosphereparameters = *reinterpret_cast(todsky + offsets::tod_atmosphereparameters); 23 | if (!tod_atmosphereparameters) 24 | { 25 | std::cout << "tod_atmosphereparameters Not Working"; 26 | } 27 | 28 | auto tod_dayparameters = *reinterpret_cast(todsky + offsets::tod_dayparameters); 29 | if (!tod_dayparameters) 30 | { 31 | std::cout << "tod_dayparameters Not Working"; 32 | } 33 | 34 | 35 | auto tod_dayparameters_ambientmultiplier = *reinterpret_cast(tod_dayparameters + offsets::tod_dayparameters_ambientmultiplier); 36 | if (!tod_dayparameters_ambientmultiplier) 37 | { 38 | std::cout << "tod_dayparameters_ambientmultiplier Not Working"; 39 | } 40 | auto tod_nightparameters = *reinterpret_cast(todsky + offsets::tod_nightparameters); 41 | if (!tod_nightparameters) 42 | { 43 | std::cout << "tod_nightparameters Not Working"; 44 | } 45 | 46 | auto tod_nightparameters_ambientmultiplier = *reinterpret_cast(tod_nightparameters + offsets::tod_nightparameters_ambientmultiplier); 47 | if (!tod_nightparameters_ambientmultiplier) 48 | { 49 | std::cout << "tod_nightparameters_ambientmultiplier Not Working"; 50 | } 51 | 52 | 53 | } 54 | void entity_loop() 55 | { 56 | variables::client_entities = il2cpp::value(xorstr_("BaseNetworkable"), xorstr_("clientEntities"), false); 57 | 58 | if (!variables::client_entities) 59 | { 60 | rust::LocalPlayer::ConsoleMessage(xorstr_("!client_entities")); 61 | return; 62 | } 63 | 64 | auto entity_realm = *reinterpret_cast(variables::client_entities + 0x10); 65 | if (!entity_realm) 66 | { 67 | return; 68 | } 69 | 70 | auto buffer_list = *reinterpret_cast(entity_realm + 0x28); 71 | if (!buffer_list) 72 | { 73 | return; 74 | } 75 | 76 | auto object_list_size = *reinterpret_cast(buffer_list + 0x10); 77 | 78 | auto object_list = *reinterpret_cast(buffer_list + 0x18); 79 | if (!object_list) 80 | { 81 | return; 82 | } 83 | 84 | std::vector tempList; 85 | 86 | 87 | 88 | for (int idx = 0; idx < object_list_size; idx++) 89 | { 90 | auto current_object = *reinterpret_cast(object_list + (0x20 + (idx * sizeof(uint64_t)))); 91 | if (!current_object) 92 | { 93 | continue; 94 | } 95 | 96 | auto object_unk = *reinterpret_cast(current_object); 97 | if (!object_unk) 98 | { 99 | continue; 100 | } 101 | 102 | auto classname_ptr = *reinterpret_cast(object_unk + 0x10); 103 | if (!classname_ptr) 104 | { 105 | continue; 106 | } 107 | 108 | auto base_object = *reinterpret_cast(current_object + 0x10); 109 | if (!base_object) 110 | { 111 | continue; 112 | } 113 | 114 | auto object = *reinterpret_cast(base_object + 0x30); 115 | if (!object) 116 | { 117 | continue; 118 | } 119 | 120 | if (idx == 0) 121 | { 122 | auto local_player_object_class = *reinterpret_cast(object + 0x30); 123 | 124 | if (!local_player_object_class) 125 | { 126 | continue; 127 | } 128 | 129 | auto local_entity = *reinterpret_cast(local_player_object_class + 0x18); 130 | 131 | if (!local_entity) 132 | { 133 | continue; 134 | } 135 | 136 | variables::local_player = *reinterpret_cast(local_entity + 0x28); 137 | 138 | if (variables::local_player->get_life_state()) 139 | { 140 | continue; 141 | } 142 | 143 | variables::local_position = variables::local_player->get_visual_position(local_player_object_class); 144 | continue; 145 | } 146 | 147 | functions::update_view_matrix(); 148 | 149 | const auto tag = *reinterpret_cast(object + 0x54); 150 | if (tag == 6) 151 | { 152 | auto object_class = *reinterpret_cast(object + 0x30); 153 | if (!object_class) 154 | return; 155 | 156 | auto entity = *reinterpret_cast(object_class + 0x18); 157 | if (!entity) 158 | return; 159 | 160 | auto player = *reinterpret_cast(entity + 0x28); 161 | if (!reinterpret_cast(player)) 162 | return; 163 | 164 | 165 | tempList.push_back(player); 166 | 167 | 168 | //variables::local_player->get_held_item()->set_rapid_fire(true); 169 | esp::render_esp(player); 170 | 171 | //variables::local_player->get_held_item()->set_rapid_fire(25.0f); 172 | 173 | // esp::WeaponFeatures(Ouritem); 174 | //esp::Weapon_Feature(player); 175 | } 176 | else 177 | { 178 | std::hash char_hash; 179 | const char* class_name = reinterpret_cast(classname_ptr); 180 | auto class_crc = char_hash(class_name); 181 | 182 | auto object_name = xorstr_("OreResourceEntity"); 183 | auto object_crc = char_hash(std::string_view(object_name, functions::my_strlen(object_name))); 184 | 185 | 186 | if (*(int*)(object_name + 46) == '_hsa') { 187 | 188 | } 189 | if(*(int*)(object_name + 52) == 'nots' || *(int*)(object_name + 47) == 'nots') 190 | { 191 | 192 | } 193 | continue; 194 | } 195 | } 196 | variables::player_list = tempList; 197 | 198 | return; 199 | } 200 | 201 | namespace ongui 202 | { 203 | bool left; 204 | bool right; 205 | 206 | std::vector combo = { "Normal Chams", "Holo Chams", "Transparent Chams", "Rainbow", "High Quality"}; 207 | int comboLeftSelected; 208 | int comboRightSelected; 209 | 210 | float sliderFloatLeft; 211 | float sliderFloatRight; 212 | 213 | int sliderIntLeft; 214 | int sliderIntRight; 215 | 216 | 217 | inline void ongui_hook(void* instance) 218 | { 219 | auto skin = functions::get_draw_skin(); 220 | variables::draw_label = *reinterpret_cast(skin + 0x38); 221 | functions::set_draw_alignment(variables::draw_label, 0x0); 222 | functions::set_draw_font_size(variables::draw_label, 12); 223 | functions::set_draw_color(Vector4(1, 1, 1, 1)); 224 | 225 | entity_loop(); 226 | //esp::render_esp(); 227 | 228 | 229 | //menu 230 | mid_framework::begin(xorstr_("EAC PRIVATE")); 231 | mid_framework::add_tab("Visuals", 0, 1); 232 | mid_framework::add_tab("Combat", 1, 2); 233 | mid_framework::add_tab("Misc", 2, 3); 234 | mid_framework::add_tab("Exploits", 3, 4); 235 | mid_framework::add_tab("Rage", 4, 5); 236 | 237 | if (mid_framework::selected == 0) 238 | { 239 | mid_framework::add_child(2); 240 | 241 | //checkmarks 242 | mid_framework::add_label("Player Visuals", 1); 243 | mid_framework::add_checkbox("Player Name", &left, 1); 244 | mid_framework::add_checkbox("Player Health", &left, 1); 245 | mid_framework::add_checkbox("Player Held Item", &left, 1); 246 | mid_framework::add_checkbox("Player Hotbar", &left, 1); 247 | mid_framework::add_checkbox("Snaplines", &left, 1); 248 | mid_framework::add_checkbox("Player Distance", &left, 1); 249 | mid_framework::add_checkbox("Chams", &left, 1); 250 | mid_framework::add_combo(combo, &comboLeftSelected, 1); 251 | mid_framework::add_checkbox("Visibility Check", &left, 1); 252 | mid_framework::add_checkbox("Knocked", &left, 1); 253 | mid_framework::add_checkbox("Sleeper", &left, 1); 254 | mid_framework::add_checkbox("NPC", &left, 1); 255 | // mid_framework::add_slider_float("Render Distance", &sliderFloatLeft, 50.0f, 1000.0f, 1); 256 | 257 | 258 | mid_framework::add_label("Item Visuals", 2); 259 | mid_framework::add_checkbox("Wood", &left, 2); 260 | mid_framework::add_checkbox("Stone", &left, 2); 261 | mid_framework::add_checkbox("Sulfer", &left, 2); 262 | mid_framework::add_checkbox("Metal", &left, 2); 263 | mid_framework::add_checkbox("Hemp", &left, 2); 264 | mid_framework::add_checkbox("Food", &left, 2); 265 | mid_framework::add_checkbox("Pickables", &left, 2); 266 | mid_framework::add_checkbox("Berrys", &left, 2); 267 | mid_framework::add_checkbox("Horses", &left, 2); 268 | mid_framework::add_checkbox("Wolfs", &left, 2); 269 | mid_framework::add_checkbox("Bears", &left, 2); 270 | mid_framework::add_checkbox("Deer", &left, 2); 271 | mid_framework::add_checkbox("Creates", &left, 2); 272 | mid_framework::add_slider_float("Render Distance", &sliderFloatLeft, 50.0f, 1000.0f, 2); 273 | 274 | 275 | 276 | 277 | 278 | 279 | } 280 | else if (mid_framework::selected == 1) 281 | { 282 | mid_framework::add_child(1); 283 | } 284 | else if (mid_framework::selected == 2) 285 | { 286 | mid_framework::add_child(1); 287 | } 288 | else if (mid_framework::selected == 3) 289 | { 290 | mid_framework::add_child(2); 291 | } 292 | else if (mid_framework::selected == 4) 293 | { 294 | mid_framework::add_child(1); 295 | } 296 | mid_framework::end(); 297 | 298 | functions::outline(Vector4(10, 10, 150, 20), xorstr_("cheat | private build"), Vector4(0, 0, 0, 1)); 299 | functions::label(Vector4(10, 10, 150, 20), xorstr_("cheat | private build"), Vector4(1, 1, 1, 1)); 300 | 301 | return; 302 | } 303 | 304 | static bool wakeup{ true }; 305 | uintptr_t performaceui_hook; 306 | void hk_performance_ui_update(void* instance) 307 | { 308 | if (wakeup) 309 | { 310 | auto game_object = il2cpp::methods::object_new(il2cpp::init_class(xorstr_("GameObject"), xorstr_("UnityEngine"))); 311 | functions::create(game_object, xorstr_("")); 312 | functions::add_component(game_object, il2cpp::type_object(xorstr_(""), xorstr_("DevControls"))); 313 | functions::dont_destroy_on_load(game_object); 314 | wakeup = false; 315 | } 316 | 317 | auto static update_performance_ui = reinterpret_cast(performaceui_hook); 318 | SpoofReturn(update_performance_ui, instance); 319 | } 320 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/performanceui.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "hinclude.h" 3 | #include "esp.h" 4 | #include "game/offsets.hpp" 5 | #include "Glob.hpp" 6 | #include "sky.hpp" 7 | #include "Misc.h" 8 | 9 | namespace options { 10 | bool chams; 11 | bool box; 12 | bool name; 13 | bool helditemname; 14 | bool Health; 15 | bool Distance; 16 | bool norecoil; 17 | bool admin; 18 | bool nosway; 19 | bool instaeoka; 20 | bool Water; 21 | bool fullauto; 22 | bool aimbot; 23 | bool moonJump; 24 | bool Shitaim; 25 | bool shootinair; 26 | bool extendedmelee; 27 | bool instabow; 28 | bool longeyes; 29 | bool dysnicfromserver; 30 | } 31 | float vr, vg, vb, nr, ng, nb; 32 | 33 | 34 | void sky_loop() 35 | { 36 | uintptr_t todsky; 37 | 38 | if (!todsky) 39 | { 40 | std::cout << "Not Working"; 41 | } 42 | auto instantsky = *reinterpret_cast(todsky + offsets::tod_sky_get_instance); 43 | 44 | if (!instantsky) 45 | { 46 | std::cout << "Instant not working"; 47 | } 48 | auto tod_atmosphereparameters = *reinterpret_cast(todsky + offsets::tod_atmosphereparameters); 49 | if (!tod_atmosphereparameters) 50 | { 51 | std::cout << "tod_atmosphereparameters Not Working"; 52 | } 53 | 54 | auto tod_dayparameters = *reinterpret_cast(todsky + offsets::tod_dayparameters); 55 | if (!tod_dayparameters) 56 | { 57 | std::cout << "tod_dayparameters Not Working"; 58 | } 59 | 60 | 61 | auto tod_dayparameters_ambientmultiplier = *reinterpret_cast(tod_dayparameters + offsets::tod_dayparameters_ambientmultiplier); 62 | if (!tod_dayparameters_ambientmultiplier) 63 | { 64 | std::cout << "tod_dayparameters_ambientmultiplier Not Working"; 65 | } 66 | auto tod_nightparameters = *reinterpret_cast(todsky + offsets::tod_nightparameters); 67 | if (!tod_nightparameters) 68 | { 69 | std::cout << "tod_nightparameters Not Working"; 70 | } 71 | 72 | auto tod_nightparameters_ambientmultiplier = *reinterpret_cast(tod_nightparameters + offsets::tod_nightparameters_ambientmultiplier); 73 | if (!tod_nightparameters_ambientmultiplier) 74 | { 75 | std::cout << "tod_nightparameters_ambientmultiplier Not Working"; 76 | } 77 | 78 | 79 | } 80 | void entity_loop() 81 | { 82 | variables::client_entities = il2cpp::value(xorstr_("BaseNetworkable"), xorstr_("clientEntities"), false); 83 | 84 | if (!variables::client_entities) 85 | { 86 | rust::LocalPlayer::ConsoleMessage(xorstr_("!client_entities")); 87 | return; 88 | } 89 | 90 | auto entity_realm = *reinterpret_cast(variables::client_entities + 0x10); 91 | if (!entity_realm) 92 | { 93 | return; 94 | } 95 | 96 | auto buffer_list = *reinterpret_cast(entity_realm + 0x28); 97 | if (!buffer_list) 98 | { 99 | return; 100 | } 101 | 102 | auto object_list_size = *reinterpret_cast(buffer_list + 0x10); 103 | 104 | auto object_list = *reinterpret_cast(buffer_list + 0x18); 105 | if (!object_list) 106 | { 107 | return; 108 | } 109 | 110 | std::vector tempList; 111 | 112 | 113 | 114 | for (int idx = 0; idx < object_list_size; idx++) 115 | { 116 | auto current_object = *reinterpret_cast(object_list + (0x20 + (idx * sizeof(uint64_t)))); 117 | if (!current_object) 118 | { 119 | continue; 120 | } 121 | 122 | auto object_unk = *reinterpret_cast(current_object); 123 | if (!object_unk) 124 | { 125 | continue; 126 | } 127 | 128 | auto classname_ptr = *reinterpret_cast(object_unk + 0x10); 129 | if (!classname_ptr) 130 | { 131 | continue; 132 | } 133 | 134 | auto base_object = *reinterpret_cast(current_object + 0x10); 135 | if (!base_object) 136 | { 137 | continue; 138 | } 139 | 140 | auto object = *reinterpret_cast(base_object + 0x30); 141 | if (!object) 142 | { 143 | continue; 144 | } 145 | 146 | if (idx == 0) 147 | { 148 | auto local_player_object_class = *reinterpret_cast(object + 0x30); 149 | 150 | if (!local_player_object_class) 151 | { 152 | continue; 153 | } 154 | 155 | auto local_entity = *reinterpret_cast(local_player_object_class + 0x18); 156 | 157 | if (!local_entity) 158 | { 159 | continue; 160 | } 161 | 162 | variables::local_player = *reinterpret_cast(local_entity + 0x28); 163 | 164 | if (variables::local_player->get_life_state()) 165 | { 166 | continue; 167 | } 168 | 169 | variables::local_position = variables::local_player->get_visual_position(local_player_object_class); 170 | continue; 171 | } 172 | 173 | functions::update_view_matrix(); 174 | 175 | const auto tag = *reinterpret_cast(object + 0x54); 176 | if (tag == 6) 177 | { 178 | auto object_class = *reinterpret_cast(object + 0x30); 179 | if (!object_class) 180 | return; 181 | 182 | auto entity = *reinterpret_cast(object_class + 0x18); 183 | if (!entity) 184 | return; 185 | 186 | auto player = *reinterpret_cast(entity + 0x28); 187 | if (!reinterpret_cast(player)) 188 | return; 189 | 190 | 191 | tempList.push_back(player); 192 | 193 | 194 | } 195 | else 196 | { 197 | std::hash char_hash; 198 | const char* class_name = reinterpret_cast(classname_ptr); 199 | auto class_crc = char_hash(class_name); 200 | 201 | auto object_name = xorstr_("OreResourceEntity"); 202 | auto object_crc = char_hash(std::string_view(object_name, functions::my_strlen(object_name))); 203 | 204 | } 205 | } 206 | variables::player_list = tempList; 207 | 208 | return; 209 | } 210 | 211 | namespace PerformanceUI 212 | { 213 | bool left; 214 | bool right; 215 | 216 | bool sleeper; 217 | bool knocked; 218 | int comboLeftSelected; 219 | int comboRightSelected; 220 | 221 | float sliderFloatLeft; 222 | float sliderFloatRight; 223 | 224 | int sliderIntLeft; 225 | int sliderIntRight; 226 | 227 | std::vector Vis = { "Red", "Green", "Blue", "Purple" }; 228 | std::vector nonoVis = { "Red", "Green", "Blue", "Purple" }; 229 | std::vector BoneSelection = { "Head", "Neck", "Pelvis", "Dick" }; 230 | int Bones; 231 | int nonvis; 232 | int vis; 233 | BoneList Aimbotbone; 234 | 235 | inline void ongui_hook(void* instance) 236 | { 237 | if (Bones == 0) 238 | { 239 | Aimbotbone == head; 240 | } 241 | if (Bones == 1) 242 | { 243 | Aimbotbone == neck; 244 | } 245 | if (Bones == 2) 246 | { 247 | Aimbotbone == pelvis; 248 | } 249 | if (Bones == 3) 250 | { 251 | Aimbotbone == penis; 252 | } 253 | if (vis == 0) 254 | { 255 | vr = 200.0f; 256 | vg = 0.0f; 257 | vb = 55.0f; 258 | } 259 | 260 | if (vis == 1) 261 | { 262 | vr = 0.0f; 263 | vg = 230.0f; 264 | vb = 75.0f; 265 | } 266 | 267 | if (vis == 2) 268 | { 269 | vr = 0.0f; 270 | vg = 100.0f; 271 | vb = 200.0f; 272 | } 273 | 274 | if (vis == 3) 275 | { 276 | vr = 100.0f; 277 | vg = 0.0f; 278 | vb = 255.0f; 279 | } 280 | 281 | 282 | if (nonvis == 0) 283 | { 284 | nr = 255.0f; 285 | ng = 0.0f; 286 | ng = 0.0f; 287 | } 288 | 289 | if (nonvis == 1) 290 | { 291 | nr = 0.0f; 292 | ng = 255.0f; 293 | nb = 0.0f; 294 | } 295 | 296 | if (nonvis == 2) 297 | { 298 | nr = 0.0f; 299 | ng = 100.0f; 300 | nb = 200.0f; 301 | } 302 | 303 | if (nonvis == 3) 304 | { 305 | nr = 100.0f; 306 | ng = 0.0f; 307 | nb = 255.0f; 308 | } 309 | auto skin = functions::get_draw_skin(); 310 | variables::draw_label = *reinterpret_cast(skin + 0x38); 311 | functions::set_draw_alignment(variables::draw_label, 0x0); 312 | functions::set_draw_font_size(variables::draw_label, 12); 313 | functions::set_draw_color(Vector4(1, 1, 1, 1)); 314 | 315 | entity_loop(); 316 | //esp::render_esp(); 317 | 318 | 319 | //menu 320 | mid_framework::begin(xorstr_("WinVer#3625 - Rust")); 321 | //mid_framework::add_tab(xorstr_("Visuals"), 0, 1); 322 | //mid_framework::add_tab(xorstr_("Combat"), 1, 2); 323 | 324 | //if (mid_framework::selected == 0) 325 | //{ 326 | mid_framework::add_child(1); 327 | 328 | //checkmarks 329 | mid_framework::add_checkbox(xorstr_("Draw Player Box"), &options::box, 1); 330 | mid_framework::add_checkbox(xorstr_("Draw Player Name"), &options::name, 1); 331 | mid_framework::add_checkbox(xorstr_("Draw Player Health"), &options::Health, 1); 332 | mid_framework::add_checkbox(xorstr_("Draw Player Held Item"), &options::helditemname, 1); 333 | mid_framework::add_checkbox(xorstr_("Draw Player Distance"), &options::Distance, 1); 334 | mid_framework::add_checkbox(xorstr_("Draw Sleepers"), &sleeper, 1); 335 | mid_framework::add_checkbox(xorstr_("Draw Knocked"), &knocked, 1); 336 | mid_framework::add_checkbox(xorstr_("Draw Player Chams"), &options::chams, 1); 337 | mid_framework::add_checkbox(xorstr_("Draw Long Eyes (Key Arrows)"), &options::longeyes, 1); 338 | mid_framework::add_checkbox(xorstr_("Draw DeSync (SEMI-SAFE)"), &options::dysnicfromserver, 1); 339 | mid_framework::add_checkbox(xorstr_("Toggle Safe Admin (SEMI SAFE)"), &options::admin, 1); 340 | mid_framework::add_label(xorstr_("VISIBLE"), 1); 341 | mid_framework::add_combo(Vis, &vis, 1); 342 | mid_framework::add_label(xorstr_("INVISIBLE"), 1); 343 | mid_framework::add_combo(nonoVis, &nonvis, 1); 344 | //mid_framework::add_slider_float(xorstr_("Render Distance"), &sliderFloatLeft, 50.0f, 1000.0f, 1); 345 | 346 | 347 | 348 | 349 | //} 350 | //else if (mid_framework::selected == 1) 351 | //{ 352 | // mid_framework::add_label(xorstr_("AIMBOT IS IN TESTING!"), 1); 353 | // mid_framework::add_child(1); 354 | // mid_framework::add_checkbox(xorstr_("Enable Aimbot (Side Mouse)"), &options::aimbot, 1); 355 | // mid_framework::add_checkbox(xorstr_("Enable No Recoil"), &options::norecoil, 1); 356 | // mid_framework::add_checkbox(xorstr_("Enable No Sway"), &options::nosway, 1); 357 | // mid_framework::add_checkbox(xorstr_("Enable Insta Eoka"), &options::instaeoka, 1); 358 | // mid_framework::add_checkbox(xorstr_("Enable Full Auto"), &options::fullauto, 1); 359 | // mid_framework::add_checkbox(xorstr_("Enable Fast Bow"), &options::instabow, 1); 360 | // mid_framework::add_checkbox(xorstr_("Enable Extended Melee"), &options::extendedmelee, 1); 361 | 362 | // mid_framework::add_combo(BoneSelection, &Bones, 1); 363 | 364 | // mid_framework::add_checkbox(xorstr_("Enable Moon Jump"), &options::moonJump, 1); 365 | // mid_framework::add_checkbox(xorstr_("Enable Shoot In Any State"), &options::shootinair, 1); 366 | // mid_framework::add_checkbox(xorstr_("Enable Water Walk"), &options::Water, 1); 367 | 368 | 369 | //} 370 | mid_framework::end(); 371 | 372 | functions::outline(Vector4(10, 10, 150, 20), xorstr_("Message WinVer#3625"), Vector4(0, 0, 0, 1)); 373 | functions::label(Vector4(10, 10, 150, 20), xorstr_("Message WinVer#3625"), Vector4(1, 1, 1, 1)); 374 | 375 | 376 | 377 | for (int i = 0; i < variables::player_list.size(); i++) 378 | { 379 | auto player = variables::player_list[i]; 380 | if (!knocked) 381 | { 382 | if (player->is_knocked()) 383 | continue; 384 | } 385 | if (!sleeper) 386 | { 387 | if (player->is_sleeping()) 388 | continue; 389 | 390 | } 391 | if (player->is_same_team(player)) 392 | continue; 393 | 394 | 395 | 396 | 397 | if (options::chams) { esp::do_chams(player, vr, vg, vb, nr, ng, nb); } 398 | if (options::box) { esp::render_box(player); } 399 | if (options::name) { esp::render_name(player); } 400 | if (options::helditemname) { esp::render_weapon(player); } 401 | if (options::Health) { esp::render_Health(player); } 402 | if (options::Distance) { esp::render_distance(player); } 403 | if (options::aimbot) { esp::render_aimbot(player, Aimbotbone); } 404 | //if (options::Shitaim) { esp::render_shitaim(player, Aimbotbone); } 405 | 406 | 407 | } 408 | 409 | if (options::norecoil) { esp::NoRecoil(); } 410 | if (options::fullauto) { esp::FullAuto(); } 411 | if (options::nosway) { esp::nosway(); } 412 | if (options::instaeoka) { esp::instaEoka(); } 413 | if (options::admin) { esp::SafeAdmin(); } 414 | if (options::moonJump) { esp::MoonJump(); } 415 | if (options::Water) { esp::WalkOnWalter(); } 416 | if (options::shootinair) { esp::ShootWhileInAir(); } 417 | if (options::extendedmelee) { esp::ExterndMelee(); } 418 | if (options::instabow) { esp::fastbow(); } 419 | if (options::longeyes) { esp::longeye(); } 420 | if (options::dysnicfromserver) { esp::Dysnic(); } 421 | 422 | 423 | 424 | 425 | return; 426 | } 427 | 428 | 429 | 430 | static bool wakeup{ true }; 431 | uintptr_t performaceui_hook; 432 | void hk_performance_ui_update(void* instance) 433 | { 434 | if (wakeup) 435 | { 436 | auto game_object = il2cpp::methods::object_new(il2cpp::init_class(xorstr_("GameObject"), xorstr_("UnityEngine"))); 437 | functions::create(game_object, xorstr_("")); 438 | functions::add_component(game_object, il2cpp::type_object(xorstr_(""), xorstr_("DevControls"))); 439 | functions::dont_destroy_on_load(game_object); 440 | wakeup = false; 441 | } 442 | 443 | auto static update_performance_ui = reinterpret_cast(performaceui_hook); 444 | SpoofReturn(update_performance_ui, instance); 445 | } 446 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/rust 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 | {0678ec97-c0f5-4f7a-a230-561a65f33499} 25 | rust base 26 | 10.0 27 | rust base 28 | 29 | 30 | 31 | Application 32 | true 33 | v143 34 | Unicode 35 | 36 | 37 | Application 38 | false 39 | v143 40 | true 41 | Unicode 42 | 43 | 44 | Application 45 | true 46 | v143 47 | MultiByte 48 | false 49 | 50 | 51 | DynamicLibrary 52 | true 53 | v143 54 | true 55 | MultiByte 56 | false 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | $(ProjectName) 79 | $(SolutionDir)$(Platform)\$(Configuration)\ 80 | C:\Users\Shadow\Desktop\Bypasses\injector;$(IncludePath) 81 | C:\Users\Shadow\Desktop\Bypasses\injector\x64\Release;$(LibraryPath) 82 | 83 | 84 | 85 | Level3 86 | true 87 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 88 | true 89 | 90 | 91 | Console 92 | true 93 | 94 | 95 | 96 | 97 | Level3 98 | true 99 | true 100 | true 101 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 102 | true 103 | 104 | 105 | Console 106 | true 107 | true 108 | true 109 | 110 | 111 | 112 | 113 | Level3 114 | true 115 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 116 | true 117 | stdcpp20 118 | stdc17 119 | 120 | 121 | Console 122 | true 123 | 124 | 125 | 126 | 127 | Level3 128 | true 129 | true 130 | true 131 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 132 | true 133 | stdcpp20 134 | stdc17 135 | MinSpace 136 | MultiThreaded 137 | None 138 | Default 139 | 140 | 141 | Console 142 | true 143 | true 144 | true 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 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 | true 184 | 185 | 186 | 187 | 188 | -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/rust 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 | {844e9c29-76ef-4dfa-be0b-2aafc7ad1f0e} 18 | 19 | 20 | {5ef89ec2-c694-4470-b1d2-2a7dc93605b3} 21 | 22 | 23 | {99384470-5e29-42eb-9d29-be0063c3694a} 24 | 25 | 26 | {5a2ce6d9-2570-485c-911c-f26308ab9c95} 27 | 28 | 29 | {ee1b8dc2-c8d6-44d9-86fe-31e0d5d15f9f} 30 | 31 | 32 | {863337e4-8c56-40db-9871-7a732b3a20e3} 33 | 34 | 35 | {7a6fdb0d-b06e-4e39-aa73-54d2502186ee} 36 | 37 | 38 | {e2df53a4-6369-4c26-8e4d-4b410ca6611e} 39 | 40 | 41 | {b543191b-9993-4a82-a126-4054c5afe2c8} 42 | 43 | 44 | {8b134599-ae05-4296-a1b4-40582b2e696d} 45 | 46 | 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files\utils 53 | 54 | 55 | Source Files\utils 56 | 57 | 58 | Source Files\utils 59 | 60 | 61 | Source Files\utils 62 | 63 | 64 | Source Files\game 65 | 66 | 67 | Source Files\features 68 | 69 | 70 | Source Files\features 71 | 72 | 73 | Source Files\features 74 | 75 | 76 | Source Files\features 77 | 78 | 79 | 80 | 81 | Header Files 82 | 83 | 84 | Header Files\game 85 | 86 | 87 | Header Files\game 88 | 89 | 90 | Header Files\game 91 | 92 | 93 | Header Files\utils 94 | 95 | 96 | Header Files\utils 97 | 98 | 99 | Header Files\utils 100 | 101 | 102 | Header Files\utils 103 | 104 | 105 | Header Files\utils 106 | 107 | 108 | Header Files\utils 109 | 110 | 111 | Header Files\utils 112 | 113 | 114 | Header Files\hooks 115 | 116 | 117 | Header Files\hooks\performanceui 118 | 119 | 120 | Header Files\hooks\baseplayer 121 | 122 | 123 | Header Files\features 124 | 125 | 126 | Header Files\features 127 | 128 | 129 | Header Files\utils 130 | 131 | 132 | Header Files\features 133 | 134 | 135 | Header Files\hooks\ddraw 136 | 137 | 138 | Header Files\features 139 | 140 | 141 | -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/rust base.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | false 5 | 6 | -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/sky.cpp: -------------------------------------------------------------------------------- 1 | #include "sky.hpp" 2 | #include "../rust base/utils/memory.hpp" 3 | #include "../rust base/game/offsets.hpp" 4 | #include 5 | #include "Glob.hpp" 6 | 7 | namespace sky { 8 | void sky(rust::TOD_Sky SKY) 9 | { 10 | SKY.get_instance(); 11 | } 12 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/sky.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "includes.hpp" 3 | #include "game/classes.hpp" 4 | 5 | namespace sky { 6 | void sky(rust::TOD_Sky SKY); 7 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/utils/math.cpp: -------------------------------------------------------------------------------- 1 | #include "math.hpp" 2 | 3 | #define M_PI_2 1.57079632679489661923 4 | #define M_PI 3.14159265358979323846f 5 | #define M_RADPI 57.295779513082f 6 | #define M_PI_F ((float)(M_PI)) 7 | #define RAD2DEG(x) ((float)(x) * (float)(180.f / M_PI_F)) 8 | #define DEG2RAD(x) ((float)(x) * (float)(M_PI_F / 180.f)) 9 | //#define min(a,b) (((a) < (b)) ? (a) : (b)) 10 | #define powww(a) (a) * (a) 11 | //#define atan2(a, b) ((float)FC_NTDLL(atan2, (double)(a), (double)(b))) 12 | static volatile const double Tiny = 0x1p-1022; 13 | static volatile const double Infinity = INFINITY; 14 | unsigned short lfsr = 0xACE1u; 15 | unsigned int bit = 0; 16 | 17 | using namespace Math; 18 | 19 | 20 | static inline double2 Math::Mul112(double a, double b) 21 | { 22 | static const double c = 0x1p27 + 1; 23 | 24 | double 25 | ap = a * c, bp = b * c, 26 | a0 = (a - ap) + ap, b0 = (b - bp) + bp, 27 | a1 = a - a0, b1 = b - b0, 28 | d0 = a * b, 29 | d1 = a0 * b0 - d0 + a0 * b1 + a1 * b0 + a1 * b1; 30 | return double2{ d0, d1 }; 31 | } 32 | 33 | static inline double2 Math::Mul222(double2 a, double2 b) 34 | { 35 | static const double c = 0x1p27 + 1; 36 | 37 | double 38 | ap = a.d0 * c, bp = b.d0 * c, 39 | a0 = (a.d0 - ap) + ap, b0 = (b.d0 - bp) + bp, 40 | a1 = a.d0 - a0, b1 = b.d0 - b0, 41 | m0 = a.d0 * b.d0, 42 | m1 = a0 * b0 - m0 + a0 * b1 + a1 * b0 + a1 * b1 + (a.d0 * b.d1 + a.d1 * b.d0), 43 | d0 = m0 + m1, 44 | d1 = m0 - d0 + m1; 45 | return double2{ d0, d1 }; 46 | } 47 | 48 | static inline double Math::Mul121Special(double a, double2 b) 49 | { 50 | static const double c = 0x1p27 + 1; 51 | 52 | double 53 | ap = a * c, bp = b.d0 * c, 54 | a0 = (a - ap) + ap, b0 = (b.d0 - bp) + bp, 55 | a1 = a - a0, b1 = b.d0 - b0, 56 | m1 = a0 * b0 - 1 + a0 * b1 + a1 * b0 + a1 * b1 + a * b.d1; 57 | return m1; 58 | } 59 | 60 | static inline double2 Math::Add212RightSmaller(double2 a, double b) 61 | { 62 | double 63 | c0 = a.d0 + b, 64 | c1 = a.d0 - c0 + b + a.d1, 65 | d0 = c0 + c1, 66 | d1 = c0 - d0 + c1; 67 | return double2{ d0, d1 }; 68 | } 69 | 70 | static inline double Math::Add221RightSmaller(double2 a, double2 b) 71 | { 72 | double 73 | c0 = a.d0 + b.d0, 74 | c1 = a.d0 - c0 + b.d0 + b.d1 + a.d1, 75 | d0 = c0 + c1; 76 | return d0; 77 | } 78 | 79 | double Math::atan(double x) 80 | { 81 | // Return arctangent(x) given that 5/3 < x <= 2, with the same properties as atan. 82 | auto atani5 = [](double x) { 83 | constexpr double p00 = +0x1.124A85750FB5Cp+00; 84 | constexpr double p01 = +0x1.D59AE78C11C49p-03; 85 | constexpr double p02 = -0x1.8AD3C44F10DC3p-04; 86 | constexpr double p03 = +0x1.2B090AAD5F9DCp-05; 87 | constexpr double p04 = -0x1.881EC3D15241Fp-07; 88 | constexpr double p05 = +0x1.8CB82A74E0699p-09; 89 | constexpr double p06 = -0x1.3182219E21362p-12; 90 | constexpr double p07 = -0x1.2B9AD13DB35A8p-12; 91 | constexpr double p08 = +0x1.10F884EAC0E0Ap-12; 92 | constexpr double p09 = -0x1.3045B70E93129p-13; 93 | constexpr double p10 = +0x1.00B6A460AC05Dp-14; 94 | 95 | double y = x - 0x1.d555555461337p0; 96 | 97 | return ((((((((((+p10) * y + p09) * y + p08) * y + p07) * y + p06) * y + 98 | p05) * 99 | y + 100 | p04) * 101 | y + 102 | p03) * 103 | y + 104 | p02) * 105 | y + 106 | p01) * 107 | y + 108 | p00; 109 | }; 110 | // Return arctangent(x) given that 4/3 < x <= 5/3, with the same properties as 111 | // atan. 112 | auto atani4 = [](double x) { 113 | constexpr double p00 = +0x1730BD281F69Dp-01; 114 | constexpr double p01 = +0x1.3B13B13B13B0Cp-02; 115 | constexpr double p02 = -0x1.22D719C06115Ep-03; 116 | constexpr double p03 = +0x1.C963C83985742p-05; 117 | constexpr double p04 = -0x1.135A0938EC462p-06; 118 | constexpr double p05 = +0x1.13A254D6E5B7Cp-09; 119 | constexpr double p06 = +0x1.DFAA5E77B7375p-10; 120 | constexpr double p07 = -0x14AC1342182D2p-10; 121 | constexpr double p08 = +0x1.25BAD4D85CBE1p-10; 122 | constexpr double p09 = -0x1.E4EEF429EB680p-12; 123 | constexpr double p10 = +0x1.B4E30D1BA3819p-14; 124 | constexpr double p11 = +0x1.0280537F097F3p-15; 125 | 126 | double y = x - 0x1.8000000000003p0; 127 | 128 | return (((((((((((+p11) * y + p10) * y + p09) * y + p08) * y + p07) * y + 129 | p06) * 130 | y + 131 | p05) * 132 | y + 133 | p04) * 134 | y + 135 | p03) * 136 | y + 137 | p02) * 138 | y + 139 | p01) * 140 | y + 141 | p00; 142 | }; 143 | // Return arctangent(x) given that 1 < x <= 4 / 3, with the same properties as 144 | // atan. 145 | auto atani3 = [](double x) { 146 | constexpr double p00 = +0x1.B96E5A78C5C40p-01; 147 | constexpr double p01 = +0x1.B1B1B1B1B1B3Dp-02; 148 | constexpr double p02 = -0x1.AC97826D58470p-03; 149 | constexpr double p03 = +0x1.3FD2B9F586A67p-04; 150 | constexpr double p04 = -0x1.BC317394714B7p-07; 151 | constexpr double p05 = -0x1.2B01FC60CC37Ap-07; 152 | constexpr double p06 = +0x1.73A9328786665p-07; 153 | constexpr double p07 = -0x1.C0B993A09CE31p-08; 154 | constexpr double p08 = +0x1.2FCDACDD6E5B5p-09; 155 | constexpr double p09 = +0x1.CBD49DA316282p-13; 156 | constexpr double p10 = -0x1.0120E602F6336p-10; 157 | constexpr double p11 = +0x1.A89224FF69018p-11; 158 | constexpr double p12 = -0x1.883D8959134B3p-12; 159 | 160 | double y = x - 0x1.2aaaaaaaaaa96p0; 161 | 162 | return ((((((((((((+p12) * y + p11) * y + p10) * y + p09) * y + p08) * y + 163 | p07) * 164 | y + 165 | p06) * 166 | y + 167 | p05) * 168 | y + 169 | p04) * 170 | y + 171 | p03) * 172 | y + 173 | p02) * 174 | y + 175 | p01) * 176 | y + 177 | p00; 178 | }; 179 | // Return arctangent(x) given that 3 / 4 < x <= 1, with the same properties as 180 | // atan. 181 | auto atani2 = [](double x) { 182 | constexpr double p00 = +0x1.700A7C580EA7Ep-01; 183 | constexpr double p01 = +0x1.21FB781196AC3p-01; 184 | constexpr double p02 = -0x1.1F6A8499714A2p-02; 185 | constexpr double p03 = +0x1.41B15E5E8DCD0p-04; 186 | constexpr double p04 = +0x1.59BC93F81895Ap-06; 187 | constexpr double p05 = -0x1.63B543EFFA4EFp-05; 188 | constexpr double p06 = +0x1.C90E92AC8D86Cp-06; 189 | constexpr double p07 = -0x1.91F7E2A7A338Fp-08; 190 | constexpr double p08 = -0x1.AC1645739E676p-08; 191 | constexpr double p09 = +0x1.152311B180E6Cp-07; 192 | constexpr double p10 = -0x1.265EF51B17DB7p-08; 193 | constexpr double p11 = +0x1.CA7CDE5DE9BD7p-14; 194 | 195 | double y = x - 0x1.c0000000f4213p-1; 196 | 197 | return (((((((((((+p11) * y + p10) * y + p09) * y + p08) * y + p07) * y + 198 | p06) * 199 | y + 200 | p05) * 201 | y + 202 | p04) * 203 | y + 204 | p03) * 205 | y + 206 | p02) * 207 | y + 208 | p01) * 209 | y + 210 | p00; 211 | }; 212 | // Return arctangent(x) given that 1/2 < x <= 3/4, with the same properties as 213 | // atan. 214 | auto atani1 = [](double x) { 215 | constexpr double p00 = +0x1.1E00BABDEFED0p-1; 216 | constexpr double p01 = +0x1.702E05C0B8155p-1; 217 | constexpr double p02 = -0x1.4AF2B78215A1Bp-2; 218 | constexpr double p03 = +0x1.5D0B7E9E69054p-6; 219 | constexpr double p04 = +0x1.A1247CA5D9475p-4; 220 | constexpr double p05 = -0x1.519E110F61B54p-4; 221 | constexpr double p06 = +0x1.A759263F377F2p-7; 222 | constexpr double p07 = +0x1.094966BE2B531p-5; 223 | constexpr double p08 = -0x1.09BC0AB7F914Cp-5; 224 | constexpr double p09 = +0x1F3B7C531AA4Ap-8; 225 | constexpr double p10 = +0x1.950E69DCDD967p-7; 226 | constexpr double p11 = -0x1.D88D31ABC3AE5p-7; 227 | constexpr double p12 = +0x1.10F3E20F6A2E2p-8; 228 | 229 | double y = x - 0x1.4000000000027p-1; 230 | 231 | return ((((((((((((+p12) * y + p11) * y + p10) * y + p09) * y + p08) * y + 232 | p07) * 233 | y + 234 | p06) * 235 | y + 236 | p05) * 237 | y + 238 | p04) * 239 | y + 240 | p03) * 241 | y + 242 | p02) * 243 | y + 244 | p01) * 245 | y + 246 | p00; 247 | }; 248 | // Return arctangent(x) given that 0x1p-27 < |x| <= 1/2, with the same properties 249 | // as atan. 250 | auto atani0 = [](double x) { 251 | constexpr double p03 = -0x1.555555555551Bp-2; 252 | constexpr double p05 = +0x1.99999999918D8p-3; 253 | constexpr double p07 = -0x1.2492492179CA3p-3; 254 | constexpr double p09 = +0x1.C71C7096C2725p-4; 255 | constexpr double p11 = -0x1.745CF51795B21p-4; 256 | constexpr double p13 = +0x1.3B113F18AC049p-4; 257 | constexpr double p15 = -0x1.10F31279EC05Dp-4; 258 | constexpr double p17 = +0x1.DFE7B9674AE37p-5; 259 | constexpr double p19 = -0x1.A38CF590469ECp-5; 260 | constexpr double p21 = +0x1.56CDB5D887934p-5; 261 | constexpr double p23 = -0x1.C0EB85F543412p-6; 262 | constexpr double p25 = +0x1.4A9F5C4724056p-7; 263 | 264 | // Square x. 265 | double x2 = x * x; 266 | 267 | return ((((((((((((+p25) * x2 + p23) * x2 + p21) * x2 + p19) * x2 + p17) * 268 | x2 + 269 | p15) * 270 | x2 + 271 | p13) * 272 | x2 + 273 | p11) * 274 | x2 + 275 | p09) * 276 | x2 + 277 | p07) * 278 | x2 + 279 | p05) * 280 | x2 + 281 | p03) * 282 | x2 * x + 283 | x; 284 | }; 285 | // Return arctangent(x) given that 2 < x, with the same properties as atan. 286 | auto Tail = [](double x) { 287 | { 288 | constexpr double HalfPi = 0x3.243f6a8885a308d313198a2e037ap-1; 289 | 290 | // For large x, generate inexact and return pi/2. 291 | if (0x1p53 <= x) 292 | return HalfPi + DBL_EPSILON; 293 | if (x != x) // isnan 294 | return x - x; 295 | } 296 | 297 | constexpr double p03 = -0x1.5555555554A51p-2; 298 | constexpr double p05 = +0x1.999999989EBCAp-3; 299 | constexpr double p07 = -0x1.249248E1422E3p-3; 300 | constexpr double p09 = +0x1.C71C5EDFED480p-4; 301 | constexpr double p11 = -0x1.745B7F2D72663p-4; 302 | constexpr double p13 = +0x1.3AFD7A0E6EB75p-4; 303 | constexpr double p15 = -0x1.104146B1A1AE8p-4; 304 | constexpr double p17 = +0x1.D78252FA69C1Cp-5; 305 | constexpr double p19 = -0x1.81D33E401836Dp-5; 306 | constexpr double p21 = +0x1.007733E06CEB3p-5; 307 | constexpr double p23 = -0x1.83DAFDA7BD3FDp-7; 308 | 309 | constexpr double p000 = +0x1.921FB54442D18p0; 310 | constexpr double p001 = +0x1.1A62633145C07p-54; 311 | 312 | double y = 1 / x; 313 | 314 | // Square y. 315 | double y2 = y * y; 316 | 317 | return p001 - 318 | ((((((((((((+p23) * y2 + p21) * y2 + p19) * y2 + p17) * y2 + p15) * 319 | y2 + 320 | p13) * 321 | y2 + 322 | p11) * 323 | y2 + 324 | p09) * 325 | y2 + 326 | p07) * 327 | y2 + 328 | p05) * 329 | y2 + 330 | p03) * 331 | y2 * y + 332 | y) + 333 | p000; 334 | }; 335 | 336 | if (x < 0) 337 | if (x < -1) 338 | if (x < -5 / 3.) 339 | if (x < -2) 340 | return -Tail(-x); 341 | else 342 | return -atani5(-x); 343 | else if (x < -4 / 3.) 344 | return -atani4(-x); 345 | else 346 | return -atani3(-x); 347 | else if (x < -.5) 348 | if (x < -.75) 349 | return -atani2(-x); 350 | else 351 | return -atani1(-x); 352 | else if (x < -0x1.d12ed0af1a27fp-27) 353 | return atani0(x); 354 | else if (x <= -0x1p-1022) 355 | // Generate inexact and return x. 356 | return (DBL_EPSILON + 1) * x; 357 | else if (x == 0) 358 | return x; 359 | else 360 | // Generate underflow and return x. 361 | return x * DBL_EPSILON + x; 362 | else if (x <= +1) 363 | if (x <= +.5) 364 | if (x <= +0x1.d12ed0af1a27fp-27) 365 | if (x < +0x1p-1022) 366 | if (x == 0) 367 | return x; 368 | else 369 | // Generate underflow and return x. 370 | return x * DBL_EPSILON + x; 371 | else 372 | // Generate inexact and return x. 373 | return (DBL_EPSILON + 1) * x; 374 | else 375 | return atani0(x); 376 | else if (x <= +.75) 377 | return +atani1(+x); 378 | else 379 | return +atani2(+x); 380 | else if (x <= +5 / 3.) 381 | if (x <= +4 / 3.) 382 | return +atani3(+x); 383 | else 384 | return +atani4(+x); 385 | else if (x <= +2) 386 | return +atani5(+x); 387 | else 388 | return +Tail(+x); 389 | } 390 | 391 | float Math::my_atan2(float y, float x) 392 | { 393 | // https://en.wikipedia.org/wiki/Atan2#Definition (A compact expression with four 394 | // overlapping half-planes is: ...) 395 | if (x == 0) { 396 | if (y > 0.0f) 397 | return M_PI_2; 398 | else if (y < 0.0f) 399 | return -M_PI_2; 400 | return 0; 401 | } 402 | else if (x > 0) 403 | return atan(y / x); 404 | else if (x < 0) 405 | return M_PI + atan(y / x); 406 | else if (y > 0) 407 | return M_PI_2 - atan(y / x); 408 | else if (y < 0) 409 | return -M_PI_2 - atan(y / x); 410 | return 0; 411 | } 412 | 413 | float Math::abs(float a) 414 | { 415 | if (a < 0.f) return -a; 416 | else return a; 417 | } 418 | 419 | float Math::my_asin(float x) 420 | { 421 | float negate = float(x < 0); 422 | x = abs(x); 423 | float ret = -0.0187293; 424 | ret *= x; 425 | ret += 0.0742610; 426 | ret *= x; 427 | ret -= 0.2121144; 428 | ret *= x; 429 | ret += 1.5707288; 430 | ret = 3.14159265358979 * 0.5 - sqrt(1.0 - x) * ret; 431 | return ret - 2 * negate * ret; 432 | } 433 | 434 | float Math::sqrt(float number) 435 | { 436 | long i; 437 | float x2, y; 438 | const float threehalfs = 1.5F; 439 | 440 | x2 = number * 0.5F; 441 | y = number; 442 | i = *(long*)&y; // floating point bit level hacking [sic] 443 | i = 0x5f3759df - (i >> 1); // Newton's approximation 444 | y = *(float*)&i; 445 | y = y * (threehalfs - (x2 * y * y)); // 1st iteration 446 | y = y * (threehalfs - (x2 * y * y)); // 2nd iteration 447 | 448 | return 1 / y; 449 | } 450 | 451 | float Math::sin(float x) 452 | { 453 | // useful to pre-calculate 454 | double x2 = x * x; 455 | double x4 = x2 * x2; 456 | 457 | // Calculate the terms 458 | // As long as abs(x) < sqrt(6), which is 2.45, all terms will be positive. 459 | // Values outside this range should be reduced to [-pi/2, pi/2] anyway for 460 | // accuracy. Some care has to be given to the factorials. They can be 461 | // pre-calculated by the compiler, but the value for the higher ones will exceed 462 | // the storage capacity of int. so force the compiler to use unsigned long longs 463 | // (if available) or doubles. 464 | double t1 = x * (1.0 - x2 / (2 * 3)); 465 | double x5 = x * x4; 466 | double t2 = x5 * (1.0 - x2 / (6 * 7)) / (1.0 * 2 * 3 * 4 * 5); 467 | double x9 = x5 * x4; 468 | double t3 = x9 * (1.0 - x2 / (10 * 11)) / (1.0 * 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9); 469 | double x13 = x9 * x4; 470 | double t4 = x13 * (1.0 - x2 / (14 * 15)) / 471 | (1.0 * 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10 * 11 * 12 * 13); 472 | double x14 = x13 * x4; 473 | double t5 = 474 | x14 * (1.0 - x2 / (18 * 19)) / 475 | (1.0 * 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10 * 11 * 12 * 13 * 14 * 15 * 16 * 17); 476 | double x15 = x14 * x4; 477 | double t6 = x15 * (1.0 - x2 / (22 * 23)) / 478 | (1.0 * 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10 * 11 * 12 * 13 * 14 * 15 * 479 | 16 * 17 * 18 * 19 * 20 * 21); 480 | // add some more if your accuracy requires them. 481 | // But remember that x is smaller than 2, and the factorial grows very fast 482 | // so I doubt that 2^17 / 17! will add anything. 483 | // Even t4 might already be too small to matter when compared with t1. 484 | 485 | // Sum backwards 486 | double result = t6; 487 | result += t5; 488 | result += t4; 489 | result += t3; 490 | result += t2; 491 | result += t1; 492 | 493 | return result; 494 | } 495 | 496 | float Math::cos(float x) 497 | { 498 | return sin(x + M_PI_2); 499 | } 500 | 501 | float Math::Dot(const Vector3& Vec1, const Vector3& Vec2) { 502 | return Vec1[0] * Vec2[0] + Vec1[1] * Vec2[1] + Vec1[2] * Vec2[2]; 503 | } 504 | 505 | float Math::Calc3D_Dist(const Vector3& Src, const Vector3& Dst) { 506 | return sqrt(powww((Src.x - Dst.x)) + powww((Src.y - Dst.y)) + powww((Src.z - Dst.z))); 507 | } 508 | 509 | float Math::Calc2D_Dist(const Vector2& Src, const Vector2& Dst) { 510 | return sqrt( 511 | powww(Src.x - Dst.x) 512 | + 513 | powww(Src.y - Dst.y) 514 | ); 515 | } 516 | 517 | Vector2 Math::CalcAngle(const Vector3& src, const Vector3& dst) { 518 | Vector3 dir = src - dst; 519 | float length = dir.Length(); 520 | return Vector2{ RAD2DEG(asin(dir.y / length)), RAD2DEG(-atan2(dir.x, -dir.z)) }; 521 | } 522 | 523 | 524 | Vector2 CalcAngle(Vector3 src, Vector3 dst) 525 | { 526 | Vector2 angle; 527 | angle.x = -atan2f(dst.x - src.x, dst.y - src.y) / M_PI * 180.0f; 528 | angle.y = -asinf((dst.z - src.z) / Calc3D_Dist(src, dst)) * (180.0f / M_PI); 529 | 530 | return angle; 531 | } 532 | 533 | /* 534 | __forceinline Vector2 CalcAngle(const Vector3& Src, const Vector3& Dst) { 535 | Vector3 dir = Src - Dst; 536 | float length = dir.Length(); 537 | return Vector2{ RAD2DEG(asin(dir.y / length)), RAD2DEG(-atan2(dir.x, -dir.z)) }; 538 | 539 | */ 540 | 541 | void Math::Normalize(float& Yaw, float& Pitch) { 542 | if (Pitch < -89) Pitch = -89; 543 | else if (Pitch > 89) Pitch = 89; 544 | if (Yaw < -360) Yaw += 360; 545 | else if (Yaw > 360) Yaw -= 360; 546 | } 547 | 548 | Vector3 Math::cross_vector(Vector3 first_vec, Vector3 second_vec) 549 | { 550 | Vector3 returnme = Vector3(); 551 | returnme.x = first_vec.y * second_vec.z - first_vec.z * second_vec.y; 552 | returnme.y = first_vec.z * second_vec.x - first_vec.x * second_vec.z; //first_vec.x * second_vec.z - first_vec.z * second_vec.x; 553 | returnme.z = first_vec.x * second_vec.y - first_vec.y * second_vec.x; 554 | return returnme; 555 | } 556 | 557 | Vector4 quaternion_look_rotation(Vector3 forward, Vector3 upDirection) 558 | { 559 | Vector3 up = upDirection; 560 | 561 | forward.Normalize(); 562 | 563 | Vector3 first_vec = forward.Normalize();; 564 | Vector3 cross_value = Math::cross_vector(up, first_vec); 565 | Vector3 second_vec = cross_value.Normalize(); 566 | Vector3 third_vec = Math::cross_vector(first_vec, second_vec); 567 | 568 | float m00 = second_vec.x; 569 | float m01 = second_vec.y; 570 | float m02 = second_vec.z; 571 | 572 | float m10 = third_vec.x; 573 | float m11 = third_vec.y; 574 | float m12 = third_vec.z; 575 | 576 | float m20 = first_vec.x; 577 | float m21 = first_vec.y; 578 | float m22 = first_vec.z; 579 | 580 | float num8 = (m00 + m11) + m22; 581 | 582 | Vector4 quaternion = Vector4(); 583 | 584 | if (num8 > 0.f) 585 | { 586 | float num = Math::sqrt(num8 + 1.f); 587 | quaternion.w = num * 0.5f; 588 | num = 0.5f / num; 589 | quaternion.x = (m12 - m21) * num; 590 | quaternion.y = (m20 - m02) * num; 591 | quaternion.z = (m01 - m10) * num; 592 | return quaternion; 593 | } 594 | 595 | if ((m00 >= m11) && (m00 >= m22)) 596 | { 597 | float num7 = Math::sqrt(((1.f + m00) - m11) - m22); 598 | float num4 = 0.5f / num7; 599 | quaternion.x = 0.5f * num7; 600 | quaternion.y = (m01 + m10) * num4; 601 | quaternion.z = (m02 + m20) * num4; 602 | quaternion.w = (m12 - m21) * num4; 603 | return quaternion; 604 | } 605 | if (m11 > m22) 606 | { 607 | float num6 = Math::sqrt(((1.f + m11) - m00) - m22); 608 | float num3 = 0.5f / num6; 609 | quaternion.x = (m10 + m01) * num3; 610 | quaternion.y = 0.5f * num6; 611 | quaternion.z = (m21 + m12) * num3; 612 | quaternion.w = (m20 - m02) * num3; 613 | return quaternion; 614 | } 615 | 616 | float num5 = Math::sqrt(((1.f + m22) - m00) - m11); 617 | float num2 = 0.5f / num5; 618 | quaternion.x = (m20 + m02) * num2; 619 | quaternion.y = (m21 + m12) * num2; 620 | quaternion.z = 0.5f * num5; 621 | quaternion.w = (m01 - m10) * num2; 622 | return quaternion; 623 | } 624 | 625 | unsigned Math::my_random() 626 | { 627 | if (!lfsr) { 628 | lfsr = 0xACE1u; bit = 0; 629 | } 630 | bit = ((lfsr >> 0) ^ (lfsr >> 2) ^ (lfsr >> 3) ^ (lfsr >> 5)) & 1; 631 | return lfsr = (lfsr >> 1) | (bit << 15); 632 | } 633 | 634 | float Math::my_floor(float x) 635 | { 636 | if (x == 0.0) 637 | return 0; 638 | 639 | union { 640 | float input; 641 | int output; 642 | } data; 643 | 644 | data.input = x; 645 | 646 | int exp = data.output & (255 << 23); 647 | exp = exp >> 23; 648 | 649 | int man = data.output & ((1 << 23) - 1); 650 | 651 | int pow = exp - 127; 652 | int mulFactor = 1; 653 | 654 | int i = (pow < 0) ? (-pow) : (pow); //ABS(pow); 655 | while (i--) 656 | mulFactor *= 2; 657 | 658 | unsigned long long denominator = 1 << 23; 659 | unsigned long long numerator = man + denominator; 660 | 661 | bool negative = (data.output >> 31) != 0; 662 | 663 | if (pow < 0) 664 | denominator *= mulFactor; 665 | else 666 | numerator *= mulFactor; 667 | 668 | float res = 0.0; 669 | while (numerator >= denominator) { 670 | res++; 671 | numerator -= denominator; 672 | } 673 | 674 | if (negative) { 675 | res = -res; 676 | if (numerator != 0) 677 | res -= 1; 678 | } 679 | 680 | return res; 681 | } 682 | 683 | float Math::my_fmod(float a, float b) 684 | { 685 | return (a - b * my_floor(a / b)); 686 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/utils/math.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "../includes.hpp" 7 | 8 | #define M_PI 3.14159265358979323846f 9 | #define M_PI_F ((float)(M_PI)) 10 | #define RAD2DEG(x) ((float)(x) * (float)(180.f / M_PI_F)) 11 | 12 | namespace Math 13 | { 14 | 15 | float sqrt(float n); 16 | } 17 | 18 | class Vector3 19 | { 20 | public: 21 | float x, y, z; 22 | 23 | inline Vector3() { 24 | x = y = z = 0.0f; 25 | } 26 | 27 | inline Vector3(float X, float Y, float Z) { 28 | x = X; y = Y; z = Z; 29 | } 30 | 31 | inline float operator[](int i) const { 32 | return ((float*)this)[i]; 33 | } 34 | 35 | inline Vector3& operator-=(float v) { 36 | x -= v; y -= v; z -= v; return *this; 37 | } 38 | 39 | inline Vector3 operator*(float v) const { 40 | return Vector3(x * v, y * v, z * v); 41 | } 42 | 43 | inline Vector3 operator/(float v) const 44 | { 45 | return Vector3(x / v, y / v, z / v); 46 | } 47 | 48 | inline Vector3& operator+=(const Vector3& v) { 49 | x += v.x; y += v.y; z += v.z; return *this; 50 | } 51 | 52 | inline Vector3& operator+=(const float& v) { 53 | x += v; y += v; z += v; return *this; 54 | } 55 | 56 | inline Vector3& operator-=(const Vector3& v) { 57 | x -= v.x; y -= v.y; z -= v.z; return *this; 58 | } 59 | 60 | inline Vector3 operator-(const Vector3& v) const { 61 | return Vector3(x - v.x, y - v.y, z - v.z); 62 | } 63 | 64 | inline Vector3 operator+(const Vector3& v) const { 65 | return Vector3(x + v.x, y + v.y, z + v.z); 66 | } 67 | 68 | inline float Length() 69 | { 70 | auto number = (x * x + y * y + z * z); 71 | long i; 72 | float x2, y; 73 | const float threehalfs = 1.5F; 74 | 75 | x2 = number * 0.5F; 76 | y = number; 77 | i = *(long*)&y; // floating point bit level hacking [sic] 78 | i = 0x5f3759df - (i >> 1); // Newton's approximation 79 | y = *(float*)&i; 80 | y = y * (threehalfs - (x2 * y * y)); // 1st iteration 81 | y = y * (threehalfs - (x2 * y * y)); // 2nd iteration 82 | 83 | return 1 / y; 84 | } 85 | 86 | inline Vector3 Normalize() 87 | { 88 | float mag = Length(); 89 | if (mag > 0.00001f) 90 | { 91 | x = x / mag; 92 | y = y / mag; 93 | z = z / mag; 94 | } 95 | else 96 | { 97 | x = 0; 98 | y = 0; 99 | z = 0; 100 | } 101 | return *this; 102 | } 103 | 104 | inline bool IsZero() 105 | { 106 | if (this->x == 0 && this->y == 0 && this->z == 0) 107 | return true; 108 | 109 | return false; 110 | } 111 | 112 | inline float magnitude2d() 113 | { 114 | return sqrtf( 115 | (this->x * this->x) 116 | + 117 | (this->z * this->z)); 118 | } 119 | 120 | inline bool operator==(const Vector3& v) const { 121 | if (this->x == v.x && this->y == v.y && this->z == v.z) 122 | return true; 123 | else 124 | return false; 125 | } 126 | 127 | inline bool operator!=(const Vector3& v) const { 128 | if (this->x == v.x && this->y == v.y && this->z == v.z) 129 | return false; 130 | else 131 | return true; 132 | } 133 | }; 134 | 135 | class Vector2 { 136 | public: 137 | float x, y; 138 | 139 | inline Vector2() { 140 | x = y = 0.0f; 141 | } 142 | 143 | inline Vector2 operator/(float v) const { 144 | return Vector2(x / v, y / v); 145 | } 146 | inline Vector2(float X, float Y) { 147 | x = X; y = Y; 148 | } 149 | 150 | inline Vector2 operator-(const Vector2& v) const { 151 | return Vector2(x - v.x, y - v.y); 152 | } 153 | 154 | inline Vector2 operator+(const Vector2& v) const { 155 | return Vector2(x + v.x, y + v.y); 156 | } 157 | 158 | inline Vector2& operator+=(const Vector2& v) { 159 | x += v.x; y += v.y; return *this; 160 | } 161 | 162 | inline Vector2& operator-=(const Vector2& v) { 163 | x -= v.x; y -= v.y; return *this; 164 | } 165 | 166 | inline Vector2 operator*(const float& v) const { 167 | return Vector2(x * v, y * v); 168 | } 169 | 170 | inline bool Zero() const { 171 | return (x > -0.1f && x < 0.1f && y > -0.1f && y < 0.1f); 172 | } 173 | 174 | inline Vector2& operator/=(float fl) 175 | { 176 | float oofl = 1.0f / fl; 177 | x *= oofl; 178 | y *= oofl; 179 | return *this; 180 | } 181 | 182 | inline bool operator==(const Vector2& v) const { 183 | if (this->x == v.x && this->y == v.y) 184 | return true; 185 | else 186 | return false; 187 | } 188 | 189 | 190 | inline Vector2 Clamp() 191 | { 192 | if (x > 180) 193 | x -= 360; 194 | else if (x < -180) 195 | x += 360; 196 | 197 | if (y > 180) 198 | y -= 360; 199 | else if (y < -180) 200 | y += 360; 201 | 202 | if (x < -89) 203 | x = -89; 204 | 205 | if (x > 89) 206 | x = 89; 207 | 208 | while (y < -180.0f) 209 | y += 360.0f; 210 | 211 | while (y > 180.0f) 212 | y -= 360.0f; 213 | 214 | return *this; 215 | } 216 | 217 | inline float magnitude() 218 | { 219 | return Math::sqrt( 220 | (x * x) 221 | + 222 | (y * y) 223 | ); 224 | } 225 | }; 226 | 227 | class Vector4 { 228 | public: 229 | float x, y, z, w; 230 | 231 | public: 232 | inline Vector4() { 233 | x = y = z = w = 0.0f; 234 | } 235 | 236 | inline Vector4(float X, float Y, float Z, float W) { 237 | x = X; y = Y; z = Z; w = W; 238 | } 239 | 240 | inline float operator[](int i) const { 241 | return ((float*)this)[i]; 242 | } 243 | 244 | inline bool contains(Vector2 point) 245 | { 246 | return point.x >= x && point.x < (x + z) && point.y >= y && point.y < (y + w); 247 | } 248 | }; 249 | 250 | class VMatrix 251 | { 252 | public: 253 | VMatrix() 254 | : m{ { 0, 0, 0, 0 }, 255 | { 0, 0, 0, 0 }, 256 | { 0, 0, 0, 0 }, 257 | { 0, 0, 0, 0 } } 258 | {} 259 | 260 | VMatrix(const VMatrix&) = default; 261 | 262 | VMatrix transpose() { 263 | VMatrix m; 264 | 265 | for (int i = 0; i < 4; i++) 266 | for (int j = 0; j < 4; j++) 267 | m.m[i][j] = this->m[j][i]; 268 | 269 | return m; 270 | } 271 | 272 | void matrix_identity() { 273 | memset(this, 0, sizeof(VMatrix)); 274 | m[0][0] = 1.0f; 275 | m[1][1] = 1.0f; 276 | m[2][2] = 1.0f; 277 | m[3][3] = 1.0f; 278 | } 279 | 280 | bool is_empty() { 281 | if (!m[3][0] && !m[3][1] && !m[3][2] && !m[2][1] && !m[2][0] && !m[2][2]) 282 | return true; 283 | 284 | return false; 285 | } 286 | 287 | Vector3 operator*(const Vector3& vec) { 288 | VMatrix m; 289 | 290 | m[3][0] = vec.x; 291 | m[3][1] = vec.y; 292 | m[3][2] = vec.z; 293 | 294 | m[0][0] = 1; 295 | m[1][1] = 1; 296 | m[2][2] = 1; 297 | 298 | 299 | m[0][3] = 0.0f; 300 | m[1][3] = 0.0f; 301 | m[2][3] = 0.0f; 302 | m[3][3] = 1.0f; 303 | 304 | auto result = m * (*this); 305 | 306 | return Vector3{ result[3][0], result[3][1], result[3][2] }; 307 | } 308 | 309 | VMatrix operator*(const VMatrix& _m2) { 310 | auto _m = *this; 311 | 312 | VMatrix out; 313 | out[0][0] = _m[0][0] * _m2[0][0] + _m[0][1] * _m2[1][0] + _m[0][2] * _m2[2][0] + _m[0][3] * _m2[3][0]; 314 | out[0][1] = _m[0][0] * _m2[0][1] + _m[0][1] * _m2[1][1] + _m[0][2] * _m2[2][1] + _m[0][3] * _m2[3][1]; 315 | out[0][2] = _m[0][0] * _m2[0][2] + _m[0][1] * _m2[1][2] + _m[0][2] * _m2[2][2] + _m[0][3] * _m2[3][2]; 316 | out[0][3] = _m[0][0] * _m2[0][3] + _m[0][1] * _m2[1][3] + _m[0][2] * _m2[2][3] + _m[0][3] * _m2[3][3]; 317 | out[1][0] = _m[1][0] * _m2[0][0] + _m[1][1] * _m2[1][0] + _m[1][2] * _m2[2][0] + _m[1][3] * _m2[3][0]; 318 | out[1][1] = _m[1][0] * _m2[0][1] + _m[1][1] * _m2[1][1] + _m[1][2] * _m2[2][1] + _m[1][3] * _m2[3][1]; 319 | out[1][2] = _m[1][0] * _m2[0][2] + _m[1][1] * _m2[1][2] + _m[1][2] * _m2[2][2] + _m[1][3] * _m2[3][2]; 320 | out[1][3] = _m[1][0] * _m2[0][3] + _m[1][1] * _m2[1][3] + _m[1][2] * _m2[2][3] + _m[1][3] * _m2[3][3]; 321 | out[2][0] = _m[2][0] * _m2[0][0] + _m[2][1] * _m2[1][0] + _m[2][2] * _m2[2][0] + _m[2][3] * _m2[3][0]; 322 | out[2][1] = _m[2][0] * _m2[0][1] + _m[2][1] * _m2[1][1] + _m[2][2] * _m2[2][1] + _m[2][3] * _m2[3][1]; 323 | out[2][2] = _m[2][0] * _m2[0][2] + _m[2][1] * _m2[1][2] + _m[2][2] * _m2[2][2] + _m[2][3] * _m2[3][2]; 324 | out[2][3] = _m[2][0] * _m2[0][3] + _m[2][1] * _m2[1][3] + _m[2][2] * _m2[2][3] + _m[2][3] * _m2[3][3]; 325 | out[3][0] = _m[3][0] * _m2[0][0] + _m[3][1] * _m2[1][0] + _m[3][2] * _m2[2][0] + _m[3][3] * _m2[3][0]; 326 | out[3][1] = _m[3][0] * _m2[0][1] + _m[3][1] * _m2[1][1] + _m[3][2] * _m2[2][1] + _m[3][3] * _m2[3][1]; 327 | out[3][2] = _m[3][0] * _m2[0][2] + _m[3][1] * _m2[1][2] + _m[3][2] * _m2[2][2] + _m[3][3] * _m2[3][2]; 328 | out[3][3] = _m[3][0] * _m2[0][3] + _m[3][1] * _m2[1][3] + _m[3][2] * _m2[2][3] + _m[3][3] * _m2[3][3]; 329 | 330 | return out; 331 | } 332 | 333 | float* operator[](size_t i) { return m[i]; } 334 | const float* operator[](size_t i) const { return m[i]; } 335 | 336 | union { 337 | struct { 338 | float _11, _12, _13, _14; 339 | float _21, _22, _23, _24; 340 | float _31, _32, _33, _34; 341 | float _41, _42, _43, _44; 342 | }; 343 | float m[4][4]; 344 | }; 345 | }; 346 | 347 | struct Matrix4x4 { 348 | union { 349 | struct { 350 | float _11, _12, _13, _14; 351 | float _21, _22, _23, _24; 352 | float _31, _32, _33, _34; 353 | float _41, _42, _43, _44; 354 | 355 | }; float m[4][4]; 356 | }; 357 | }; 358 | 359 | namespace Math 360 | { 361 | Vector3 cross_vector(Vector3 first_vec, Vector3 second_vec); 362 | 363 | typedef struct { double d0, d1; } double2; 364 | 365 | static inline double2 Mul112(double a, double b); 366 | 367 | static inline double2 Mul222(double2 a, double2 b); 368 | 369 | static inline double Mul121Special(double a, double2 b); 370 | 371 | static inline double2 Add212RightSmaller(double2 a, double b); 372 | 373 | static inline double Add221RightSmaller(double2 a, double2 b); 374 | 375 | double atan(double); 376 | 377 | float my_atan2(float y, float x); 378 | 379 | float abs(float a); 380 | 381 | float my_asin(float x); 382 | 383 | float sin(float x); 384 | 385 | float cos(float x); 386 | 387 | float Dot(const Vector3& Vec1, const Vector3& Vec2); 388 | 389 | float Calc3D_Dist(const Vector3& Src, const Vector3& Dst); 390 | 391 | float Calc2D_Dist(const Vector2& Src, const Vector2& Dst); 392 | 393 | Vector2 CalcAngle(const Vector3& Src, const Vector3& Dst); 394 | 395 | void Normalize(float& Yaw, float& Pitch); 396 | 397 | unsigned my_random(); 398 | float my_floor(float x); 399 | float my_fmod(float a, float b); 400 | } 401 | 402 | Vector3 cross_vector(Vector3 first_vec, Vector3 second_vec); 403 | Vector4 quaternion_look_rotation(Vector3 forward, Vector3 upDirection); 404 | 405 | #define ImSqrt(x) Math::sqrt(x) 406 | #define ImFabs(x) Math::abs(x) -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/utils/memory.cpp: -------------------------------------------------------------------------------- 1 | #include "memory.hpp" 2 | #include "lazy_importer.hpp" 3 | #include "../game/classes.hpp" 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define in_range(x,a,b) (x>=a&&x<=b) 10 | #define get_bits(x) (in_range((x&(~0x20)),'A','F')?((x&(~0x20))-'A'+0xa):(in_range(x,'0','9')?x-'0':0)) 11 | #define get_byte(x) (get_bits(x[0])<<4|get_bits(x[1])) 12 | 13 | 14 | #ifndef ULONG_MAX 15 | #define ULONG_MAX ((unsigned long)(~0L)) /* 0xFFFFFFFF */ 16 | #endif 17 | /* 18 | * Convert a string to an unsigned long integer. 19 | * 20 | * Ignores `locale' stuff. Assumes that the upper and lower case 21 | * alphabets and digits are each contiguous. 22 | */ 23 | unsigned long 24 | my_strtoul(const char* nptr, char** endptr, int base) 25 | { 26 | const char* s = nptr; 27 | unsigned long acc; 28 | int c; 29 | unsigned long cutoff; 30 | int neg = 0, any, cutlim; 31 | /* 32 | * See strtol for comments as to the logic used. 33 | */ 34 | do { 35 | c = *s++; 36 | } while (isspace(c)); 37 | if (c == '-') { 38 | neg = 1; 39 | c = *s++; 40 | } 41 | else if (c == '+') 42 | c = *s++; 43 | if ((base == 0 || base == 16) && 44 | c == '0' && (*s == 'x' || *s == 'X')) { 45 | c = s[1]; 46 | s += 2; 47 | base = 16; 48 | } 49 | if (base == 0) 50 | base = c == '0' ? 8 : 10; 51 | cutoff = (unsigned long)ULONG_MAX / (unsigned long)base; 52 | cutlim = (unsigned long)ULONG_MAX % (unsigned long)base; 53 | for (acc = 0, any = 0;; c = *s++) { 54 | if (isdigit(c)) 55 | c -= '0'; 56 | else if (isalpha(c)) 57 | c -= isupper(c) ? 'A' - 10 : 'a' - 10; 58 | else 59 | break; 60 | if (c >= base) 61 | break; 62 | if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) 63 | any = -1; 64 | else { 65 | any = 1; 66 | acc *= base; 67 | acc += c; 68 | } 69 | } 70 | if (any < 0) { 71 | acc = ULONG_MAX; 72 | errno = ERANGE; 73 | } 74 | else if (neg) 75 | acc = LLONG_MIN;//-acc; 76 | if (endptr != 0) 77 | *endptr = (char*)(any ? s - 1 : nptr); 78 | return (acc); 79 | } 80 | 81 | uintptr_t memory::sigscan(const char* scanmodule, const char* pattern, int jump) 82 | { 83 | uintptr_t moduleAdress = 0; 84 | const auto mod = scanmodule; 85 | //moduleAdress = LI_MODULE(mod).get(); 86 | 87 | static auto patternToByte = [](const char* pattern) 88 | { 89 | auto bytes = std::vector{}; 90 | const auto start = const_cast(pattern); 91 | const auto end = const_cast(pattern) + functions::my_strlen(pattern); 92 | 93 | for (auto current = start; current < end; ++current) 94 | { 95 | if (*current == '?') 96 | { 97 | ++current; 98 | if (*current == '?') 99 | ++current; 100 | bytes.push_back(-1); 101 | } 102 | else { bytes.push_back(my_strtoul(current, ¤t, 16)); } 103 | } 104 | return bytes; 105 | }; 106 | 107 | const auto dosHeader = (PIMAGE_DOS_HEADER)moduleAdress; 108 | if (!dosHeader) 109 | return NULL; 110 | 111 | const auto ntHeaders = (PIMAGE_NT_HEADERS)((std::uint8_t*)moduleAdress + dosHeader->e_lfanew); 112 | 113 | const auto sizeOfImage = ntHeaders->OptionalHeader.SizeOfImage; 114 | auto patternBytes = patternToByte(pattern); 115 | const auto scanBytes = reinterpret_cast(moduleAdress); 116 | 117 | const auto s = patternBytes.size(); 118 | const auto d = patternBytes.data(); 119 | 120 | for (auto i = 0ul; i < sizeOfImage - s; ++i) 121 | { 122 | bool found = true; 123 | for (auto j = 0ul; j < s; ++j) 124 | { 125 | if (scanBytes[i + j] != d[j] && d[j] != -1) 126 | { 127 | found = false; 128 | break; 129 | } 130 | } 131 | if (found) 132 | { 133 | if (!jump) 134 | return reinterpret_cast(&scanBytes[i]); 135 | else 136 | { 137 | uintptr_t patterScanResult = (reinterpret_cast(&scanBytes[i]) + jump); 138 | int relative = read(patterScanResult + 3); 139 | return (patterScanResult + 7 + relative); 140 | } 141 | } 142 | } 143 | return NULL; 144 | } 145 | 146 | uintptr_t memory::find(uintptr_t range_start, uintptr_t range_end, const char* pattern) { 147 | const char* pattern_bytes = pattern; 148 | 149 | uintptr_t first_match = 0; 150 | 151 | for (uintptr_t cur_byte = range_start; cur_byte < range_end; cur_byte++) { 152 | if (!*pattern_bytes) 153 | return first_match; 154 | 155 | if (*(uint8_t*)pattern_bytes == '\?' || *(uint8_t*)cur_byte == static_cast(get_byte(pattern_bytes))) { 156 | if (!first_match) 157 | first_match = cur_byte; 158 | 159 | if (!pattern_bytes[2]) 160 | return first_match; 161 | 162 | if (*(uint16_t*)pattern_bytes == '\?\?' || *(uint8_t*)pattern_bytes != '\?') 163 | pattern_bytes += 3; 164 | else 165 | pattern_bytes += 2; 166 | } 167 | else { 168 | pattern_bytes = pattern; 169 | first_match = 0; 170 | } 171 | } 172 | 173 | return 0; 174 | } 175 | 176 | uintptr_t memory::find(const char* mod, const char* pattern) { 177 | const char* pattern_bytes = pattern; 178 | 179 | uintptr_t range_start = LI_MODULE_SAFE_("GameAssembly.dll"); 180 | uintptr_t range_size = LI_MODULESIZE_SAFE_("GameAssembly.dll"); 181 | std::cout << "Range Size: " << range_size << std::endl; 182 | uintptr_t range_end = range_start + range_size; 183 | 184 | return find(range_start, range_end, pattern); 185 | } 186 | 187 | uintptr_t memory::find_rel(const char* mod, const char* pattern, ptrdiff_t position, ptrdiff_t jmp_size, ptrdiff_t instruction_size) { 188 | auto result = find(mod, pattern); 189 | 190 | if (!result) 191 | { 192 | std::cout << "[FindRel] !result!" << std::endl; 193 | return 0; 194 | } 195 | 196 | result += position; 197 | 198 | auto rel_addr = *reinterpret_cast(result + jmp_size); 199 | auto abs_addr = result + instruction_size + rel_addr; 200 | 201 | return abs_addr; 202 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/utils/memory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../includes.hpp" 3 | 4 | namespace memory 5 | { 6 | uintptr_t sigscan(const char* module, const char* pattern, int jump = 0); 7 | uintptr_t find(uintptr_t range_start, uintptr_t range_end, const char* pattern); 8 | uintptr_t find(const char* mod, const char* pattern); 9 | 10 | uintptr_t find_rel(const char* mod, const char* pattern, ptrdiff_t position = 0, ptrdiff_t jmp_size = 3, ptrdiff_t instruction_size = 7); 11 | 12 | template 13 | t read(uintptr_t address) 14 | { 15 | if (!address) 16 | { 17 | return t(); 18 | } 19 | else if (address < 0xffffff) 20 | { 21 | return t(); 22 | } 23 | else if (address > 0x7fffffff0000) 24 | { 25 | return t(); 26 | } 27 | else 28 | { 29 | return *reinterpret_cast(address); 30 | } 31 | } 32 | 33 | template 34 | bool write(uintptr_t address, t value) 35 | { 36 | *reinterpret_cast(address) = value; 37 | return true; 38 | } 39 | } -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/utils/returnspoofer.asm: -------------------------------------------------------------------------------- 1 | PUBLIC _spoofer_stub 2 | option casemap :none 3 | 4 | ; if the line is labelled as MODIFY you need to modify the register it reads or writes to 5 | ; valid registers include: rbx, rbp+0x0, rdi, rsi, r12, r13+0x0, r14, r15 6 | 7 | _TEXT SEGMENT 8 | _spoofer_stub PROC 9 | pop r11 ; poping without setting up stack frame, r11 is the return address (the one in our code) 10 | add rsp, 8 ; skipping callee reserved space 11 | mov rax, [rsp + 24] ; dereference shell_param 12 | 13 | mov r10, [rax] ; load shell_param.trampoline 14 | mov [rsp], r10 ; store address of trampoline as return address 15 | 16 | mov r10, [rax + 8] ; load shell_param.function 17 | mov [rax + 8], r11 ; store the original return address in shell_param.function 18 | 19 | mov [rax + 16], rdi ; preserve register in shell_param.register_ | MODIFY 20 | lea rdi, fixup ; load fixup address in register | MODIFY 21 | mov [rax], rdi ; store address of fixup label in shell_param.trampoline | MODIFY 22 | mov rdi, rax ; preserve address of shell_param in register | MODIFY 23 | 24 | jmp r10 ; call shell_param.function 25 | fixup: 26 | sub rsp, 16 27 | mov rcx, rdi ; restore address of shell_param | MODIFY 28 | mov rdi, [rcx + 16] ; restore register from shell_param.register_ | MODIFY 29 | jmp QWORD PTR [rcx + 8] ; jmp to the original return address 30 | _spoofer_stub ENDP 31 | _TEXT ENDS 32 | END -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/utils/returnspoofer.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | // https://github.com/juniorjacob/ret_addr_spoofer 5 | 6 | #pragma section(".text") 7 | __declspec(allocate(".text")) const unsigned char jmpRdx[] = { 0xFF, 0x27 };//ReturnSpoof 8 | 9 | namespace ReturnAddressSpoofer { 10 | extern "C" void* SpooferStub(); 11 | template 12 | __forceinline static Ret Helper(const void* shell, Args... args) 13 | { 14 | auto fn = (Ret(*)(Args...))(shell); 15 | return fn(args...); 16 | } 17 | 18 | template 19 | struct Remapper 20 | { 21 | // At least 5 params 22 | template< typename Ret, typename First, typename Second, typename Third, typename Fourth, typename... Pack> 23 | __forceinline static Ret Call(const void* shell, void* shellParam, First first, Second second, Third third, Fourth fourth, Pack... pack) 24 | { 25 | return Helper(shell, first, second, third, fourth, shellParam, nullptr, pack...); 26 | } 27 | }; 28 | 29 | template 30 | struct Remapper> 31 | { 32 | // 4 or less params 33 | template 34 | __forceinline static Ret Call(const void* shell, void* shellParam, First first = First{}, Second second = Second{}, Third third = Third{}, Fourth fourth = Fourth{}) 35 | { 36 | return Helper(shell, first, second, third, fourth, shellParam, nullptr); 37 | } 38 | }; 39 | }; 40 | 41 | template 42 | __forceinline static result SpoofReturn(result(*fn)(arguments...), arguments... args) 43 | { 44 | return fn(args...); 45 | 46 | /* 47 | struct shell_params 48 | { 49 | const void* trampoline; 50 | void* function; 51 | void* register_; // originally rbx, currently rdx 52 | }; 53 | //printf("Calling SpoofReturn from %s\n", __FUNCTION__); 54 | shell_params params{ jmpRdx, reinterpret_cast(fn) }; 55 | using mapper = ReturnAddressSpoofer::Remapper; 56 | return mapper::template Call((const void*)&ReturnAddressSpoofer::SpooferStub, ¶ms, args...); 57 | */ 58 | } 59 | -------------------------------------------------------------------------------- /Rust-Internal-Always-Updated-main/rust base/utils/xor.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 - 2021 Justas Masiulis 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef JM_XORSTR_HPP 18 | #define JM_XORSTR_HPP 19 | 20 | #if defined(_M_ARM64) || defined(__aarch64__) || defined(_M_ARM) || defined(__arm__) 21 | #include 22 | #elif defined(_M_X64) || defined(__amd64__) || defined(_M_IX86) || defined(__i386__) 23 | #include 24 | #else 25 | #error Unsupported platform 26 | #endif 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #define xorstr(str) ::jm::xor_string([]() { return str; }, std::integral_constant{}, std::make_index_sequence<::jm::detail::_buffer_size()>{}) 34 | #define xorstr_(str) xorstr(str).crypt_get() 35 | 36 | #ifdef _MSC_VER 37 | #define XORSTR_FORCEINLINE __forceinline 38 | #else 39 | #define XORSTR_FORCEINLINE __attribute__((always_inline)) inline 40 | #endif 41 | 42 | #if defined(__clang__) || defined(__GNUC__) 43 | #define JM_XORSTR_LOAD_FROM_REG(x) ::jm::detail::load_from_reg(x) 44 | #else 45 | #define JM_XORSTR_LOAD_FROM_REG(x) (x) 46 | #endif 47 | 48 | 49 | 50 | namespace jm { 51 | 52 | namespace detail { 53 | 54 | template 55 | XORSTR_FORCEINLINE constexpr std::size_t _buffer_size() 56 | { 57 | return ((Size / 16) + (Size % 16 != 0)) * 2; 58 | } 59 | 60 | template 61 | XORSTR_FORCEINLINE constexpr std::uint32_t key4() noexcept 62 | { 63 | std::uint32_t value = Seed; 64 | for (char c : __TIME__) 65 | value = static_cast((value ^ c) * 16777619ull); 66 | return value; 67 | } 68 | 69 | template 70 | XORSTR_FORCEINLINE constexpr std::uint64_t key8() 71 | { 72 | constexpr auto first_part = key4<2166136261 + S>(); 73 | constexpr auto second_part = key4(); 74 | return (static_cast(first_part) << 32) | second_part; 75 | } 76 | 77 | // loads up to 8 characters of string into uint64 and xors it with the key 78 | template 79 | XORSTR_FORCEINLINE constexpr std::uint64_t 80 | load_xored_str8(std::uint64_t key, std::size_t idx, const CharT* str) noexcept 81 | { 82 | using cast_type = typename std::make_unsigned::type; 83 | constexpr auto value_size = sizeof(CharT); 84 | constexpr auto idx_offset = 8 / value_size; 85 | 86 | std::uint64_t value = key; 87 | for (std::size_t i = 0; i < idx_offset && i + idx * idx_offset < N; ++i) 88 | value ^= 89 | (std::uint64_t{ static_cast(str[i + idx * idx_offset]) } 90 | << ((i % idx_offset) * 8 * value_size)); 91 | 92 | return value; 93 | } 94 | 95 | // forces compiler to use registers instead of stuffing constants in rdata 96 | XORSTR_FORCEINLINE std::uint64_t load_from_reg(std::uint64_t value) noexcept 97 | { 98 | #if defined(__clang__) || defined(__GNUC__) 99 | asm("" : "=r"(value) : "0"(value) : ); 100 | #endif 101 | return value; 102 | } 103 | 104 | template 105 | struct uint64_v { 106 | constexpr static std::uint64_t value = V; 107 | }; 108 | 109 | } // namespace detail 110 | 111 | template 112 | class xor_string; 113 | 114 | template 115 | class xor_string, std::index_sequence> { 116 | #ifndef JM_XORSTR_DISABLE_AVX_INTRINSICS 117 | constexpr static inline std::uint64_t alignment = ((Size > 16) ? 32 : 16); 118 | #else 119 | constexpr static inline std::uint64_t alignment = 16; 120 | #endif 121 | 122 | alignas(alignment) std::uint64_t _storage[sizeof...(Keys)]; 123 | 124 | public: 125 | using value_type = CharT; 126 | using size_type = std::size_t; 127 | using pointer = CharT*; 128 | using const_pointer = const CharT*; 129 | 130 | template 131 | XORSTR_FORCEINLINE xor_string(L l, std::integral_constant, std::index_sequence) noexcept 132 | : _storage{ JM_XORSTR_LOAD_FROM_REG(detail::uint64_v(Keys, Indices, l())>::value)... } 133 | {} 134 | 135 | XORSTR_FORCEINLINE constexpr size_type size() const noexcept 136 | { 137 | return Size - 1; 138 | } 139 | 140 | XORSTR_FORCEINLINE void crypt() noexcept 141 | { 142 | // everything is inlined by hand because a certain compiler with a certain linker is _very_ slow 143 | #if defined(__clang__) 144 | alignas(alignment) 145 | std::uint64_t arr[]{ JM_XORSTR_LOAD_FROM_REG(Keys)... }; 146 | std::uint64_t* keys = 147 | (std::uint64_t*)JM_XORSTR_LOAD_FROM_REG((std::uint64_t)arr); 148 | #else 149 | alignas(alignment) std::uint64_t keys[]{ JM_XORSTR_LOAD_FROM_REG(Keys)... }; 150 | #endif 151 | 152 | #if defined(_M_ARM64) || defined(__aarch64__) || defined(_M_ARM) || defined(__arm__) 153 | #if defined(__clang__) 154 | ((Indices >= sizeof(_storage) / 16 ? static_cast(0) : __builtin_neon_vst1q_v( 155 | reinterpret_cast(_storage) + Indices * 2, 156 | veorq_u64(__builtin_neon_vld1q_v(reinterpret_cast(_storage) + Indices * 2, 51), 157 | __builtin_neon_vld1q_v(reinterpret_cast(keys) + Indices * 2, 51)), 158 | 51)), ...); 159 | #else // GCC, MSVC 160 | ((Indices >= sizeof(_storage) / 16 ? static_cast(0) : vst1q_u64( 161 | reinterpret_cast(_storage) + Indices * 2, 162 | veorq_u64(vld1q_u64(reinterpret_cast(_storage) + Indices * 2), 163 | vld1q_u64(reinterpret_cast(keys) + Indices * 2)))), ...); 164 | #endif 165 | #elif !defined(JM_XORSTR_DISABLE_AVX_INTRINSICS) 166 | ((Indices >= sizeof(_storage) / 32 ? static_cast(0) : _mm256_store_si256( 167 | reinterpret_cast<__m256i*>(_storage) + Indices, 168 | _mm256_xor_si256( 169 | _mm256_load_si256(reinterpret_cast(_storage) + Indices), 170 | _mm256_load_si256(reinterpret_cast(keys) + Indices)))), ...); 171 | 172 | if constexpr (sizeof(_storage) % 32 != 0) 173 | _mm_store_si128( 174 | reinterpret_cast<__m128i*>(_storage + sizeof...(Keys) - 2), 175 | _mm_xor_si128(_mm_load_si128(reinterpret_cast(_storage + sizeof...(Keys) - 2)), 176 | _mm_load_si128(reinterpret_cast(keys + sizeof...(Keys) - 2)))); 177 | #else 178 | ((Indices >= sizeof(_storage) / 16 ? static_cast(0) : _mm_store_si128( 179 | reinterpret_cast<__m128i*>(_storage) + Indices, 180 | _mm_xor_si128(_mm_load_si128(reinterpret_cast(_storage) + Indices), 181 | _mm_load_si128(reinterpret_cast(keys) + Indices)))), ...); 182 | #endif 183 | } 184 | 185 | XORSTR_FORCEINLINE const_pointer get() const noexcept 186 | { 187 | return reinterpret_cast(_storage); 188 | } 189 | 190 | XORSTR_FORCEINLINE pointer get() noexcept 191 | { 192 | return reinterpret_cast(_storage); 193 | } 194 | 195 | XORSTR_FORCEINLINE pointer crypt_get() noexcept 196 | { 197 | // crypt() is inlined by hand because a certain compiler with a certain linker is _very_ slow 198 | #if defined(__clang__) 199 | alignas(alignment) 200 | std::uint64_t arr[]{ JM_XORSTR_LOAD_FROM_REG(Keys)... }; 201 | std::uint64_t* keys = 202 | (std::uint64_t*)JM_XORSTR_LOAD_FROM_REG((std::uint64_t)arr); 203 | #else 204 | alignas(alignment) std::uint64_t keys[]{ JM_XORSTR_LOAD_FROM_REG(Keys)... }; 205 | #endif 206 | 207 | #if defined(_M_ARM64) || defined(__aarch64__) || defined(_M_ARM) || defined(__arm__) 208 | #if defined(__clang__) 209 | ((Indices >= sizeof(_storage) / 16 ? static_cast(0) : __builtin_neon_vst1q_v( 210 | reinterpret_cast(_storage) + Indices * 2, 211 | veorq_u64(__builtin_neon_vld1q_v(reinterpret_cast(_storage) + Indices * 2, 51), 212 | __builtin_neon_vld1q_v(reinterpret_cast(keys) + Indices * 2, 51)), 213 | 51)), ...); 214 | #else // GCC, MSVC 215 | ((Indices >= sizeof(_storage) / 16 ? static_cast(0) : vst1q_u64( 216 | reinterpret_cast(_storage) + Indices * 2, 217 | veorq_u64(vld1q_u64(reinterpret_cast(_storage) + Indices * 2), 218 | vld1q_u64(reinterpret_cast(keys) + Indices * 2)))), ...); 219 | #endif 220 | #elif !defined(JM_XORSTR_DISABLE_AVX_INTRINSICS) 221 | ((Indices >= sizeof(_storage) / 32 ? static_cast(0) : _mm256_store_si256( 222 | reinterpret_cast<__m256i*>(_storage) + Indices, 223 | _mm256_xor_si256( 224 | _mm256_load_si256(reinterpret_cast(_storage) + Indices), 225 | _mm256_load_si256(reinterpret_cast(keys) + Indices)))), ...); 226 | 227 | if constexpr (sizeof(_storage) % 32 != 0) 228 | _mm_store_si128( 229 | reinterpret_cast<__m128i*>(_storage + sizeof...(Keys) - 2), 230 | _mm_xor_si128(_mm_load_si128(reinterpret_cast(_storage + sizeof...(Keys) - 2)), 231 | _mm_load_si128(reinterpret_cast(keys + sizeof...(Keys) - 2)))); 232 | #else 233 | ((Indices >= sizeof(_storage) / 16 ? static_cast(0) : _mm_store_si128( 234 | reinterpret_cast<__m128i*>(_storage) + Indices, 235 | _mm_xor_si128(_mm_load_si128(reinterpret_cast(_storage) + Indices), 236 | _mm_load_si128(reinterpret_cast(keys) + Indices)))), ...); 237 | #endif 238 | 239 | return (pointer)(_storage); 240 | } 241 | }; 242 | 243 | template 244 | xor_string(cL l, std::integral_constant, std::index_sequence)->xor_string< 245 | std::remove_const_t>, 246 | Size, 247 | std::integer_sequence()...>, 248 | std::index_sequence>; 249 | 250 | } // namespace jm 251 | 252 | #endif // include guard --------------------------------------------------------------------------------