diff --git a/Horion.vcxproj b/Horion.vcxproj index 456d44ebe..f35e50ae5 100644 --- a/Horion.vcxproj +++ b/Horion.vcxproj @@ -287,9 +287,11 @@ + + @@ -476,9 +478,11 @@ + + @@ -653,4 +657,4 @@ - \ No newline at end of file + diff --git a/Horion/Module/ModuleManager.cpp b/Horion/Module/ModuleManager.cpp index 3a60ac1fe..7423ed186 100644 --- a/Horion/Module/ModuleManager.cpp +++ b/Horion/Module/ModuleManager.cpp @@ -104,6 +104,8 @@ void ModuleManager::initModules() { this->moduleList.push_back(std::shared_ptr(new ViewModel())); this->moduleList.push_back(std::shared_ptr(new Twerk())); this->moduleList.push_back(std::shared_ptr(new FollowPathModule())); + this->moduleList.push_back(std::shared_ptr(new AutoWalk())); + this->moduleList.push_back(std::shared_ptr(new AutoJump())); #ifdef _DEBUG this->moduleList.push_back(std::shared_ptr(new PacketLogger())); diff --git a/Horion/Module/ModuleManager.h b/Horion/Module/ModuleManager.h index cb0dd2030..246b3d37c 100644 --- a/Horion/Module/ModuleManager.h +++ b/Horion/Module/ModuleManager.h @@ -96,6 +96,8 @@ #include "Modules/VanillaPlus.h" #include "Modules/ViewModel.h" #include "Modules/Twerk.h" +#include "Modules/AutoWalk.h" +#include "Modules/AutoJump.h" #ifdef _DEBUG #include "Modules/PacketLogger.h" diff --git a/Horion/Module/Modules/AutoJump.cpp b/Horion/Module/Modules/AutoJump.cpp new file mode 100644 index 000000000..8ee046dca --- /dev/null +++ b/Horion/Module/Modules/AutoJump.cpp @@ -0,0 +1,16 @@ +#include "AutoJump.h" + +AutoJump::AutoJump() : IModule(0, Category::MOVEMENT, "Automatically jump") { +} + +AutoJump::~AutoJump() {} + +const char* AutoJump::getModuleName() { + return ("AutoJump"); +} + +void AutoJump::onTick(C_GameMode* gm) { + auto player = g_Data.getLocalPlayer(); + + if (player->onGround) gm->player->jumpFromGround(); +} \ No newline at end of file diff --git a/Horion/Module/Modules/AutoJump.h b/Horion/Module/Modules/AutoJump.h new file mode 100644 index 000000000..8b664d67e --- /dev/null +++ b/Horion/Module/Modules/AutoJump.h @@ -0,0 +1,12 @@ +#pragma once +#include "Module.h" + +class AutoJump : public IModule { +public: + AutoJump(); + ~AutoJump(); + + // Inherited via IModule + virtual const char* getModuleName() override; + virtual void onTick(C_GameMode* gm) override; +}; \ No newline at end of file diff --git a/Horion/Module/Modules/AutoWalk.cpp b/Horion/Module/Modules/AutoWalk.cpp new file mode 100644 index 000000000..3f67c8fed --- /dev/null +++ b/Horion/Module/Modules/AutoWalk.cpp @@ -0,0 +1,35 @@ +#include "AutoWalk.h" + +AutoWalk::AutoWalk() : IModule(0, Category::MOVEMENT, "Automatically walk for you") { + mode = (*new SettingEnum(this)).addEntry(EnumEntry("Forwards", 1)).addEntry(EnumEntry("Left", 2)).addEntry(EnumEntry("Right", 3)).addEntry(EnumEntry("Backwards", 4)); + this->registerEnumSetting("Direction", &mode, 0); + this->registerBoolSetting("Sprint", &this->sprint, this->sprint); + this->registerBoolSetting("Jump", &this->jump, this->jump); +} + +AutoWalk::~AutoWalk() {} + +const char* AutoWalk::getModuleName() { + return ("AutoWalk"); +} + +void AutoWalk::onTick(C_GameMode* gm) { + auto player = g_Data.getLocalPlayer(); + + if (mode.selected == 0) g_Data.getClientInstance()->getMoveTurnInput()->forward = true; + if (mode.selected == 1) g_Data.getClientInstance()->getMoveTurnInput()->left = true; + if (mode.selected == 2) g_Data.getClientInstance()->getMoveTurnInput()->right = true; + if (mode.selected == 3) g_Data.getClientInstance()->getMoveTurnInput()->backward = true; + + if (sprint) gm->player->setSprinting(true); + else gm->player->setSprinting(false); + + if (player->onGround && jump) gm->player->jumpFromGround(); +} + +void AutoWalk::onDisable() { + g_Data.getClientInstance()->getMoveTurnInput()->forward = false; + g_Data.getClientInstance()->getMoveTurnInput()->left = false; + g_Data.getClientInstance()->getMoveTurnInput()->right = false; + g_Data.getClientInstance()->getMoveTurnInput()->backward = false; +} \ No newline at end of file diff --git a/Horion/Module/Modules/AutoWalk.h b/Horion/Module/Modules/AutoWalk.h new file mode 100644 index 000000000..ee70ff217 --- /dev/null +++ b/Horion/Module/Modules/AutoWalk.h @@ -0,0 +1,18 @@ +#pragma once +#include "Module.h" + +class AutoWalk : public IModule { +private: + bool sprint = false; + bool jump = false; + +public: + SettingEnum mode; + AutoWalk(); + ~AutoWalk(); + + // Inherited via IModule + virtual const char* getModuleName() override; + virtual void onTick(C_GameMode* gm) override; + virtual void onDisable() override; +}; \ No newline at end of file diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index da2234f52..115e1cf90 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -19,7 +19,7 @@ void GameData::retrieveClientInstance() { if (sigOffset != 0x0) { int offset = *reinterpret_cast((sigOffset + 3)); // Get Offset from code clientInstanceOffset = sigOffset - g_Data.gameModule->ptrBase + offset + /*length of instruction*/ 7; // Offset is relative - logF("clinet: %llX", clientInstanceOffset); + logF("client: %llX", clientInstanceOffset); } } // clientInstanceOffset = 0x03CD5058; // pointer scanned, can't find good signatures so it'll stay