From 243413e7868cf2edc6a8470c805c0d0fcc299d7c Mon Sep 17 00:00:00 2001 From: CXCubeHD Date: Wed, 8 Sep 2021 11:20:03 +0200 Subject: [PATCH 1/7] added working CMake Files, added MinHook as submodule --- .gitmodules | 3 + CMakeLists.txt | 348 ++----------------------------------- Horion/CMakeLists.txt | 5 + Lib/CMakeLists.txt | 1 + Lib/MinHook/CMakeLists.txt | 3 + Lib/MinHook/GitHub | 1 + Memory/CMakeLists.txt | 5 + SDK/CMakeLists.txt | 5 + 8 files changed, 42 insertions(+), 329 deletions(-) create mode 100644 .gitmodules create mode 100644 Horion/CMakeLists.txt create mode 100644 Lib/CMakeLists.txt create mode 100644 Lib/MinHook/CMakeLists.txt create mode 160000 Lib/MinHook/GitHub create mode 100644 Memory/CMakeLists.txt create mode 100644 SDK/CMakeLists.txt diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..4a3b6d12f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Lib/MinHook/GitHub"] + path = Lib/MinHook/GitHub + url = https://github.com/TsudaKageyu/minhook diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d663ed6b..e07515c92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,14 +1,17 @@ cmake_minimum_required(VERSION 3.12) project(Horion) -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_GENERATOR_PLATFORM x64) +### Other Stuff ### if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") add_compile_options(-Wno-dynamic-class-memaccess -Wno-microsoft-goto -Wno-delete-incomplete /EHsc /Ob1) elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - add_compile_options(/MP /Ob1) + # add_compile_options(/MP /Ob1) endif() +### Add MACROS ### add_compile_definitions(WIN32_LEAN_AND_MEAN) add_compile_definitions(NOMINMAX) if(CMAKE_BUILD_TYPE MATCHES Release) @@ -17,332 +20,19 @@ elseif(CMAKE_BUILD_TYPE MATCHES BetaConf) add_compile_definitions(_BETA) endif() -include_directories(.) -include_directories(include) -include_directories(include/glm/) +### Add Library ### +add_library(Horion SHARED "Horion/Loader.cpp") -link_directories(minhook) +### Include Subdirectories ### +target_include_directories(Horion PUBLIC ".") +target_include_directories(Horion PUBLIC "include") +target_include_directories(Horion PUBLIC "include/glm/") -add_library(Horion SHARED - Horion/Command/Commands/BindCommand.cpp - Horion/Command/Commands/BindCommand.h - Horion/Command/Commands/BruhCommand.cpp - Horion/Command/Commands/BruhCommand.h - Horion/Command/Commands/CommandBlockExploitCommand.cpp - Horion/Command/Commands/CommandBlockExploitCommand.h - Horion/Command/Commands/ConfigCommand.cpp - Horion/Command/Commands/ConfigCommand.h - Horion/Command/Commands/CoordsCommand.cpp - Horion/Command/Commands/CoordsCommand.h - Horion/Command/Commands/DamageCommand.cpp - Horion/Command/Commands/DamageCommand.h - Horion/Command/Commands/DupeCommand.cpp - Horion/Command/Commands/DupeCommand.h - Horion/Command/Commands/EjectCommand.cpp - Horion/Command/Commands/EjectCommand.h - Horion/Command/Commands/EnchantCommand.cpp - Horion/Command/Commands/EnchantCommand.h - Horion/Command/Commands/ExecuteCommand.cpp - Horion/Command/Commands/ExecuteCommand.h - Horion/Command/Commands/FriendListCommand.cpp - Horion/Command/Commands/FriendListCommand.h - Horion/Command/Commands/GameModeCommand.cpp - Horion/Command/Commands/GameModeCommand.h - Horion/Command/Commands/GiveCommand.cpp - Horion/Command/Commands/GiveCommand.h - Horion/Command/Commands/HelpCommand.cpp - Horion/Command/Commands/HelpCommand.h - Horion/Command/Commands/HideCommand.cpp - Horion/Command/Commands/HideCommand.h - Horion/Command/Commands/ICommand.cpp - Horion/Command/Commands/ICommand.h - Horion/Command/Commands/ModulesCommand.cpp - Horion/Command/Commands/ModulesCommand.h - Horion/Command/Commands/NameSpoofCommand.cpp - Horion/Command/Commands/NameSpoofCommand.h - Horion/Command/Commands/NbtCommand.cpp - Horion/Command/Commands/NbtCommand.h - Horion/Command/Commands/PanicCommand.cpp - Horion/Command/Commands/PanicCommand.h - Horion/Command/Commands/PlayerTeleportCommand.cpp - Horion/Command/Commands/PlayerTeleportCommand.h - Horion/Command/Commands/RelativeTeleportCommand.cpp - Horion/Command/Commands/RelativeTeleportCommand.h - Horion/Command/Commands/SayCommand.cpp - Horion/Command/Commands/SayCommand.h - Horion/Command/Commands/ScriptCommand.cpp - Horion/Command/Commands/ScriptCommand.h - Horion/Command/Commands/ServerCommand.cpp - Horion/Command/Commands/ServerCommand.h - Horion/Command/Commands/setoffhandCommand.cpp - Horion/Command/Commands/setoffhandCommand.h - Horion/Command/Commands/SetprefixCommand.cpp - Horion/Command/Commands/SetprefixCommand.h - Horion/Command/Commands/SpammerCommand.cpp - Horion/Command/Commands/SpammerCommand.h - Horion/Command/Commands/TeleportCommand.cpp - Horion/Command/Commands/TeleportCommand.h - Horion/Command/Commands/TestCommand.cpp - Horion/Command/Commands/TestCommand.h - Horion/Command/Commands/ToggleCommand.cpp - Horion/Command/Commands/ToggleCommand.h - Horion/Command/Commands/UnbindCommand.cpp - Horion/Command/Commands/UnbindCommand.h - Horion/Command/CommandMgr.cpp - Horion/Command/CommandMgr.h - Horion/Config/AccountInformation.cpp - Horion/Config/AccountInformation.h - Horion/Config/ConfigManager.cpp - Horion/Config/ConfigManager.h - Horion/FriendList/FriendList.cpp - Horion/FriendList/FriendList.h - Horion/Menu/ClickGui.cpp - Horion/Menu/ClickGui.h - Horion/Menu/TabGui.cpp - Horion/Menu/TabGui.h - Horion/Module/Modules/Aimbot.cpp - Horion/Module/Modules/Aimbot.h - Horion/Module/Modules/AirJump.cpp - Horion/Module/Modules/AirJump.h - Horion/Module/Modules/AirStuck.cpp - Horion/Module/Modules/AirStuck.h - Horion/Module/Modules/AirSwim.cpp - Horion/Module/Modules/AirSwim.h - Horion/Module/Modules/AntiBot.cpp - Horion/Module/Modules/AntiBot.h - Horion/Module/Modules/AntiVoid.cpp - Horion/Module/Modules/AntiVoid.h - Horion/Module/Modules/AutoArmor.cpp - Horion/Module/Modules/AutoArmor.h - Horion/Module/Modules/AutoClicker.cpp - Horion/Module/Modules/AutoClicker.h - Horion/Module/Modules/AutoGapple.cpp - Horion/Module/Modules/AutoGapple.h - Horion/Module/Modules/AutoSneak.cpp - Horion/Module/Modules/AutoSneak.h - Horion/Module/Modules/AutoSprint.cpp - Horion/Module/Modules/AutoSprint.h - Horion/Module/Modules/AutoTotem.cpp - Horion/Module/Modules/AutoTotem.h - Horion/Module/Modules/Bhop.cpp - Horion/Module/Modules/Bhop.h - Horion/Module/Modules/Blink.cpp - Horion/Module/Modules/Blink.h - Horion/Module/Modules/BowAimbot.cpp - Horion/Module/Modules/BowAimbot.h - Horion/Module/Modules/ChestAura.cpp - Horion/Module/Modules/ChestAura.h - Horion/Module/Modules/ChestESP.cpp - Horion/Module/Modules/ChestESP.h - Horion/Module/Modules/ChestStealer.cpp - Horion/Module/Modules/ChestStealer.h - Horion/Module/Modules/ClickGuiMod.cpp - Horion/Module/Modules/ClickGuiMod.h - Horion/Module/Modules/Crasher.cpp - Horion/Module/Modules/Crasher.h - Horion/Module/Modules/Criticals.cpp - Horion/Module/Modules/Criticals.h - Horion/Module/Modules/CrystalAura.cpp - Horion/Module/Modules/CrystalAura.h - Horion/Module/Modules/CubeGlide.cpp - Horion/Module/Modules/CubeGlide.h - Horion/Module/Modules/Derp.cpp - Horion/Module/Modules/Derp.h - Horion/Module/Modules/EditionFaker.cpp - Horion/Module/Modules/EditionFaker.h - Horion/Module/Modules/ESP.cpp - Horion/Module/Modules/ESP.h - Horion/Module/Modules/FastEast.cpp - Horion/Module/Modules/FastEat.h - Horion/Module/Modules/FastLadder.cpp - Horion/Module/Modules/FastLadder.h - Horion/Module/Modules/Fly.cpp - Horion/Module/Modules/Fly.h - Horion/Module/Modules/Freecam.cpp - Horion/Module/Modules/Freecam.h - Horion/Module/Modules/Fucker.cpp - Horion/Module/Modules/Fucker.h - Horion/Module/Modules/FullBright.cpp - Horion/Module/Modules/FullBright.h - Horion/Module/Modules/Glide.cpp - Horion/Module/Modules/Glide.h - Horion/Module/Modules/Godmode.cpp - Horion/Module/Modules/Godmode.h - Horion/Module/Modules/HighJump.cpp - Horion/Module/Modules/HighJump.h - Horion/Module/Modules/Hitbox.cpp - Horion/Module/Modules/Hitbox.h - Horion/Module/Modules/HudModule.cpp - Horion/Module/Modules/HudModule.h - Horion/Module/Modules/ExtendedBlockReach.cpp - Horion/Module/Modules/ExtendedBlockReach.h - Horion/Module/Modules/InfiniteReach.cpp - Horion/Module/Modules/InfiniteReach.h - Horion/Module/Modules/InstaBreak.cpp - Horion/Module/Modules/InstaBreak.h - Horion/Module/Modules/InventoryCleaner.cpp - Horion/Module/Modules/InventoryCleaner.h - Horion/Module/Modules/InventoryMove.cpp - Horion/Module/Modules/InventoryMove.h - Horion/Module/Modules/JavascriptModule.cpp - Horion/Module/Modules/JavascriptModule.h - Horion/Module/Modules/Jesus.cpp - Horion/Module/Modules/Jesus.h - Horion/Module/Modules/Jetpack.cpp - Horion/Module/Modules/Jetpack.h - Horion/Module/Modules/Killaura.cpp - Horion/Module/Modules/Killaura.h - Horion/Module/Modules/MidClick.cpp - Horion/Module/Modules/MidClick.h - Horion/Module/Modules/Module.cpp - Horion/Module/Modules/Module.h - Horion/Module/Modules/NameTags.cpp - Horion/Module/Modules/NameTags.h - Horion/Module/Modules/Nbt.cpp - Horion/Module/Modules/Nbt.h - Horion/Module/Modules/NightMode.cpp - Horion/Module/Modules/NightMode.h - Horion/Module/Modules/NoFall.cpp - Horion/Module/Modules/NoFall.h - Horion/Module/Modules/NoFriends.cpp - Horion/Module/Modules/NoFriends.h - Horion/Module/Modules/NoPacket.cpp - Horion/Module/Modules/NoPacket.h - Horion/Module/Modules/NoPaintingCrash.cpp - Horion/Module/Modules/NoPaintingCrash.h - Horion/Module/Modules/NoSlowDown.cpp - Horion/Module/Modules/NoSlowDown.h - Horion/Module/Modules/NoSwing.cpp - Horion/Module/Modules/NoSwing.h - Horion/Module/Modules/NoWeb.cpp - Horion/Module/Modules/NoWeb.h - Horion/Module/Modules/Nuker.cpp - Horion/Module/Modules/Nuker.h - Horion/Module/Modules/PacketLogger.cpp - Horion/Module/Modules/PacketLogger.h - Horion/Module/Modules/Phase.cpp - Horion/Module/Modules/Phase.h - Horion/Module/Modules/RainbowSky.cpp - Horion/Module/Modules/RainbowSky.h - Horion/Module/Modules/Reach.cpp - Horion/Module/Modules/Reach.h - Horion/Module/Modules/Scaffold.cpp - Horion/Module/Modules/Scaffold.h - Horion/Module/Modules/Spammer.cpp - Horion/Module/Modules/Spammer.h - Horion/Module/Modules/Speed.cpp - Horion/Module/Modules/Speed.h - Horion/Module/Modules/StackableItem.cpp - Horion/Module/Modules/StackableItem.h - Horion/Module/Modules/Step.cpp - Horion/Module/Modules/Step.h - Horion/Module/Modules/Teams.cpp - Horion/Module/Modules/Teams.h - Horion/Module/Modules/Teleport.cpp - Horion/Module/Modules/Teleport.h - Horion/Module/Modules/TestModule.cpp - Horion/Module/Modules/TestModule.h - Horion/Module/Modules/Timer.cpp - Horion/Module/Modules/Timer.h - Horion/Module/Modules/Tower.cpp - Horion/Module/Modules/Tower.h - Horion/Module/Modules/Tracer.cpp - Horion/Module/Modules/Tracer.h - Horion/Module/Modules/TriggerBot.cpp - Horion/Module/Modules/TriggerBot.h - Horion/Module/Modules/Velocity.cpp - Horion/Module/Modules/Velocity.h - Horion/Module/Modules/Xray.cpp - Horion/Module/Modules/Xray.h - Horion/Module/Modules/Zoom.cpp - Horion/Module/Modules/Zoom.h - Horion/Module/ModuleManager.cpp - Horion/Module/ModuleManager.h - Horion/Scripting/Functions/CommandManagerFunctions.cpp - Horion/Scripting/Functions/CommandManagerFunctions.h - Horion/Scripting/Functions/EntityFunctions.cpp - Horion/Scripting/Functions/EntityFunctions.h - Horion/Scripting/Functions/GameFunctions.cpp - Horion/Scripting/Functions/GameFunctions.h - Horion/Scripting/Functions/GlobalFunctions.cpp - Horion/Scripting/Functions/GlobalFunctions.h - Horion/Scripting/Functions/HorionFunctions.cpp - Horion/Scripting/Functions/HorionFunctions.h - Horion/Scripting/Functions/LocalPlayerFunctions.cpp - Horion/Scripting/Functions/LocalPlayerFunctions.h - Horion/Scripting/Functions/ModuleManagerFunctions.cpp - Horion/Scripting/Functions/ModuleManagerFunctions.h - Horion/Scripting/Functions/Vector3Functions.cpp - Horion/Scripting/Functions/Vector3Functions.h - Horion/Scripting/JsScriptModule.cpp - Horion/Scripting/JsScriptModule.h - Horion/Scripting/ScriptInstance.cpp - Horion/Scripting/ScriptInstance.h - Horion/Scripting/ScriptManager.cpp - Horion/Scripting/ScriptManager.h - Horion/DrawUtils.cpp - Horion/DrawUtils.h - Horion/GuiUtils.cpp - Horion/GuiUtils.h - Horion/ImmediateGui.cpp - Horion/ImmediateGui.h - Horion/Loader.cpp - Horion/Loader.h - include/chakra/ChakraCommon.h - include/chakra/ChakraCommonWindows.h - include/chakra/ChakraCore.h - include/chakra/ChakraCoreWindows.h - include/chakra/ChakraDebug.h - include/atlrx.h - include/d3dx11.h - include/d3dx11async.h - include/d3dx11core.h - include/d3dx11effect.h - include/RegExp.h - include/StringProcess.h - include/WinHttpClient.h - Memory/GameData.cpp - Memory/GameData.h - Memory/Hooks.cpp - Memory/Hooks.h - Memory/MinHook.h - Memory/SlimMem.cpp - Memory/SlimMem.h - SDK/CBlockLegacy.h - SDK/CChestBlockActor.h - SDK/CClientInstance.h - SDK/CClientInstanceScreenModel.h - SDK/CComplexInventoryTransaction.h - SDK/CEntity.h - SDK/CEntityList.h - SDK/CGameMode.h - SDK/CGameSettingsInput.h - SDK/CHIDController.h - SDK/CInventory.h - SDK/CInventoryTransaction.h - SDK/CItem.h - SDK/CLoopbackPacketSender.h - SDK/CMinecraftUIRenderContext.h - SDK/CMoveInputHandler.h - SDK/CPacket.h - SDK/CRakNetInstance.h - SDK/CUIScene.h - SDK/MojangsonToken.h - SDK/Tag.h - SDK/TextHolder.h - Utils/ChakraHelper.h - Utils/DllHelper.h - Utils/HMath.h - Utils/Json.hpp - Utils/Logger.cpp - Utils/Logger.h - Utils/SkinUtil.cpp - Utils/SkinUtil.h - Utils/Target.cpp - Utils/Target.h - Utils/TextFormat.cpp - Utils/TextFormat.h - Utils/Utils.cpp - Utils/Utils.h - Utils/xorstr.h - resource.h SDK/TextHolder.cpp SDK/CChestBlockActor.cpp SDK/Tag.cpp Utils/keys.h SDK/CBlockLegacy.cpp SDK/CItem.cpp SDK/CInventory.cpp SDK/CInventoryTransaction.cpp SDK/CEntity.cpp SDK/CComplexInventoryTransaction.cpp SDK/CPacket.cpp SDK/CMinecraftUIRenderContext.cpp SDK/CClientInstance.cpp SDK/CMoveInputHandler.cpp SDK/CImageBuffer.h Horion/Module/Modules/Freelook.cpp Horion/Module/Modules/Freelook.h SDK/CCamera.h SDK/CCamera.cpp Horion/Module/Modules/NoHurtcam.cpp Horion/Module/Modules/NoHurtcam.h Horion/Module/Modules/AntiImmobile.cpp Horion/Module/Modules/AntiImmobile.h Horion/path/JoePathFinder.cpp Horion/path/JoePathFinder.h Horion/path/JoePath.cpp Horion/path/JoePath.h Horion/path/JoeSegment.cpp Horion/path/JoeSegment.h Horion/path/JoeMovementController.cpp Horion/path/JoeMovementController.h Horion/path/goals/JoeGoal.cpp Horion/path/goals/JoeGoal.h Horion/path/goals/JoeGoalXYZ.cpp Horion/path/goals/JoeGoalXYZ.h Horion/path/goals/JoeGoalXZ.cpp Horion/path/goals/JoeGoalXZ.h Horion/path/JoeConstants.h Horion/path/goals/JoeGoalY.cpp Horion/path/goals/JoeGoalY.h Horion/Module/Modules/FollowPathModule.cpp Horion/Module/Modules/FollowPathModule.h Horion/Command/Commands/PathCommand.cpp Horion/Command/Commands/PathCommand.h Horion/path/JoeConstants.cpp Horion/Scripting/Functions/LevelFunctions.cpp Horion/Scripting/Functions/LevelFunctions.h Horion/Scripting/Functions/DrawFunctions.cpp Horion/Scripting/Functions/DrawFunctions.h "Horion/Module/Modules/Twerk.cpp" "Horion/Module/Modules/Twerk.h") +### Link Libraries ### +target_link_libraries(Horion PUBLIC minhook) + +### Add Subdirectories ### +add_subdirectory(Lib) +add_subdirectory(Memory) +add_subdirectory(Horion) +add_subdirectory(SDK) \ No newline at end of file diff --git a/Horion/CMakeLists.txt b/Horion/CMakeLists.txt new file mode 100644 index 000000000..928a7e844 --- /dev/null +++ b/Horion/CMakeLists.txt @@ -0,0 +1,5 @@ +file(GLOB_RECURSE TargetFiles + "*.h" + "*.cpp") + +target_sources(Horion PUBLIC ${TargetFiles}) \ No newline at end of file diff --git a/Lib/CMakeLists.txt b/Lib/CMakeLists.txt new file mode 100644 index 000000000..5c92ae7d9 --- /dev/null +++ b/Lib/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(MinHook) \ No newline at end of file diff --git a/Lib/MinHook/CMakeLists.txt b/Lib/MinHook/CMakeLists.txt new file mode 100644 index 000000000..332d9646b --- /dev/null +++ b/Lib/MinHook/CMakeLists.txt @@ -0,0 +1,3 @@ +add_subdirectory(GitHub) + +target_include_directories(Horion PUBLIC "GitHub/include/") \ No newline at end of file diff --git a/Lib/MinHook/GitHub b/Lib/MinHook/GitHub new file mode 160000 index 000000000..4a455528f --- /dev/null +++ b/Lib/MinHook/GitHub @@ -0,0 +1 @@ +Subproject commit 4a455528f61b5a375b1f9d44e7d296d47f18bb18 diff --git a/Memory/CMakeLists.txt b/Memory/CMakeLists.txt new file mode 100644 index 000000000..928a7e844 --- /dev/null +++ b/Memory/CMakeLists.txt @@ -0,0 +1,5 @@ +file(GLOB_RECURSE TargetFiles + "*.h" + "*.cpp") + +target_sources(Horion PUBLIC ${TargetFiles}) \ No newline at end of file diff --git a/SDK/CMakeLists.txt b/SDK/CMakeLists.txt new file mode 100644 index 000000000..928a7e844 --- /dev/null +++ b/SDK/CMakeLists.txt @@ -0,0 +1,5 @@ +file(GLOB_RECURSE TargetFiles + "*.h" + "*.cpp") + +target_sources(Horion PUBLIC ${TargetFiles}) \ No newline at end of file From 6c4b2b5d5b31bb49aea06e8ca04533c00625b9d2 Mon Sep 17 00:00:00 2001 From: CXCubeHD Date: Wed, 8 Sep 2021 11:21:10 +0200 Subject: [PATCH 2/7] fixed Hooks.cpp --- Memory/Hooks.cpp | 65 ++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 47252e353..f6e812d30 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -1606,44 +1606,45 @@ void prepCoolBean() { } if (count > 5) // we already added a server goto end; + { + // make new one + BeansEntry* epic = new BeansEntry(); + epic->nextEntry = listEnd; + epic->prevEntry = current; + epic->masterPlayer.setText(""); + epic->unk = current->unk; + memcpy(epic->filler, current->filler, sizeof(BeansEntry::filler)); + epic->masterPlayer2.setText(""); + epic->serverName.setText("Epic"); + memcpy(epic->filler2, current->filler2, sizeof(BeansEntry::filler2)); - // make new one - BeansEntry* epic = new BeansEntry(); - epic->nextEntry = listEnd; - epic->prevEntry = current; - epic->masterPlayer.setText(""); - epic->unk = current->unk; - memcpy(epic->filler, current->filler, sizeof(BeansEntry::filler)); - epic->masterPlayer2.setText(""); - epic->serverName.setText("Epic"); - memcpy(epic->filler2, current->filler2, sizeof(BeansEntry::filler2)); - - auto cT = current->start[0].get(); + auto cT = current->start[0].get(); - std::shared_ptr* start = new std::shared_ptr[1]; + std::shared_ptr* start = new std::shared_ptr[1]; - { - ThirdPartyServer* t = new ThirdPartyServer(); - - t->coolBoye = cT->coolBoye; - t->uuid.setText(""); - t->masterPlayerAccount = cT->masterPlayerAccount; - t->lobbyDescription = cT->lobbyDescription; - t->pathToServerIcon.setText(""); - t->serverName.setText("Horion Server"); - t->serverName2.setText("Horion Server"); // This is the one actually displayed - t->domain.setText(".horionbeta.club"); - t->serverAddress.setText("mc.horionbeta.club"); - start[0] = std::shared_ptr(t); - } + { + ThirdPartyServer* t = new ThirdPartyServer(); + + t->coolBoye = cT->coolBoye; + t->uuid.setText(""); + t->masterPlayerAccount = cT->masterPlayerAccount; + t->lobbyDescription = cT->lobbyDescription; + t->pathToServerIcon.setText(""); + t->serverName.setText("Horion Server"); + t->serverName2.setText("Horion Server"); // This is the one actually displayed + t->domain.setText(".horionbeta.club"); + t->serverAddress.setText("mc.horionbeta.club"); + start[0] = std::shared_ptr(t); + } - epic->start = start; - epic->end = &start[1]; + epic->start = start; + epic->end = &start[1]; - current->nextEntry = epic; + current->nextEntry = epic; - // increase count - *reinterpret_cast<__int64*>(g_Data.getClientInstance()->minecraftGame->getServerEntries() + 0x50) += 1; + // increase count + *reinterpret_cast<__int64*>(g_Data.getClientInstance()->minecraftGame->getServerEntries() + 0x50) += 1; + } end:; } } From 045e47a565109230933ecb934c682cde5f6f6c3a Mon Sep 17 00:00:00 2001 From: CXCubeHD Date: Wed, 8 Sep 2021 12:14:39 +0200 Subject: [PATCH 3/7] fixed errors + CMake --- CMakeLists.txt | 24 ++++++++++++++---------- Horion/Loader.cpp | 11 ++++++----- Horion/Module/Modules/CrystalAura.cpp | 6 ++++-- Horion/Module/Modules/TestModule.cpp | 2 +- Horion/path/JoePathFinder.cpp | 2 +- SDK/CItem.cpp | 4 ++++ SDK/CItem.h | 1 + 7 files changed, 31 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e07515c92..b8fdf9ccd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,23 +5,27 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_GENERATOR_PLATFORM x64) ### Other Stuff ### -if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - add_compile_options(-Wno-dynamic-class-memaccess -Wno-microsoft-goto -Wno-delete-incomplete /EHsc /Ob1) -elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - # add_compile_options(/MP /Ob1) -endif() +# if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +# add_compile_options(-Wno-dynamic-class-memaccess -Wno-microsoft-goto -Wno-delete-incomplete /EHsc /Ob1) +# elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") +# # add_compile_options(/MP /Ob1) +# endif() ### Add MACROS ### add_compile_definitions(WIN32_LEAN_AND_MEAN) add_compile_definitions(NOMINMAX) if(CMAKE_BUILD_TYPE MATCHES Release) - elseif(CMAKE_BUILD_TYPE MATCHES BetaConf) add_compile_definitions(_BETA) endif() +file(GLOB_RECURSE HorionFiles + "*.h" + "*.cpp") +add_library(Horion SHARED ${HorionFiles}) + ### Add Library ### -add_library(Horion SHARED "Horion/Loader.cpp") +# add_library(Horion SHARED "Horion/Loader.cpp") ### Include Subdirectories ### target_include_directories(Horion PUBLIC ".") @@ -33,6 +37,6 @@ target_link_libraries(Horion PUBLIC minhook) ### Add Subdirectories ### add_subdirectory(Lib) -add_subdirectory(Memory) -add_subdirectory(Horion) -add_subdirectory(SDK) \ No newline at end of file +# add_subdirectory(Memory) +# add_subdirectory(Horion) +# add_subdirectory(SDK) \ No newline at end of file diff --git a/Horion/Loader.cpp b/Horion/Loader.cpp index f91364625..950739e73 100644 --- a/Horion/Loader.cpp +++ b/Horion/Loader.cpp @@ -4,11 +4,12 @@ SlimUtils::SlimMem mem; const SlimUtils::SlimModule* gameModule; bool isRunning = true; -#if defined _M_X64 -#pragma comment(lib, "MinHook.x64.lib") -#elif defined _M_IX86 -#pragma comment(lib, "MinHook.x86.lib") -#endif +// Shouldn't be used (breaks stuff) +// #if defined _M_X64 +// #pragma comment(lib, "MinHook.x64.lib") +// #elif defined _M_IX86 +// #pragma comment(lib, "MinHook.x86.lib") +// #endif DWORD WINAPI keyThread(LPVOID lpParam) { logF("Key thread started"); diff --git a/Horion/Module/Modules/CrystalAura.cpp b/Horion/Module/Modules/CrystalAura.cpp index 067a84077..688f6636a 100644 --- a/Horion/Module/Modules/CrystalAura.cpp +++ b/Horion/Module/Modules/CrystalAura.cpp @@ -151,8 +151,10 @@ void CrystalAura::onTick(C_GameMode* gm) { CPlace(gm, i->getPos()); else { auto ptr = g_Data.getClientInstance()->getPointerStruct(); - if (ptr->getEntity() == nullptr && ptr->rayHitType == 0) - CPlace(gm, &ptr->block.toFloatVector()); + if (ptr->getEntity() == nullptr && ptr->rayHitType == 0) { + auto v = ptr->block.toFloatVector(); + CPlace(gm, &v); + } } } return; diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index cc56104a5..6dd89a5cf 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -51,7 +51,7 @@ __forceinline unsigned __int64 rotBy(int in, unsigned int by) { return ((mut & 0x7FFFFFui64) | ((static_cast(in) >> 8u) & 0x800000u) /*copy sign bit*/) << by; } -size_t posToHash(const vec3_ti& pos) { +static size_t posToHash(const vec3_ti& pos) { return rotBy(pos.x, 0) | rotBy(pos.z, 24) | (static_cast(pos.y) << 48u); } diff --git a/Horion/path/JoePathFinder.cpp b/Horion/path/JoePathFinder.cpp index 10d7c0347..226bae7d9 100644 --- a/Horion/path/JoePathFinder.cpp +++ b/Horion/path/JoePathFinder.cpp @@ -48,7 +48,7 @@ __forceinline unsigned __int64 rotBy(int in, unsigned int by){ return ((mut & 0x7FFFFFui64) | ((static_cast(in) >> 8u) & 0x800000u)/*copy sign bit*/) << by; } -__forceinline unsigned __int64 posToHash(const vec3_ti& pos){ +static __forceinline unsigned __int64 posToHash(const vec3_ti& pos){ return rotBy(pos.x, 0) | rotBy(pos.z, 24) | (static_cast(pos.y) << 48u); } diff --git a/SDK/CItem.cpp b/SDK/CItem.cpp index 747195d0e..50bdbb4b6 100644 --- a/SDK/CItem.cpp +++ b/SDK/CItem.cpp @@ -85,6 +85,10 @@ C_Item ***ItemRegistry::lookUpByName(void *a1, void *a2, TextHolder &text) { return ItemRegistry__lookupByNameF(a1, a2, text); } +C_Item ***ItemRegistry::lookUpByName(void *a1, void *a2, TextHolder&& text) { + return lookUpByName(a1, a2, static_cast(text)); +} + ItemDescriptor::ItemDescriptor(int id, int16_t itemData) { using ItemDescriptor__ItemDescriptor_t = ItemDescriptor*(__fastcall *)(ItemDescriptor*,int,int16_t); static ItemDescriptor__ItemDescriptor_t func = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 48 83 EC ? 33 ED 48 8B D9 48 89 29 41 8B F8 48 89 69 ? 8B F2 48 89 69 ? 66 89 69 ? C6 41")); diff --git a/SDK/CItem.h b/SDK/CItem.h index 289024853..4e7312e18 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -382,4 +382,5 @@ class ItemRegistry { public: static C_Item*** getItemFromId(void* ptr, int itemId); static C_Item*** lookUpByName(void*, void*, TextHolder&); + static C_Item*** lookUpByName(void*, void*, TextHolder&&); }; From 0baa7bebbb315427f07ef65457cdc13a4e8da4c8 Mon Sep 17 00:00:00 2001 From: CXCubeHD Date: Wed, 8 Sep 2021 12:57:22 +0200 Subject: [PATCH 4/7] updated Horion for VS --- Horion.vcxproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Horion.vcxproj b/Horion.vcxproj index 456d44ebe..531892837 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -180,6 +180,7 @@ Default + $(SolutionDir)minhook;%(AdditionalLibraryDirectories) @@ -194,6 +195,7 @@ false + $(SolutionDir)minhook;%(AdditionalLibraryDirectories) @@ -208,6 +210,7 @@ false + $(SolutionDir)minhook;%(AdditionalLibraryDirectories) From a7a54ed92290f87b552ae169dfbe06282f50b63d Mon Sep 17 00:00:00 2001 From: CXCubeHD Date: Wed, 8 Sep 2021 13:53:45 +0200 Subject: [PATCH 5/7] Tests shouldn't fail now --- Horion.vcxproj | 6 +++--- Horion/Loader.cpp | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Horion.vcxproj b/Horion.vcxproj index 531892837..6354187a8 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -171,7 +171,7 @@ true false MultiThreadedDebugDLL - /Zc:__cplusplus %(AdditionalOptions) + /Zc:__cplusplus /DUSING_VS %(AdditionalOptions) NOMINMAX;%(PreprocessorDefinitions) OnlyExplicitInline @@ -188,7 +188,7 @@ stdcpp17 true None - /Zc:__cplusplus %(AdditionalOptions) + /Zc:__cplusplus /DUSING_VS %(AdditionalOptions) AnySuitable false _WINDLL;NOMINMAX;%(PreprocessorDefinitions) @@ -203,7 +203,7 @@ stdcpp17 true None - /Zc:__cplusplus %(AdditionalOptions) + /Zc:__cplusplus /DUSING_VS %(AdditionalOptions) _BETA;NOMINMAX;%(PreprocessorDefinitions) AnySuitable false diff --git a/Horion/Loader.cpp b/Horion/Loader.cpp index 950739e73..22b2fc956 100644 --- a/Horion/Loader.cpp +++ b/Horion/Loader.cpp @@ -4,6 +4,10 @@ SlimUtils::SlimMem mem; const SlimUtils::SlimModule* gameModule; bool isRunning = true; +#ifdef USING_VS +#pragma comment(lib, "MinHook.x64.lib") +#endif + // Shouldn't be used (breaks stuff) // #if defined _M_X64 // #pragma comment(lib, "MinHook.x64.lib") From 163a17a38ea57fb3cfcf9d9ad44cd607438ff47f Mon Sep 17 00:00:00 2001 From: CXCubeHD Date: Wed, 8 Sep 2021 15:31:10 +0200 Subject: [PATCH 6/7] added the ability to add modules --- Horion/Module/ModuleManager.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index cb0dd2030..f1dc8be6b 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -174,6 +174,17 @@ class ModuleManager { } return std::optional>(); } + + void addModule(std::shared_ptr mod) { + if (!mod) throw std::exception("mod was null."); + if (mod->getModuleName() != "") { + if (!getModuleByName(mod->getModuleName()).has_value()) { + throw std::exception("The specified module name does already exist."); + } + } + auto lock = this->lockModuleList(); + moduleList.push_back(mod); + } }; extern ModuleManager* moduleMgr; From 3c8235a97482833b6a8992f90d5869506385f820 Mon Sep 17 00:00:00 2001 From: CXCubeHD Date: Wed, 8 Sep 2021 16:33:25 +0200 Subject: [PATCH 7/7] updated ModuleManager::addModule and added ModuleManager::removeModule --- Horion/Module/ModuleManager.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index f1dc8be6b..05216e40c 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -177,14 +177,28 @@ class ModuleManager { void addModule(std::shared_ptr mod) { if (!mod) throw std::exception("mod was null."); - if (mod->getModuleName() != "") { - if (!getModuleByName(mod->getModuleName()).has_value()) { - throw std::exception("The specified module name does already exist."); + auto lock = this->lockModuleList(); + for (auto& m : moduleList) { + if (m.get() == mod.get()) { + throw "Duplicate found."; } } - auto lock = this->lockModuleList(); moduleList.push_back(mod); } + + void removeModule(std::shared_ptr mod) { + if (mod.get() == nullptr) return; + auto lock = this->lockModuleList(); + auto it = moduleList.begin(); + for (; it != moduleList.end(); ++it) { + if (it->get() == mod.get()) { + goto remove_element; + } + } + return; + remove_element: + moduleList.erase(it); + } }; extern ModuleManager* moduleMgr;