From bbe7e9eb62cf5b99eac82e5e75391e678c54ff2b Mon Sep 17 00:00:00 2001 From: Lefraudeur Date: Sat, 21 Oct 2023 00:37:09 +0200 Subject: [PATCH] Cleaned some parts of code structure Improved Hook to preserve registers Fixed crash on 1.17.1 and 1.18.2 Removed bad and useless keybinds --- Ripterms Ghost.vcxproj | 15 +++- Ripterms Ghost.vcxproj.filters | 21 +++++ Ripterms/Cache/Cache.cpp | 4 + Ripterms/Cache/Cache.h | 6 +- Ripterms/Event/Event.h | 4 - Ripterms/GUI/GUI.cpp | 25 +++++- Ripterms/GUI/GUI.h | 41 ---------- Ripterms/GUI/GUI_conf.h | 44 +++++++++++ Ripterms/Hook/Hook.cpp | 24 +++--- Ripterms/JavaClass/JavaClass.h | 2 +- Ripterms/JavaClass/JavaClassV2.cpp | 76 +++--------------- Ripterms/Mappings/mappings_forge_1_7_10.h | 5 +- Ripterms/Mappings/mappings_lunar_1_16_5.h | 5 +- Ripterms/Mappings/mappings_lunar_1_7_10.h | 5 +- Ripterms/Mappings/mappings_lunar_1_8_9.h | 55 ++++++++++++- Ripterms/Mappings/mappings_vanilla_1_8_9.h | 5 +- Ripterms/Maths/Maths.cpp | 79 ++++++++++++++++--- Ripterms/Maths/Maths.h | 9 ++- Ripterms/Modules/AimAssist.cpp | 25 +++++- Ripterms/Modules/Blink.cpp | 8 +- Ripterms/Modules/ClientBrandChanger.cpp | 3 +- Ripterms/Modules/FullBright.cpp | 2 + Ripterms/Modules/LeftClicker.cpp | 3 + Ripterms/Modules/LegitScaffold.cpp | 2 + Ripterms/Modules/Modules.cpp | 16 ++-- Ripterms/Modules/Modules.h | 19 ++--- Ripterms/Modules/Reach.cpp | 3 +- Ripterms/Modules/Test.cpp | 24 ++---- Ripterms/Modules/Velocity.cpp | 2 + Ripterms/Patcher/ClassPatcherJar.h | 2 +- Ripterms/Patcher/Patcher.cpp | 17 ++-- Ripterms/Ripterms.cpp | 58 +++++--------- Ripterms/Ripterms.h | 43 +++++++--- java/lang/Object/Object.h | 1 - java/nio/FloatBuffer/FloatBuffer.cpp | 26 ++++++ java/nio/FloatBuffer/FloatBuffer.h | 13 +++ java/nio/IntBuffer/IntBuffer.cpp | 26 ++++++ java/nio/IntBuffer/IntBuffer.h | 13 +++ main.cpp | 6 +- net/minecraft/client/Minecraft/Minecraft.cpp | 1 + .../entity/EntityPlayerSP/EntityPlayerSP.cpp | 4 +- .../multiplayer/WorldClient/WorldClient.cpp | 7 +- .../ActiveRenderInfo/ActiveRenderInfo.cpp | 16 ++++ .../ActiveRenderInfo/ActiveRenderInfo.h | 15 ++++ .../settings/GameSettings/GameSettings.cpp | 18 +++-- net/minecraft/entity/Entity/Entity.cpp | 7 +- net/minecraft/entity/Entity/Entity.h | 1 + .../EntityLivingBase/EntityLivingBase.cpp | 2 +- .../client/C03PacketPlayer/C03PacketPlayer.h | 1 + .../C04PacketPlayerPosition.cpp | 4 +- net/minecraft/util/BlockPos/BlockPos.h | 1 + .../MovingObjectPosition.cpp | 2 +- net/minecraft/util/Vec3/Vec3.h | 1 + net/minecraft/world/World/World.cpp | 2 +- net/minecraft/world/World/World.h | 1 + 55 files changed, 535 insertions(+), 285 deletions(-) create mode 100644 Ripterms/GUI/GUI_conf.h create mode 100644 java/nio/FloatBuffer/FloatBuffer.cpp create mode 100644 java/nio/FloatBuffer/FloatBuffer.h create mode 100644 java/nio/IntBuffer/IntBuffer.cpp create mode 100644 java/nio/IntBuffer/IntBuffer.h create mode 100644 net/minecraft/client/renderer/ActiveRenderInfo/ActiveRenderInfo.cpp create mode 100644 net/minecraft/client/renderer/ActiveRenderInfo/ActiveRenderInfo.h diff --git a/Ripterms Ghost.vcxproj b/Ripterms Ghost.vcxproj index 0e03123..bbf464e 100644 --- a/Ripterms Ghost.vcxproj +++ b/Ripterms Ghost.vcxproj @@ -98,7 +98,7 @@ Windows true $(SolutionDir)Lib;$(SolutionDir)Lib\MinHook;$(SolutionDir)Lib\JNI;$(SolutionDir)Lib\miniz;%(AdditionalLibraryDirectories) - jawt.lib;jvm.lib;opengl32.lib;%(AdditionalDependencies) + jawt.lib;jvm.lib;opengl32.lib;Glu32.lib;%(AdditionalDependencies) @@ -121,7 +121,7 @@ true false $(SolutionDir)Lib;$(SolutionDir)Lib\MinHook;$(SolutionDir)Lib\JNI;$(SolutionDir)Lib\miniz;%(AdditionalLibraryDirectories) - jawt.lib;jvm.lib;opengl32.lib;%(AdditionalDependencies) + jawt.lib;jvm.lib;opengl32.lib;Glu32.lib;%(AdditionalDependencies) @@ -140,7 +140,7 @@ Windows true $(SolutionDir)Lib;$(SolutionDir)Lib\MinHook;$(SolutionDir)Lib\JNI;$(SolutionDir)Lib\miniz;%(AdditionalLibraryDirectories) - jawt.lib;jvm.lib;opengl32.lib;%(AdditionalDependencies) + jawt.lib;jvm.lib;opengl32.lib;Glu32.lib;%(AdditionalDependencies) @@ -163,7 +163,7 @@ true false $(SolutionDir)Lib;$(SolutionDir)Lib\MinHook;$(SolutionDir)Lib\JNI;$(SolutionDir)Lib\miniz;%(AdditionalLibraryDirectories) - jawt.lib;jvm.lib;opengl32.lib;%(AdditionalDependencies) + jawt.lib;jvm.lib;opengl32.lib;Glu32.lib;%(AdditionalDependencies) @@ -179,6 +179,8 @@ + + @@ -191,6 +193,7 @@ + @@ -232,6 +235,8 @@ + + @@ -243,6 +248,7 @@ + @@ -262,6 +268,7 @@ + diff --git a/Ripterms Ghost.vcxproj.filters b/Ripterms Ghost.vcxproj.filters index e18ba24..23f1d3f 100644 --- a/Ripterms Ghost.vcxproj.filters +++ b/Ripterms Ghost.vcxproj.filters @@ -192,6 +192,15 @@ Fichiers sources + + Fichiers sources + + + Fichiers sources + + + Fichiers sources + @@ -332,5 +341,17 @@ Fichiers d%27en-tête + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + \ No newline at end of file diff --git a/Ripterms/Cache/Cache.cpp b/Ripterms/Cache/Cache.cpp index 3940a87..9a29034 100644 --- a/Ripterms/Cache/Cache.cpp +++ b/Ripterms/Cache/Cache.cpp @@ -1,5 +1,6 @@ #include "Cache.h" #include +#include "../../net/minecraft/client/renderer/ActiveRenderInfo/ActiveRenderInfo.h" Ripterms::Cache::Cache() { @@ -25,6 +26,9 @@ bool Ripterms::Cache::fillCache() gameSettings = theMinecraft.getGameSettings(); timer = theMinecraft.getTimer(); playerController = theMinecraft.getPlayerController(); + //MODELVIEW = ActiveRenderInfo::getMODELVIEW(); + //PROJECTION = ActiveRenderInfo::getPROJECTION(); + //VIEWPORT = ActiveRenderInfo::getVIEWPORT(); } return true; } diff --git a/Ripterms/Cache/Cache.h b/Ripterms/Cache/Cache.h index a0b29b7..bd34edb 100644 --- a/Ripterms/Cache/Cache.h +++ b/Ripterms/Cache/Cache.h @@ -1,8 +1,9 @@ #pragma once -#include "../../java/lang/Object/Object.h" #include "../../net/minecraft/client/Minecraft/Minecraft.h" #include "../../java/util/Map/Map.h" #include "../../net/minecraft/util/Timer/Timer.h" +#include "../../java/nio/FloatBuffer/FloatBuffer.h" +#include "../../java/nio/IntBuffer/IntBuffer.h" namespace Ripterms { @@ -18,6 +19,9 @@ namespace Ripterms List playerEntities{}; GameSettings gameSettings{}; Timer timer{}; + FloatBuffer MODELVIEW{}; // not done + FloatBuffer PROJECTION{}; // not done + IntBuffer VIEWPORT{}; // not done Map EMPTY_MAP{}; bool fillCache(); diff --git a/Ripterms/Event/Event.h b/Ripterms/Event/Event.h index ef72135..e952475 100644 --- a/Ripterms/Event/Event.h +++ b/Ripterms/Event/Event.h @@ -1,9 +1,5 @@ #pragma once #include -#include -#include "../../java/lang/Object/Object.h" -#include "../../java/lang/String/String.h" -#include "../../java/util/Map/Map.h" namespace Ripterms { diff --git a/Ripterms/GUI/GUI.cpp b/Ripterms/GUI/GUI.cpp index fa82dc0..b404b49 100644 --- a/Ripterms/GUI/GUI.cpp +++ b/Ripterms/GUI/GUI.cpp @@ -1,13 +1,13 @@ #include "GUI.h" -#include -#include +#define IMGUI_DEFINE_MATH_OPERATORS #include #include #include -#include +#include #include "../Modules/Modules.h" #include "font.h" #include "../Hook/Hook.h" +#include "GUI_conf.h" namespace { @@ -131,6 +131,25 @@ static BOOL WINAPI detour_wglSwapBuffers(HDC unnamedParam1) ImGui_ImplWin32_NewFrame(); ImGui::NewFrame(); + + ImGui::SetNextWindowPos(ImVec2(0, 0)); + ImGui::SetNextWindowSize(ImGui::GetIO().DisplaySize); + ImGui::Begin("Overlay", nullptr, + ImGuiWindowFlags_NoTitleBar | + ImGuiWindowFlags_NoResize | + ImGuiWindowFlags_NoMove | + ImGuiWindowFlags_NoScrollbar | + ImGuiWindowFlags_NoInputs | + ImGuiWindowFlags_NoBackground); + for (const std::pair>& category : Ripterms::Modules::categories) + { + for (Ripterms::Modules::IModule* m : category.second) + { + m->render(); + } + } + ImGui::End(); + if (Ripterms::GUI::draw) { update_style(); diff --git a/Ripterms/GUI/GUI.h b/Ripterms/GUI/GUI.h index d13c357..e9ca21e 100644 --- a/Ripterms/GUI/GUI.h +++ b/Ripterms/GUI/GUI.h @@ -1,7 +1,5 @@ #pragma once -#include "imgui.h" - namespace Ripterms { namespace GUI @@ -9,44 +7,5 @@ namespace Ripterms inline bool draw = false; bool init(); void clean(); - - inline ImVec2 category_button_size = ImVec2(100, 30); - - /* other style*/ - - inline bool ripterms_title = true; - /* both are false by default but eh why not */ - inline bool show_color_theming = false; - inline bool show_rounding_theming = false; - - /* color picker colors */ - inline ImVec4 color_active_tab = ImVec4(.6f, .0f, .0f, 1.f); - //inline ImVec4 color_inactive_tab = ImVec4(.5f, .5f, .5f, 1.f); - inline ImColor color_child_bg = ImColor(23, 23, 23, 190); - inline ImColor color_bool_enabled = ImColor(10, 150, 10, 255); - inline ImColor color_bool_disabled = ImColor(173, 55, 65, 255); - inline ImColor color_slider_grab = ImColor(10, 150, 10, 255); - inline ImColor color_slider_line = ImColor(173, 55, 65, 255); - inline ImColor color_frame_bg = ImColor(35, 35, 35, 255); - inline ImColor color_frame_bg_active = ImColor(35, 35, 35, 255); - inline ImColor color_frame_bg_hovered = ImColor(35, 35, 35, 255); - inline ImColor color_window_bg = ImColor(11, 14, 15, 255); - inline ImColor color_button = ImColor(31, 30, 31, 255); - inline ImColor color_button_active = ImColor(239, 73, 88, 255); - inline ImColor color_button_hovered = ImColor(173, 55, 65, 255); - inline ImColor color_text = ImColor(200, 200, 200, 255); - inline ImColor color_header = ImColor(78, 78, 78, 255); - inline ImColor color_header_active = ImColor(78, 78, 78, 255); - inline ImColor color_header_hovered = ImColor(78, 78, 78, 255); - - /* rounding */ - - inline float rounding_frame = 10.f; - inline float rounding_window = 5.f; - inline float rounding_child = 5.f; - inline float rounding_grab = 5.f; - inline float rounding_popup = 5.f; - inline float rounding_scrollbar = 5.f; - inline float rounding_tab = 5.f; } } \ No newline at end of file diff --git a/Ripterms/GUI/GUI_conf.h b/Ripterms/GUI/GUI_conf.h new file mode 100644 index 0000000..3772554 --- /dev/null +++ b/Ripterms/GUI/GUI_conf.h @@ -0,0 +1,44 @@ +#pragma once +#include + +namespace Ripterms::GUI +{ + static ImVec2 category_button_size = ImVec2(100, 30); + + /* other style*/ + + static bool ripterms_title = true; + /* both are false by default but eh why not */ + static bool show_color_theming = false; + static bool show_rounding_theming = false; + + /* color picker colors */ + static ImVec4 color_active_tab = ImVec4(.6f, .0f, .0f, 1.f); + //inline ImVec4 color_inactive_tab = ImVec4(.5f, .5f, .5f, 1.f); + static ImColor color_child_bg = ImColor(23, 23, 23, 190); + static ImColor color_bool_enabled = ImColor(10, 150, 10, 255); + static ImColor color_bool_disabled = ImColor(173, 55, 65, 255); + static ImColor color_slider_grab = ImColor(10, 150, 10, 255); + static ImColor color_slider_line = ImColor(173, 55, 65, 255); + static ImColor color_frame_bg = ImColor(35, 35, 35, 255); + static ImColor color_frame_bg_active = ImColor(35, 35, 35, 255); + static ImColor color_frame_bg_hovered = ImColor(35, 35, 35, 255); + static ImColor color_window_bg = ImColor(11, 14, 15, 255); + static ImColor color_button = ImColor(31, 30, 31, 255); + static ImColor color_button_active = ImColor(239, 73, 88, 255); + static ImColor color_button_hovered = ImColor(173, 55, 65, 255); + static ImColor color_text = ImColor(200, 200, 200, 255); + static ImColor color_header = ImColor(78, 78, 78, 255); + static ImColor color_header_active = ImColor(78, 78, 78, 255); + static ImColor color_header_hovered = ImColor(78, 78, 78, 255); + + /* rounding */ + + static float rounding_frame = 10.f; + static float rounding_window = 5.f; + static float rounding_child = 5.f; + static float rounding_grab = 5.f; + static float rounding_popup = 5.f; + static float rounding_scrollbar = 5.f; + static float rounding_tab = 5.f; +} \ No newline at end of file diff --git a/Ripterms/Hook/Hook.cpp b/Ripterms/Hook/Hook.cpp index 3ac358b..06a87da 100644 --- a/Ripterms/Hook/Hook.cpp +++ b/Ripterms/Hook/Hook.cpp @@ -101,19 +101,25 @@ void Ripterms::Hook::hook_RELATIVE_5B_JMP(void* a_detour_function_addr, void** a our_tmp_instructions[10] = '\xff'; // jmp our_tmp_instructions[11] = '\xe0'; // rax - allocated_instructions = (uint8_t*)VirtualAlloc(nullptr, bytes_to_replace + 12, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); + + allocated_instructions = (uint8_t*)VirtualAlloc(nullptr, bytes_to_replace + 22, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); if (!allocated_instructions) throw std::exception("Failed to allocate memory for the hook"); *a_original_function_addr = allocated_instructions; // where to go once detour returns // we copy the original instructions to our allocated instructions, because they are going to be overwritten by the relative jmp instruction memcpy(allocated_instructions, target_function_addr, bytes_to_replace); - // jump back to normal execution flow - allocated_instructions[bytes_to_replace] = '\x48'; // mov - allocated_instructions[bytes_to_replace + 1] = '\xB8'; // rax, - *((uint64_t*)(allocated_instructions + bytes_to_replace + 2)) = (uint64_t)target_function_addr + bytes_to_replace; - allocated_instructions[bytes_to_replace + 10] = '\xff'; // jmp - allocated_instructions[bytes_to_replace + 11] = '\xe0'; // rax + // jump back to normal execution flow, by preserving registers and stack + // mov[rsp - 16], rax + // mov rax, 0x7e80e42e7d8e1b34 + // push rax + // mov rax, [rsp - 8] + // ret + uint8_t shell_code1[] = { 0x48, 0x89, 0x44, 0x24, 0xf0, 0x48, 0xb8 }; + memcpy(allocated_instructions + bytes_to_replace, shell_code1, 7); + *((uint64_t*)(allocated_instructions + bytes_to_replace + 7)) = (uint64_t)target_function_addr + bytes_to_replace; + uint8_t shell_code2[] = { 0x50, 0x48, 0x8B, 0x44, 0x24, 0xF8, 0xC3 }; + memcpy(allocated_instructions + bytes_to_replace + 15, shell_code2, 7); // relative jump from target_function_addr to our_tmp_instructions @@ -126,14 +132,12 @@ void Ripterms::Hook::hook_RELATIVE_5B_JMP(void* a_detour_function_addr, void** a VirtualProtect(target_function_addr, bytes_to_replace, original_protection, &original_protection); VirtualProtect(our_tmp_instructions, 12, PAGE_EXECUTE_READ, &original_protection); - VirtualProtect(allocated_instructions, bytes_to_replace + 12, PAGE_EXECUTE_READ, &original_protection); + VirtualProtect(allocated_instructions, bytes_to_replace + 22, PAGE_EXECUTE_READ, &original_protection); } void Ripterms::Hook::remove_RELATIVE_5B_JMP() { DWORD original_protection = 0; - VirtualProtect(our_tmp_instructions, 12, PAGE_EXECUTE_READWRITE, &original_protection); - VirtualProtect(allocated_instructions, bytes_to_replace + 12, PAGE_EXECUTE_READWRITE, &original_protection); VirtualProtect(target_function_addr, bytes_to_replace, PAGE_EXECUTE_READWRITE, &original_protection); memcpy(target_function_addr, allocated_instructions, bytes_to_replace); diff --git a/Ripterms/JavaClass/JavaClass.h b/Ripterms/JavaClass/JavaClass.h index d3b6591..3b5a6c0 100644 --- a/Ripterms/JavaClass/JavaClass.h +++ b/Ripterms/JavaClass/JavaClass.h @@ -53,7 +53,7 @@ namespace Ripterms static std::unordered_map> jclassCache; static std::unordered_map data; - inline static const nlohmann::json* mappings = nullptr; + inline static nlohmann::json mappings{}; std::string class_path{}; }; diff --git a/Ripterms/JavaClass/JavaClassV2.cpp b/Ripterms/JavaClass/JavaClassV2.cpp index f973458..ef210d1 100644 --- a/Ripterms/JavaClass/JavaClassV2.cpp +++ b/Ripterms/JavaClass/JavaClassV2.cpp @@ -1,71 +1,22 @@ #include "JavaClass.h" -#include "../Mappings/mappings_lunar_1_7_10.h" -#include "../Mappings/mappings_forge_1_7_10.h" -#include "../Mappings/mappings_lunar_1_8_9.h" -#include "../Mappings/mappings_vanilla_1_8_9.h" -#include "../Mappings/mappings_lunar_1_16_5.h" +#include std::unordered_map Ripterms::JavaClassV2::data{}; std::unordered_map> Ripterms::JavaClassV2::jclassCache{}; bool Ripterms::JavaClassV2::init() { - bool isSuccess = true; - int selected_version_index = -1; - const nlohmann::json* const allmaps[] = - { - Mappings::mappings_lunar_1_8_9, - Mappings::mappings_vanilla_1_8_9, - Mappings::mappings_lunar_1_7_10, - Mappings::mappings_lunar_1_16_5, - Mappings::mappings_forge_1_7_10 - }; - switch (version) - { - case LUNAR_1_8_9: - { - Ripterms::JavaClassV2::mappings = Mappings::mappings_lunar_1_8_9; - selected_version_index = 0; - break; - } - case VANILLA_1_8_9: - { - Ripterms::JavaClassV2::mappings = Mappings::mappings_vanilla_1_8_9; - selected_version_index = 1; - break; - } - case LUNAR_1_7_10: - { - Ripterms::JavaClassV2::mappings = Mappings::mappings_lunar_1_7_10; - selected_version_index = 2; - break; - } - case LUNAR_1_16_5: - { - Ripterms::JavaClassV2::mappings = Mappings::mappings_lunar_1_16_5; - selected_version_index = 3; - break; - } - case FORGE_1_7_10: - { - Ripterms::JavaClassV2::mappings = Mappings::mappings_forge_1_7_10; - selected_version_index = 4; - break; - } - default: + try { - std::cerr << "Cannot find mappings for the specified version" << std::endl; - isSuccess = false; - } + Ripterms::JavaClassV2::mappings = nlohmann::json::parse(version.mappings_text); } - for (int i = 0; i < sizeof(allmaps) / sizeof(nlohmann::json*); ++i) + catch (const nlohmann::json::exception& e) { - if (i == selected_version_index) continue; - delete allmaps[i]; + std::cout << "Failed to parse mapping file" << '\n'; + std::cerr << e.what() << '\n'; + return false; } - if (!isSuccess) return false; - auto& mappings = Ripterms::JavaClassV2::mappings[0]; if (mappings.empty()) return false; for (auto& [className, classContent] : mappings.items()) @@ -118,7 +69,6 @@ void Ripterms::JavaClassV2::clean() { if (Ripterms::p_env) jclassCache[Ripterms::p_env].clear(); - delete mappings; } Ripterms::JavaClassV2::JavaClassV2(const std::string& class_path) @@ -180,7 +130,7 @@ std::string Ripterms::JavaClassV2::getObfuscatedClassName() const { try { - return mappings[0][class_path]["obfuscated"]; + return mappings[class_path]["obfuscated"]; } catch (...) { @@ -192,7 +142,7 @@ std::string Ripterms::JavaClassV2::getObfuscatedFieldName(const std::string& nam { try { - for (auto& field : mappings[0][class_path]["fields"]) + for (auto& field : mappings[class_path]["fields"]) { if (name == std::string(field["name"])) return field["obfuscated"]; @@ -208,7 +158,7 @@ std::string Ripterms::JavaClassV2::getObfuscatedMethodName(const std::string& na { try { - for (auto& method : mappings[0][class_path]["methods"]) + for (auto& method : mappings[class_path]["methods"]) { if (name == std::string(method["name"])) return method["obfuscated"]; @@ -224,7 +174,7 @@ std::string Ripterms::JavaClassV2::getObfuscatedFieldSig(const std::string& name { try { - for (auto& field : mappings[0][class_path]["fields"]) + for (auto& field : mappings[class_path]["fields"]) { if (name == std::string(field["name"])) return field["signature"]; @@ -240,7 +190,7 @@ std::string Ripterms::JavaClassV2::getObfuscatedMethodSig(const std::string& nam { try { - for (auto& method : mappings[0][class_path]["methods"]) + for (auto& method : mappings[class_path]["methods"]) { if (name == std::string(method["name"])) return method["signature"]; @@ -315,7 +265,7 @@ Ripterms::JavaClassV2::JClass::~JClass() void Ripterms::JavaClassV2::reload() { - auto& classMapping = Ripterms::JavaClassV2::mappings[0][class_path]; + auto& classMapping = Ripterms::JavaClassV2::mappings[class_path]; JClass javaClass = findClass(classMapping["obfuscated"]); Ripterms::JavaClassV2::JavaClassData classData{}; for (auto& field : classMapping["fields"]) diff --git a/Ripterms/Mappings/mappings_forge_1_7_10.h b/Ripterms/Mappings/mappings_forge_1_7_10.h index 4fc16cb..492f240 100644 --- a/Ripterms/Mappings/mappings_forge_1_7_10.h +++ b/Ripterms/Mappings/mappings_forge_1_7_10.h @@ -1,8 +1,7 @@ #pragma once namespace Mappings { - using namespace nlohmann::literals; - static const nlohmann::json* const mappings_forge_1_7_10 = new const nlohmann::json(R"( + constexpr inline char mappings_forge_1_7_10[] = R"( { "java/lang/Object": { "obfuscated": "java/lang/Object", @@ -726,5 +725,5 @@ namespace Mappings ] } } -)"_json); +)"; } \ No newline at end of file diff --git a/Ripterms/Mappings/mappings_lunar_1_16_5.h b/Ripterms/Mappings/mappings_lunar_1_16_5.h index e235819..f6a38a6 100644 --- a/Ripterms/Mappings/mappings_lunar_1_16_5.h +++ b/Ripterms/Mappings/mappings_lunar_1_16_5.h @@ -1,8 +1,7 @@ #pragma once namespace Mappings { - using namespace nlohmann::literals; - static const nlohmann::json* const mappings_lunar_1_16_5 = new const nlohmann::json(R"( + constexpr inline char mappings_lunar_1_16_5[] = R"( { "java/lang/Object": { "obfuscated": "java/lang/Object", @@ -662,5 +661,5 @@ namespace Mappings ] } } -)"_json); +)"; } \ No newline at end of file diff --git a/Ripterms/Mappings/mappings_lunar_1_7_10.h b/Ripterms/Mappings/mappings_lunar_1_7_10.h index d409ce4..2c50ae4 100644 --- a/Ripterms/Mappings/mappings_lunar_1_7_10.h +++ b/Ripterms/Mappings/mappings_lunar_1_7_10.h @@ -1,8 +1,7 @@ #pragma once namespace Mappings { - using namespace nlohmann::literals; - static const nlohmann::json* const mappings_lunar_1_7_10 = new const nlohmann::json(R"( + constexpr inline char mappings_lunar_1_7_10[] = R"( { "java/lang/Object": { "obfuscated": "java/lang/Object", @@ -714,5 +713,5 @@ namespace Mappings ] } } -)"_json); +)"; } \ No newline at end of file diff --git a/Ripterms/Mappings/mappings_lunar_1_8_9.h b/Ripterms/Mappings/mappings_lunar_1_8_9.h index b773081..5dfb4e3 100644 --- a/Ripterms/Mappings/mappings_lunar_1_8_9.h +++ b/Ripterms/Mappings/mappings_lunar_1_8_9.h @@ -1,8 +1,7 @@ #pragma once namespace Mappings { - using namespace nlohmann::literals; - static const nlohmann::json* const mappings_lunar_1_8_9 = new const nlohmann::json(R"( + constexpr inline char mappings_lunar_1_8_9[] = R"( { "java/lang/Object": { "obfuscated": "java/lang/Object", @@ -734,7 +733,57 @@ namespace Mappings "static": false } ] + }, +)" +R"( + "net/minecraft/client/renderer/ActiveRenderInfo": { + "obfuscated": "net/minecraft/client/renderer/ActiveRenderInfo", + "fields": [ + { + "name": "MODELVIEW", + "obfuscated": "MODELVIEW", + "signature": "Ljava/nio/FloatBuffer;", + "static": true + }, + { + "name": "PROJECTION", + "obfuscated": "PROJECTION", + "signature": "Ljava/nio/FloatBuffer;", + "static": true + }, + { + "name": "VIEWPORT", + "obfuscated": "VIEWPORT", + "signature": "Ljava/nio/IntBuffer;", + "static": true + } + ], + "methods": [] + }, + "java/nio/FloatBuffer": { + "obfuscated": "java/nio/FloatBuffer", + "fields": [], + "methods": [ + { + "name": "get", + "obfuscated": "get", + "signature": "(I)F", + "static": false + } + ] + }, + "java/nio/IntBuffer": { + "obfuscated": "java/nio/IntBuffer", + "fields": [], + "methods": [ + { + "name": "get", + "obfuscated": "get", + "signature": "(I)I", + "static": false + } + ] } } -)"_json); +)"; } \ No newline at end of file diff --git a/Ripterms/Mappings/mappings_vanilla_1_8_9.h b/Ripterms/Mappings/mappings_vanilla_1_8_9.h index 518a952..c2c3e12 100644 --- a/Ripterms/Mappings/mappings_vanilla_1_8_9.h +++ b/Ripterms/Mappings/mappings_vanilla_1_8_9.h @@ -1,8 +1,7 @@ #pragma once namespace Mappings { - using namespace nlohmann::literals; - static const nlohmann::json* const mappings_vanilla_1_8_9 = new const nlohmann::json(R"( + constexpr inline char mappings_vanilla_1_8_9[] = R"( { "java/lang/Object": { "obfuscated": "java/lang/Object", @@ -736,5 +735,5 @@ namespace Mappings ] } } -)"_json); +)"; } \ No newline at end of file diff --git a/Ripterms/Maths/Maths.cpp b/Ripterms/Maths/Maths.cpp index c6e5629..aa49db7 100644 --- a/Ripterms/Maths/Maths.cpp +++ b/Ripterms/Maths/Maths.cpp @@ -1,4 +1,8 @@ #include "Maths.h" +#include +#include +#include +#include Ripterms::Maths::Vector2d Ripterms::Maths::getYawPitch(Vector3d playerPos, Vector3d facingPos) { @@ -35,16 +39,6 @@ float Ripterms::Maths::cropAngle360(float angle) return angle; } -Ripterms::Maths::Vector2d Ripterms::Maths::worldToScreen(const Vector3d& world_pos) -{ - float model_matrix[4][4] = {0}; - float view_matrix[4][4] = {0}; - float projection_matrix[4][4] = {0}; - - float model_view_matrix[4][4] = { 0 }; - - return {}; -} Ripterms::Maths::Vector3d::Vector3d() { @@ -143,7 +137,7 @@ Ripterms::Maths::Matrix::operator bool() const return is_valid(); } -Ripterms::Maths::Matrix Ripterms::Maths::Matrix::operator*(const Matrix& other_matrix) +Ripterms::Maths::Matrix Ripterms::Maths::Matrix::operator*(const Matrix& other_matrix) const { if (!is_valid() || !other_matrix.is_valid() || this->column_number != other_matrix.line_number) return { {0} }; @@ -162,7 +156,7 @@ Ripterms::Maths::Matrix Ripterms::Maths::Matrix::operator*(const Matrix& other_m } -Ripterms::Maths::Matrix Ripterms::Maths::Matrix::operator+(const Matrix& other_matrix) +Ripterms::Maths::Matrix Ripterms::Maths::Matrix::operator+(const Matrix& other_matrix) const { if (line_number != other_matrix.line_number || column_number != other_matrix.column_number) return { {0} }; @@ -209,3 +203,64 @@ Ripterms::Maths::Matrix::~Matrix() delete data; } } + +Ripterms::Maths::Vector2d Ripterms::Maths::worldToScreen( + const Vector3d& world_pos, Matrix& view_matrix, + Matrix& projection_matrix, Matrix& view_port) +{ + // not done + Vector2d ndc(0.0f, 0.0f); + + GLdouble modelMatrix[16] = + { + view_matrix[0][0], + view_matrix[0][1], + view_matrix[0][2], + view_matrix[0][3], + view_matrix[1][0], + view_matrix[1][1], + view_matrix[1][2], + view_matrix[1][3], + view_matrix[2][0], + view_matrix[2][1], + view_matrix[2][2], + view_matrix[2][3], + view_matrix[3][0], + view_matrix[3][1], + view_matrix[3][2], + view_matrix[3][3] + }; + + GLdouble projectionMatrix[16] = + { + projection_matrix[0][0], + projection_matrix[0][1], + projection_matrix[0][2], + projection_matrix[0][3], + projection_matrix[1][0], + projection_matrix[1][1], + projection_matrix[1][2], + projection_matrix[1][3], + projection_matrix[2][0], + projection_matrix[2][1], + projection_matrix[2][2], + projection_matrix[2][3], + projection_matrix[3][0], + projection_matrix[3][1], + projection_matrix[3][2], + projection_matrix[3][3] + }; + + GLint viewport[4] = + { + (int)view_port[0][0], + (int)view_port[1][0], + (int)view_port[2][0], + (int)view_port[3][0], + }; + GLdouble x = 0.0, y = 0.0, z = 0.0; + gluProject(world_pos.x, world_pos.y, world_pos.z, modelMatrix, projectionMatrix, viewport, &x, &y, &z); + ndc.x = (float)x; + ndc.y = (float)y; + return ndc; +} diff --git a/Ripterms/Maths/Maths.h b/Ripterms/Maths/Maths.h index 43a6d45..22bfc0f 100644 --- a/Ripterms/Maths/Maths.h +++ b/Ripterms/Maths/Maths.h @@ -1,5 +1,4 @@ #pragma once -#include #include namespace Ripterms @@ -43,8 +42,8 @@ namespace Ripterms float* operator [](int index); operator bool() const; - Matrix operator *(const Matrix& other_matrix); - Matrix operator +(const Matrix& other_matrix); + Matrix operator *(const Matrix& other_matrix) const; + Matrix operator +(const Matrix& other_matrix) const; bool is_valid() const; std::string to_string() const; @@ -54,6 +53,8 @@ namespace Ripterms float** data; }; - Vector2d worldToScreen(const Vector3d& world_pos); + Vector2d worldToScreen( + const Vector3d& world_pos, Matrix& view_matrix, + Matrix& projection_matrix, Matrix& view_port); } } \ No newline at end of file diff --git a/Ripterms/Modules/AimAssist.cpp b/Ripterms/Modules/AimAssist.cpp index 5a85d88..8c79131 100644 --- a/Ripterms/Modules/AimAssist.cpp +++ b/Ripterms/Modules/AimAssist.cpp @@ -1,4 +1,7 @@ #include "Modules.h" +#include "../GUI/GUI.h" +#include "../Cache/Cache.h" +#include void Ripterms::Modules::AimAssist::run() { @@ -6,6 +9,7 @@ void Ripterms::Modules::AimAssist::run() if (!enabled || !(GetKeyState(VK_LBUTTON) & 0x8000) || GUI::draw) { prev_selected_target.clear(); + target_pos = { 0.0f, 0.0f, 0.0f }; return; } @@ -67,6 +71,7 @@ void Ripterms::Modules::AimAssist::run() if (selected_target.isValid()) { + target_pos = selected_target.getPosition(); prev_selected_target = selected_target; Ripterms::Maths::Vector3d selected_target_mvmt_vec = selected_target.getMovementVector(cache->timer.getRenderPartialTicks()); AxisAlignedBB selected_target_bb = selected_target.getBoundingBox(); @@ -161,6 +166,8 @@ void Ripterms::Modules::AimAssist::run() } cache->thePlayer.setRotation(thePlayer_rotation); } + else + target_pos = { 0.0f, 0.0f, 0.0f }; } void Ripterms::Modules::AimAssist::renderGUI() @@ -187,4 +194,20 @@ void Ripterms::Modules::AimAssist::renderGUI() ImGui::SliderFloat("Multiplier Pitch", &multiplierPitch, 0.1f, 2.0f, "%.1f"); ImGui::EndGroup(); } -} \ No newline at end of file +} + +void Ripterms::Modules::AimAssist::render() +{ + return; //testing purposes, will fix world to screen later + if (target_pos.x == 0.0f && target_pos.y == 0.0f && target_pos.z == 0.0f) + return; + + ImVec2 winSize = ImGui::GetWindowSize(); + + Ripterms::Maths::Matrix modelview = cache->MODELVIEW.toMatrix(4, 4); + Ripterms::Maths::Matrix projection = cache->PROJECTION.toMatrix(4, 4); + Ripterms::Maths::Matrix viewport = cache->VIEWPORT.toMatrix(4, 1); + + Ripterms::Maths::Vector2d vector = Ripterms::Maths::worldToScreen(target_pos, modelview, projection, viewport); + ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(vector.x, vector.y), ImVec2(vector.x + 50.0f, vector.y + 50.0f), ImColor(255, 30, 15, 255)); +} diff --git a/Ripterms/Modules/Blink.cpp b/Ripterms/Modules/Blink.cpp index 72c1759..452398a 100644 --- a/Ripterms/Modules/Blink.cpp +++ b/Ripterms/Modules/Blink.cpp @@ -1,13 +1,9 @@ #include "Modules.h" +#include "../Cache/Cache.h" +#include void Ripterms::Modules::Blink::run() { - static CTimer timer = std::chrono::milliseconds(300); - if (GetAsyncKeyState(keyBind) && timer.isElapsed() && GetActiveWindow() == Ripterms::window) - { - enabled = !enabled; - } - static bool prev_enabled = false; if (!enabled) { diff --git a/Ripterms/Modules/ClientBrandChanger.cpp b/Ripterms/Modules/ClientBrandChanger.cpp index 14e91c2..1c87159 100644 --- a/Ripterms/Modules/ClientBrandChanger.cpp +++ b/Ripterms/Modules/ClientBrandChanger.cpp @@ -1,5 +1,6 @@ #include "Modules.h" -#include "../Patcher/Patcher.h" +#include "../Cache/Cache.h" +#include void Ripterms::Modules::ClientBrandChanger::renderGUI() { diff --git a/Ripterms/Modules/FullBright.cpp b/Ripterms/Modules/FullBright.cpp index ba14fc2..286360d 100644 --- a/Ripterms/Modules/FullBright.cpp +++ b/Ripterms/Modules/FullBright.cpp @@ -1,4 +1,6 @@ #include "Modules.h" +#include "../Cache/Cache.h" +#include void Ripterms::Modules::FullBright::run() { diff --git a/Ripterms/Modules/LeftClicker.cpp b/Ripterms/Modules/LeftClicker.cpp index bcb4d49..6466a71 100644 --- a/Ripterms/Modules/LeftClicker.cpp +++ b/Ripterms/Modules/LeftClicker.cpp @@ -1,4 +1,7 @@ #include "Modules.h" +#include "../GUI/GUI.h" +#include "../Cache/Cache.h" +#include void Ripterms::Modules::LeftClicker::run() { diff --git a/Ripterms/Modules/LegitScaffold.cpp b/Ripterms/Modules/LegitScaffold.cpp index 98c2387..2e89f1a 100644 --- a/Ripterms/Modules/LegitScaffold.cpp +++ b/Ripterms/Modules/LegitScaffold.cpp @@ -1,4 +1,6 @@ #include "Modules.h" +#include "../Cache/Cache.h" +#include void Ripterms::Modules::LegitScaffold::onEvent(Ripterms::Event* event) { diff --git a/Ripterms/Modules/Modules.cpp b/Ripterms/Modules/Modules.cpp index 6272601..a21e629 100644 --- a/Ripterms/Modules/Modules.cpp +++ b/Ripterms/Modules/Modules.cpp @@ -1,5 +1,6 @@ #include "Modules.h" -#include +#include "../Cache/Cache.h" +#include void Ripterms::Modules::IModule::run() { @@ -9,6 +10,10 @@ void Ripterms::Modules::IModule::renderGUI() { } +void Ripterms::Modules::IModule::render() +{ +} + void Ripterms::Modules::IModule::disable() { } @@ -77,11 +82,6 @@ void Ripterms::Modules::FastPlace::renderGUI() void Ripterms::Modules::Xray::run() { - static CTimer timer = std::chrono::milliseconds(300); - if (GetAsyncKeyState(keyBind) && timer.isElapsed() && GetActiveWindow() == Ripterms::window) - { - enabled = !enabled; - } static bool prev_enabled = false; if (!enabled) { @@ -160,3 +160,7 @@ void Ripterms::Modules::Sprint::renderGUI() ImGui::PopStyleVar(); ImGui::PopStyleVar(); } + +void Ripterms::Modules::ESP::render() +{ +} diff --git a/Ripterms/Modules/Modules.h b/Ripterms/Modules/Modules.h index 4694fe3..1798aee 100644 --- a/Ripterms/Modules/Modules.h +++ b/Ripterms/Modules/Modules.h @@ -1,11 +1,8 @@ #pragma once -#include "../Cache/Cache.h" -#include "../GUI/GUI.h" #include "../../java/lang/String/String.h" -#include -#include #include #include "../Event/Event.h" +#include "../Maths/Maths.h" namespace Ripterms { @@ -16,6 +13,7 @@ namespace Ripterms public: virtual void run(); virtual void renderGUI(); + virtual void render(); virtual void disable(); virtual void onEvent(Ripterms::Event* event); protected: @@ -31,11 +29,13 @@ namespace Ripterms public: void run() override; void renderGUI() override; + void render() override; private: float max_distance = 6.0f; float max_angle = 80.0f; float multiplier = 1.0f; float multiplierPitch = 0.5f; + Ripterms::Maths::Vector3d target_pos{}; }; class Reach : public IModule @@ -112,8 +112,6 @@ namespace Ripterms void run() override; void renderGUI() override; void disable() override; - private: - int keyBind = VK_NUMPAD1; }; class LegitScaffold : public IModule @@ -149,16 +147,19 @@ namespace Ripterms void run() override; void renderGUI() override; void disable() override; - private: - int keyBind = VK_NUMPAD2; }; + class ESP : public IModule + { + public: + void render() override; + }; inline std::map> categories = { {"Combat", {new AimAssist(), new Reach(), new LeftClicker(), new WTap()}}, {"Player", {new Velocity(), new FastPlace(), new Blink(), new LegitScaffold(), new Sprint()}}, - {"Render", {new Xray(), new FullBright()}}, + {"Render", {new Xray(), new FullBright(), new ESP()}}, {"Whatever", {new ClientBrandChanger(), new Test()}} }; diff --git a/Ripterms/Modules/Reach.cpp b/Ripterms/Modules/Reach.cpp index a286c09..328339a 100644 --- a/Ripterms/Modules/Reach.cpp +++ b/Ripterms/Modules/Reach.cpp @@ -1,6 +1,7 @@ #include "Modules.h" -#include "../Patcher/Patcher.h" +#include "../Cache/Cache.h" #include "../../java/lang/String/String.h" +#include void Ripterms::Modules::Reach::run() diff --git a/Ripterms/Modules/Test.cpp b/Ripterms/Modules/Test.cpp index 9aeef1a..0a7bf90 100644 --- a/Ripterms/Modules/Test.cpp +++ b/Ripterms/Modules/Test.cpp @@ -1,6 +1,10 @@ #include "Modules.h" -#include "../../java/lang/ClassLoader/ClassLoader.h" -#include "../../net/minecraft/network/play/client/C03PacketPlayer/C04PacketPlayerPosition/C04PacketPlayerPosition.h" +#include +#include "../Cache/Cache.h" +#include +#include +#include "../GUI/GUI.h" +#include "../../net/minecraft/client/renderer/ActiveRenderInfo/ActiveRenderInfo.h" void Ripterms::Modules::Test::renderGUI() { @@ -17,20 +21,6 @@ void Ripterms::Modules::Test::renderGUI() std::cout << "not found" << std::endl; } Ripterms::Maths::Vector3d position = cache->thePlayer.getPosition(); - Ripterms::Maths::Vector2d rotation = cache->thePlayer.getRotation(); - - const float PI = 3.1415926535; - float yaw = rotation.x * (PI / 180.0f); - float pitch = rotation.y * (PI / 180.0f); - const float move_forward = 1.0f; - Ripterms::Maths::Vector3d motion{}; - - float hypxz = std::cos(pitch) * move_forward; - motion.z = std::cos(yaw) * hypxz; - motion.x = -std::sin(yaw) * hypxz; - motion.y = -std::sin(pitch) * move_forward; - - position = position + motion; - cache->thePlayer.getSendQueue().addToSendQueue(C04PacketPlayerPosition::newObject1_7_10(position, position.y, false)); + position.x += 2.0f; } } \ No newline at end of file diff --git a/Ripterms/Modules/Velocity.cpp b/Ripterms/Modules/Velocity.cpp index abf636c..ca97956 100644 --- a/Ripterms/Modules/Velocity.cpp +++ b/Ripterms/Modules/Velocity.cpp @@ -1,4 +1,6 @@ #include "Modules.h" +#include "../Cache/Cache.h" +#include void Ripterms::Modules::Velocity::run() { diff --git a/Ripterms/Patcher/ClassPatcherJar.h b/Ripterms/Patcher/ClassPatcherJar.h index b976cf1..3df5a71 100644 --- a/Ripterms/Patcher/ClassPatcherJar.h +++ b/Ripterms/Patcher/ClassPatcherJar.h @@ -2,7 +2,7 @@ #include #include //see asm folder -constexpr std::array ClassPatcherJar = { +constexpr static std::array ClassPatcherJar = { 0x50, 0x4B, 0x03, 0x04, 0x0A, 0x00, 0x00, 0x08, 0x00, 0x00, 0x2E, 0x01, 0x4A, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x4D, 0x45, 0x54, 0x41, 0x2D, 0x49, 0x4E, 0x46, 0x2F, 0x50, 0x4B, 0x03, 0x04, 0x14, 0x00, 0x00, 0x08, 0x08, diff --git a/Ripterms/Patcher/Patcher.cpp b/Ripterms/Patcher/Patcher.cpp index e6ff911..3aac91a 100644 --- a/Ripterms/Patcher/Patcher.cpp +++ b/Ripterms/Patcher/Patcher.cpp @@ -33,11 +33,10 @@ namespace Ripterms::JavaClassV2 EntityPlayerSPClass ( ( - Ripterms::version == Ripterms::Version::FORGE_1_7_10 - || Ripterms::version == Ripterms::Version::LUNAR_1_7_10 + Ripterms::version.type == Ripterms::Version::MAJOR_1_7_10 ? "net/minecraft/client/entity/EntityClientPlayerMP" : "net/minecraft/client/entity/EntityPlayerSP" - ) + ) ); Ripterms::JavaClassV2 EntityPlayerClass("net/minecraft/entity/player/EntityPlayer"); @@ -50,7 +49,7 @@ namespace EntityPlayerClass.getJClass() }; errCheck(Ripterms::p_tienv->RetransformClasses(sizeof(classes) / sizeof(jclass), classes)); - if (Ripterms::majorVersion != Ripterms::Version::MAJOR_1_16_5) + if (Ripterms::version.type != Ripterms::Version::MAJOR_1_16_5) { Ripterms::JavaClassV2 BlockClass("net/minecraft/block/Block"); Ripterms::JavaClassV2 GL11Class("org/lwjgl/opengl/GL11"); @@ -81,8 +80,7 @@ namespace Ripterms::JavaClassV2 EntityPlayerSPClass ( ( - Ripterms::version == Ripterms::Version::FORGE_1_7_10 - || Ripterms::version == Ripterms::Version::LUNAR_1_7_10 + Ripterms::version.type == Ripterms::Version::MAJOR_1_7_10 ? "net/minecraft/client/entity/EntityClientPlayerMP" : "net/minecraft/client/entity/EntityPlayerSP" ) @@ -180,7 +178,7 @@ namespace NetworkManager.getInstance() }); } - else if (Ripterms::majorVersion != Ripterms::Version::MAJOR_1_16_5 && redefinedClass.isEqualTo(BlockClass.getJClass(jni_env))) + else if (Ripterms::version.type != Ripterms::Version::MAJOR_1_16_5 && redefinedClass.isEqualTo(BlockClass.getJClass(jni_env))) { Ripterms::JavaClassV2 RegistryClass("net/minecraft/util/registry/Registry"); Ripterms::JavaClassV2 RegistryNamespacedClass("net/minecraft/util/RegistryNamespaced"); @@ -193,8 +191,7 @@ namespace String RessourceLocation ( ( - Ripterms::version == Ripterms::Version::LUNAR_1_7_10 || - Ripterms::version == Ripterms::Version::FORGE_1_7_10 + Ripterms::version.type == Ripterms::Version::MAJOR_1_7_10 ? "none" : Ripterms::JavaClassV2("net/minecraft/util/ResourceLocation").getObfuscatedClassName() ), jni_env @@ -209,7 +206,7 @@ namespace RessourceLocation.getInstance() }); } - else if (Ripterms::majorVersion != Ripterms::Version::MAJOR_1_16_5 && redefinedClass.isEqualTo(GL11Class.getJClass(jni_env))) + else if (Ripterms::version.type != Ripterms::Version::MAJOR_1_16_5 && redefinedClass.isEqualTo(GL11Class.getJClass(jni_env))) { Ripterms::JavaClassV2 ClassPatcherClass("io/github/lefraudeur/ClassPatcher"); diff --git a/Ripterms/Ripterms.cpp b/Ripterms/Ripterms.cpp index 8b42d88..66f765a 100644 --- a/Ripterms/Ripterms.cpp +++ b/Ripterms/Ripterms.cpp @@ -8,6 +8,7 @@ #include "../java/lang/System/System.h" #include "Event/Event.h" #include "Hook/Hook.h" +#include static void mainLoop() { @@ -139,59 +140,37 @@ BOOL Ripterms::init(HMODULE dll) freopen_s(&console_buffer3, "CONIN$", "r", stdin); Ripterms::window = getCurrentWindow(); std::string windowName = getWindowName(window); - if (windowName.find("Lunar Client 1.8.9") != std::string::npos) + for (Version v : versions) { - version = LUNAR_1_8_9; - majorVersion = MAJOR_1_8_9; + if (windowName.find(v.name) != std::string::npos) + { + Ripterms::version = v; + break; + } } - else if - ( - (windowName.find("Badlion Minecraft Client") != std::string::npos && windowName.find("1.8.9") != std::string::npos) - ) + switch (version.type) { - version = VANILLA_1_8_9; - majorVersion = MAJOR_1_8_9; - } - else if (windowName.find("Lunar Client 1.7.10") != std::string::npos) - { - version = LUNAR_1_7_10; - majorVersion = MAJOR_1_8_9; - } - else if - ( - windowName.find("Lunar Client 1.16.5") != std::string::npos || - windowName.find("Lunar Client 1.17.1") != std::string::npos || - windowName.find("Lunar Client 1.18.2") != std::string::npos - ) - { - version = LUNAR_1_16_5; - majorVersion = MAJOR_1_16_5; - } - else if (windowName.find("Paladium") != std::string::npos || windowName.find("Minecraft 1.7.10") != std::string::npos) - { - version = FORGE_1_7_10; - majorVersion = MAJOR_1_8_9; - } - else - { - std::cerr << "unknown version" << std::endl; - return FALSE; - } - if (majorVersion == MAJOR_1_8_9) + case Version::MAJOR_1_8_9: + case Version::MAJOR_1_7_10: { Ripterms::Module lwjgl("lwjgl64.dll"); if (!lwjgl) return FALSE; targetnglClear = (nglClearType)lwjgl.getProcAddress("Java_org_lwjgl_opengl_GL11_nglClear"); hook = new Ripterms::Hook(6, targetnglClear, detournglClear, (void**)&originalnglClear, Ripterms::Hook::RELATIVE_5B_JMP); + break; } - else if (majorVersion == MAJOR_1_16_5) + case Version::MAJOR_1_16_5: { Ripterms::Module lwjgl("lwjgl_opengl.dll"); if (!lwjgl) return FALSE; targetglClear = (glClearType)lwjgl.getProcAddress("Java_org_lwjgl_opengl_GL11C_glClear"); - hook = new Ripterms::Hook(17, targetglClear, detourglClear, (void**)&originalglClear, Ripterms::Hook::RELATIVE_5B_JMP); + hook = new Ripterms::Hook(6, targetglClear, detourglClear, (void**)&originalglClear, Ripterms::Hook::RELATIVE_5B_JMP); + break; + } + default: + return FALSE; } if (!GUI::init()) return FALSE; return TRUE; @@ -212,8 +191,7 @@ void Ripterms::clean() fclose(console_buffer3); FreeConsole(); delete hook; - std::thread a(FreeLibrary, Ripterms::module); - a.detach(); + std::thread(FreeLibrary, Ripterms::module).detach(); } void Ripterms::partialClean() diff --git a/Ripterms/Ripterms.h b/Ripterms/Ripterms.h index c57b69d..ab642aa 100644 --- a/Ripterms/Ripterms.h +++ b/Ripterms/Ripterms.h @@ -3,25 +3,44 @@ #include #include #include -#include +#include +#include "Hook/Hook.h" +#include "Mappings/mappings_lunar_1_8_9.h" +#include "Mappings/mappings_lunar_1_7_10.h" +#include "Mappings/mappings_lunar_1_16_5.h" +#include "Mappings/mappings_vanilla_1_8_9.h" +#include "Mappings/mappings_forge_1_7_10.h" namespace Ripterms { inline HINSTANCE module = nullptr; inline HWND window = nullptr; - enum Version + + struct Version + { + std::string name{}; + const char* mappings_text = nullptr; + enum + { + UNDEFINED, + MAJOR_1_7_10, + MAJOR_1_8_9, + MAJOR_1_16_5 + } type = UNDEFINED; + }; + inline Version versions[] = { - UNDEFINED, - LUNAR_1_7_10, - LUNAR_1_8_9, - VANILLA_1_8_9, - LUNAR_1_16_5, - FORGE_1_7_10, - MAJOR_1_8_9, - MAJOR_1_16_5 + {"Lunar Client 1.18.2", Mappings::mappings_lunar_1_16_5, Version::MAJOR_1_16_5}, + {"Lunar Client 1.17.1", Mappings::mappings_lunar_1_16_5, Version::MAJOR_1_16_5}, + {"Lunar Client 1.16.5", Mappings::mappings_lunar_1_16_5, Version::MAJOR_1_16_5}, + {"Lunar Client 1.8.9", Mappings::mappings_lunar_1_8_9, Version::MAJOR_1_8_9}, + {"Badlion Minecraft Client", Mappings::mappings_vanilla_1_8_9, Version::MAJOR_1_8_9}, + {"Lunar Client 1.7.10", Mappings::mappings_lunar_1_7_10, Version::MAJOR_1_7_10}, + {"Minecraft 1.7.10", Mappings::mappings_forge_1_7_10, Version::MAJOR_1_7_10}, + {"Paladium", Mappings::mappings_forge_1_7_10, Version::MAJOR_1_7_10} }; - inline Version version = UNDEFINED; - inline Version majorVersion = UNDEFINED; + inline Version version{}; + inline JavaVM* p_jvm = nullptr; inline JNIEnv* p_env = nullptr; inline jvmtiEnv* p_tienv = nullptr; diff --git a/java/lang/Object/Object.h b/java/lang/Object/Object.h index 4fe002d..0c8805e 100644 --- a/java/lang/Object/Object.h +++ b/java/lang/Object/Object.h @@ -1,7 +1,6 @@ #pragma once #include #include "../../../Ripterms/Ripterms.h" -#include "../../../Ripterms/Maths/Maths.h" #include "../../../Ripterms/JavaClass/JavaClass.h" class Object { diff --git a/java/nio/FloatBuffer/FloatBuffer.cpp b/java/nio/FloatBuffer/FloatBuffer.cpp new file mode 100644 index 0000000..3f76221 --- /dev/null +++ b/java/nio/FloatBuffer/FloatBuffer.cpp @@ -0,0 +1,26 @@ +#include "FloatBuffer.h" + +float FloatBuffer::get(int index) +{ + if (!instance) + return 0.0f; + return env->CallFloatMethod(instance, FloatBufferClass.getMethodID("get"), index); +} + +Ripterms::Maths::Matrix FloatBuffer::toMatrix(int lines, int columns) +{ + Ripterms::Maths::Matrix result(lines, columns); + if (!instance) + return result; + + int c = 0; + for (int i = 0; i < lines; ++i) + { + for (int b = 0; b < columns; ++b) + { + result[i][b] = get(c); + c++; + } + } + return result; +} diff --git a/java/nio/FloatBuffer/FloatBuffer.h b/java/nio/FloatBuffer/FloatBuffer.h new file mode 100644 index 0000000..ebc82a8 --- /dev/null +++ b/java/nio/FloatBuffer/FloatBuffer.h @@ -0,0 +1,13 @@ +#pragma once +#include "../../lang/Object/Object.h" +#include "../../../Ripterms/Maths/Maths.h" + +class FloatBuffer : public Object { +public: + using Object::Object; + float get(int index); + Ripterms::Maths::Matrix toMatrix(int lines, int columns); + +protected: + inline static Ripterms::JavaClassV2 FloatBufferClass{ "java/nio/FloatBuffer" }; +}; diff --git a/java/nio/IntBuffer/IntBuffer.cpp b/java/nio/IntBuffer/IntBuffer.cpp new file mode 100644 index 0000000..23f2ecb --- /dev/null +++ b/java/nio/IntBuffer/IntBuffer.cpp @@ -0,0 +1,26 @@ +#include "IntBuffer.h" + +int IntBuffer::get(int index) +{ + if (!instance) + return 0; + return env->CallIntMethod(instance, IntBufferClass.getMethodID("get"), index); +} + +Ripterms::Maths::Matrix IntBuffer::toMatrix(int lines, int columns) +{ + Ripterms::Maths::Matrix result(lines, columns); + if (!instance) + return result; + + int c = 0; + for (int i = 0; i < lines; ++i) + { + for (int b = 0; b < columns; ++b) + { + result[i][b] = (float)get(c); + c++; + } + } + return result; +} diff --git a/java/nio/IntBuffer/IntBuffer.h b/java/nio/IntBuffer/IntBuffer.h new file mode 100644 index 0000000..2492847 --- /dev/null +++ b/java/nio/IntBuffer/IntBuffer.h @@ -0,0 +1,13 @@ +#pragma once +#include "../../lang/Object/Object.h" +#include "../../../Ripterms/Maths/Maths.h" + +class IntBuffer : public Object { +public: + using Object::Object; + int get(int index); + Ripterms::Maths::Matrix toMatrix(int lines, int columns); + +protected: + inline static Ripterms::JavaClassV2 IntBufferClass{ "java/nio/IntBuffer" }; +}; \ No newline at end of file diff --git a/main.cpp b/main.cpp index a2f93f6..520962a 100644 --- a/main.cpp +++ b/main.cpp @@ -15,7 +15,8 @@ BOOL WINAPI DllMain( // Initialize once for each new process. // Return FALSE to fail DLL load. - if (Ripterms::init(hinstDLL) == FALSE) { + if (Ripterms::init(hinstDLL) == FALSE) + { std::cin.ignore(); FreeConsole(); return FALSE; @@ -33,7 +34,8 @@ BOOL WINAPI DllMain( break; case DLL_PROCESS_DETACH: - if (lpvReserved != nullptr) { + if (lpvReserved != nullptr) + { //process termination Ripterms::partialClean(); break; diff --git a/net/minecraft/client/Minecraft/Minecraft.cpp b/net/minecraft/client/Minecraft/Minecraft.cpp index 42284bf..9399e83 100644 --- a/net/minecraft/client/Minecraft/Minecraft.cpp +++ b/net/minecraft/client/Minecraft/Minecraft.cpp @@ -13,6 +13,7 @@ EntityPlayerSP Minecraft::getThePlayer() PlayerControllerMP Minecraft::getPlayerController() { + if (!instance) return PlayerControllerMP(nullptr, env); return PlayerControllerMP(env->GetObjectField(instance, MinecraftClass.getFieldID("playerController")), env); } diff --git a/net/minecraft/client/entity/EntityPlayerSP/EntityPlayerSP.cpp b/net/minecraft/client/entity/EntityPlayerSP/EntityPlayerSP.cpp index 0f09aa7..5f06864 100644 --- a/net/minecraft/client/entity/EntityPlayerSP/EntityPlayerSP.cpp +++ b/net/minecraft/client/entity/EntityPlayerSP/EntityPlayerSP.cpp @@ -2,7 +2,9 @@ NetHandlerPlayClient EntityPlayerSP::getSendQueue() { - if (Ripterms::version == Ripterms::Version::FORGE_1_7_10 || Ripterms::version == Ripterms::Version::LUNAR_1_7_10) + if (!instance) + return NetHandlerPlayClient(nullptr, env); + if (Ripterms::version.type = Ripterms::Version::MAJOR_1_7_10) return NetHandlerPlayClient(env->GetObjectField(instance, EntityPlayerMPClass.getFieldID("sendQueue")), env); return NetHandlerPlayClient(env->GetObjectField(instance, EntityPlayerSPClass.getFieldID("sendQueue")), env); } diff --git a/net/minecraft/client/multiplayer/WorldClient/WorldClient.cpp b/net/minecraft/client/multiplayer/WorldClient/WorldClient.cpp index 5dfc7f2..890a1be 100644 --- a/net/minecraft/client/multiplayer/WorldClient/WorldClient.cpp +++ b/net/minecraft/client/multiplayer/WorldClient/WorldClient.cpp @@ -3,7 +3,8 @@ List WorldClient::getPlayerEntities() { - if (!instance) return {}; - if (Ripterms::majorVersion == Ripterms::Version::MAJOR_1_8_9) return World::getPlayerEntities(); - return List(env->GetObjectField(instance, WorldClientClass.getFieldID("players")), env); + if (!instance) return List(nullptr, env); + if (Ripterms::version.type == Ripterms::Version::MAJOR_1_16_5) + return List(env->GetObjectField(instance, WorldClientClass.getFieldID("players")), env); + return World::getPlayerEntities(); } diff --git a/net/minecraft/client/renderer/ActiveRenderInfo/ActiveRenderInfo.cpp b/net/minecraft/client/renderer/ActiveRenderInfo/ActiveRenderInfo.cpp new file mode 100644 index 0000000..4fa1ad4 --- /dev/null +++ b/net/minecraft/client/renderer/ActiveRenderInfo/ActiveRenderInfo.cpp @@ -0,0 +1,16 @@ +#include "ActiveRenderInfo.h" + +FloatBuffer ActiveRenderInfo::getMODELVIEW(JNIEnv* env) +{ + return FloatBuffer(env->GetStaticObjectField(ActiveRenderInfoClass.getJClass(env), ActiveRenderInfoClass.getFieldID("MODELVIEW")), env); +} + +FloatBuffer ActiveRenderInfo::getPROJECTION(JNIEnv* env) +{ + return FloatBuffer(env->GetStaticObjectField(ActiveRenderInfoClass.getJClass(env), ActiveRenderInfoClass.getFieldID("PROJECTION")), env); +} + +IntBuffer ActiveRenderInfo::getVIEWPORT(JNIEnv* env) +{ + return IntBuffer(env->GetStaticObjectField(ActiveRenderInfoClass.getJClass(env), ActiveRenderInfoClass.getFieldID("VIEWPORT")), env); +} diff --git a/net/minecraft/client/renderer/ActiveRenderInfo/ActiveRenderInfo.h b/net/minecraft/client/renderer/ActiveRenderInfo/ActiveRenderInfo.h new file mode 100644 index 0000000..921fa51 --- /dev/null +++ b/net/minecraft/client/renderer/ActiveRenderInfo/ActiveRenderInfo.h @@ -0,0 +1,15 @@ +#pragma once +#include "../../../../../java/lang/Object/Object.h" +#include "../../../../../java/nio/FloatBuffer/FloatBuffer.h" +#include "../../../../../java/nio/IntBuffer/IntBuffer.h" + +class ActiveRenderInfo : public Object +{ +public: + using Object::Object; + static FloatBuffer getMODELVIEW(JNIEnv* env = Ripterms::p_env); + static FloatBuffer getPROJECTION(JNIEnv* env = Ripterms::p_env); + static IntBuffer getVIEWPORT(JNIEnv* env = Ripterms::p_env); +protected: + inline static Ripterms::JavaClassV2 ActiveRenderInfoClass{ "net/minecraft/client/renderer/ActiveRenderInfo" }; +}; \ No newline at end of file diff --git a/net/minecraft/client/settings/GameSettings/GameSettings.cpp b/net/minecraft/client/settings/GameSettings/GameSettings.cpp index f5c7968..da1b787 100644 --- a/net/minecraft/client/settings/GameSettings/GameSettings.cpp +++ b/net/minecraft/client/settings/GameSettings/GameSettings.cpp @@ -2,29 +2,33 @@ float GameSettings::getGammaSetting() { - if(!instance) return 0.0f; - if (Ripterms::majorVersion == Ripterms::Version::MAJOR_1_16_5) { + if(!instance) + return 0.0f; + if (Ripterms::version.type == Ripterms::Version::MAJOR_1_16_5) return (float)env->GetDoubleField(instance, GameSettingsClass.getFieldID("gammaSetting")); - } return env->GetFloatField(instance, GameSettingsClass.getFieldID("gammaSetting")); } KeyBinding GameSettings::getKeyBindSneak() { - if (!instance) return KeyBinding(env); + if (!instance) + return KeyBinding(env); return KeyBinding(env->GetObjectField(instance, GameSettingsClass.getFieldID("keyBindSneak")), env); } KeyBinding GameSettings::getKeyBindSprint() { - if (!instance) return KeyBinding(env); + if (!instance) + return KeyBinding(env); return KeyBinding(env->GetObjectField(instance, GameSettingsClass.getFieldID("keyBindSprint")), env); } void GameSettings::setGammaSetting(float value) { - if (!instance) return; - if (Ripterms::majorVersion == Ripterms::Version::MAJOR_1_16_5) { + if (!instance) + return; + if (Ripterms::version.type == Ripterms::Version::MAJOR_1_16_5) + { env->SetDoubleField(instance, GameSettingsClass.getFieldID("gammaSetting"), (jdouble)value); return; } diff --git a/net/minecraft/entity/Entity/Entity.cpp b/net/minecraft/entity/Entity/Entity.cpp index a2e3194..3203376 100644 --- a/net/minecraft/entity/Entity/Entity.cpp +++ b/net/minecraft/entity/Entity/Entity.cpp @@ -1,11 +1,10 @@ #include "Entity.h" -#include "../../../../Ripterms/Cache/Cache.h" #include "../../util/Vec3/Vec3.h" Ripterms::Maths::Vector3d Entity::getPosition() const { if (!instance) return Ripterms::Maths::Vector3d(); - if (Ripterms::majorVersion == Ripterms::Version::MAJOR_1_16_5) + if (Ripterms::version.type == Ripterms::Version::MAJOR_1_16_5) { return Vec3(env->GetObjectField(instance, EntityClass.getFieldID("positionVec")), env).getVector(); } @@ -45,7 +44,7 @@ Ripterms::Maths::Vector2d Entity::getRotation() const Ripterms::Maths::Vector3d Entity::getMotion() const { if (!instance) return Ripterms::Maths::Vector3d(); - if (Ripterms::majorVersion == Ripterms::Version::MAJOR_1_16_5) + if (Ripterms::version.type == Ripterms::Version::MAJOR_1_16_5) { return Vec3(env->GetObjectField(instance, EntityClass.getFieldID("motion")), env).getVector(); } @@ -102,7 +101,7 @@ void Entity::setSprinting(bool state) void Entity::setMotion(const Ripterms::Maths::Vector3d& motion) { if (!instance) return; - if (Ripterms::majorVersion == Ripterms::Version::MAJOR_1_16_5) + if (Ripterms::version.type == Ripterms::Version::MAJOR_1_16_5) { Vec3 motion_obj(env->GetObjectField(instance, EntityClass.getFieldID("motion")), env); motion_obj.setVector(motion); diff --git a/net/minecraft/entity/Entity/Entity.h b/net/minecraft/entity/Entity/Entity.h index 2476176..a4d6e80 100644 --- a/net/minecraft/entity/Entity/Entity.h +++ b/net/minecraft/entity/Entity/Entity.h @@ -1,6 +1,7 @@ #pragma once #include "../../../../java/lang/Object/Object.h" #include "../../util/AxisAlignedBB/AxisAlignedBB.h" +#include "../../../../Ripterms/Maths/Maths.h" class Entity : public Object { diff --git a/net/minecraft/entity/EntityLivingBase/EntityLivingBase.cpp b/net/minecraft/entity/EntityLivingBase/EntityLivingBase.cpp index 43c3a4c..ae9056e 100644 --- a/net/minecraft/entity/EntityLivingBase/EntityLivingBase.cpp +++ b/net/minecraft/entity/EntityLivingBase/EntityLivingBase.cpp @@ -4,7 +4,7 @@ void EntityLivingBase::setPositionAndUpdate(const Ripterms::Maths::Vector3d& pos { if (!instance) return; - if (Ripterms::version == Ripterms::Version::FORGE_1_7_10 || Ripterms::version == Ripterms::Version::LUNAR_1_7_10) + if (Ripterms::version.type == Ripterms::Version::MAJOR_1_7_10) { env->CallVoidMethod( instance, diff --git a/net/minecraft/network/play/client/C03PacketPlayer/C03PacketPlayer.h b/net/minecraft/network/play/client/C03PacketPlayer/C03PacketPlayer.h index bfe027f..21dd21a 100644 --- a/net/minecraft/network/play/client/C03PacketPlayer/C03PacketPlayer.h +++ b/net/minecraft/network/play/client/C03PacketPlayer/C03PacketPlayer.h @@ -1,5 +1,6 @@ #pragma once #include "../../../Packet/Packet.h" +#include "../../../../../../Ripterms/Maths/Maths.h" class C03PacketPlayer : public Packet { public: diff --git a/net/minecraft/network/play/client/C03PacketPlayer/C04PacketPlayerPosition/C04PacketPlayerPosition.cpp b/net/minecraft/network/play/client/C03PacketPlayer/C04PacketPlayerPosition/C04PacketPlayerPosition.cpp index 877beeb..a34e246 100644 --- a/net/minecraft/network/play/client/C03PacketPlayer/C04PacketPlayerPosition/C04PacketPlayerPosition.cpp +++ b/net/minecraft/network/play/client/C03PacketPlayer/C04PacketPlayerPosition/C04PacketPlayerPosition.cpp @@ -3,7 +3,7 @@ C04PacketPlayerPosition C04PacketPlayerPosition::newObject(const Ripterms::Maths::Vector3d& position, bool isOnGround, JNIEnv* env) { if (!env) - return C04PacketPlayerPosition(); + return C04PacketPlayerPosition(nullptr, env); return C04PacketPlayerPosition ( env->NewObject @@ -22,7 +22,7 @@ C04PacketPlayerPosition C04PacketPlayerPosition::newObject(const Ripterms::Maths C04PacketPlayerPosition C04PacketPlayerPosition::newObject1_7_10(const Ripterms::Maths::Vector3d& position, double stance, bool isOnGround, JNIEnv* env) { if (!env) - return C04PacketPlayerPosition(); + return C04PacketPlayerPosition(nullptr, env); return C04PacketPlayerPosition ( env->NewObject diff --git a/net/minecraft/util/BlockPos/BlockPos.h b/net/minecraft/util/BlockPos/BlockPos.h index fdce1de..376ccb3 100644 --- a/net/minecraft/util/BlockPos/BlockPos.h +++ b/net/minecraft/util/BlockPos/BlockPos.h @@ -1,5 +1,6 @@ #pragma once #include "../../../../java/lang/Object/Object.h" +#include "../../../../Ripterms/Maths/Maths.h" class BlockPos : public Object { diff --git a/net/minecraft/util/MovingObjectPosition/MovingObjectPosition.cpp b/net/minecraft/util/MovingObjectPosition/MovingObjectPosition.cpp index 174b945..952c6bc 100644 --- a/net/minecraft/util/MovingObjectPosition/MovingObjectPosition.cpp +++ b/net/minecraft/util/MovingObjectPosition/MovingObjectPosition.cpp @@ -3,7 +3,7 @@ MovingObjectType MovingObjectPosition::getType() { if (!instance) return MovingObjectType(); - if (Ripterms::majorVersion == Ripterms::MAJOR_1_16_5) + if (Ripterms::version.type == Ripterms::Version::MAJOR_1_16_5) return MovingObjectType(env->CallObjectMethod(instance, MovingObjectPositionClass.getMethodID("getType")), env); return MovingObjectType(env->GetObjectField(instance, MovingObjectPositionClass.getFieldID("typeOfHit")), env); } diff --git a/net/minecraft/util/Vec3/Vec3.h b/net/minecraft/util/Vec3/Vec3.h index 14fd35d..851d94d 100644 --- a/net/minecraft/util/Vec3/Vec3.h +++ b/net/minecraft/util/Vec3/Vec3.h @@ -1,5 +1,6 @@ #pragma once #include "../../../../java/lang/Object/Object.h" +#include "../../../../Ripterms/Maths/Maths.h" class Vec3 : public Object { public: diff --git a/net/minecraft/world/World/World.cpp b/net/minecraft/world/World/World.cpp index 2cfebf3..839864a 100644 --- a/net/minecraft/world/World/World.cpp +++ b/net/minecraft/world/World/World.cpp @@ -19,7 +19,7 @@ IBlockState World::getBlockState(const BlockPos& blockPos) Block World::getBlock(const Ripterms::Maths::Vector3d& position) { if (!instance) return Block(env); - if (Ripterms::version == Ripterms::Version::LUNAR_1_7_10 || Ripterms::version == Ripterms::Version::FORGE_1_7_10) + if (Ripterms::version.type == Ripterms::Version::MAJOR_1_7_10) { return Block ( diff --git a/net/minecraft/world/World/World.h b/net/minecraft/world/World/World.h index d2d713b..71c673a 100644 --- a/net/minecraft/world/World/World.h +++ b/net/minecraft/world/World/World.h @@ -3,6 +3,7 @@ #include "../../../../java/util/List/List.h" #include "../../block/state/IBlockState.h" #include "../../util/BlockPos/BlockPos.h" +#include "../../../../Ripterms/Maths/Maths.h" class World : public Object {