Skip to content
This repository has been archived by the owner on Dec 26, 2021. It is now read-only.

Commit

Permalink
Remove version crap
Browse files Browse the repository at this point in the history
  • Loading branch information
godgamer029 committed Aug 15, 2021
1 parent 8b31568 commit ec768c2
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 54 deletions.
1 change: 0 additions & 1 deletion Horion/Loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ DWORD WINAPI start(LPVOID lpParam) {
gameModule = mem.GetModule(L"Minecraft.Windows.exe"); // Get Module for Base Address

MH_Initialize();
g_Data.checkGameVersion();
GameData::initGameData(gameModule, &mem, (HMODULE)lpParam);
Target::init(g_Data.getPtrLocalPlayer());

Expand Down
17 changes: 3 additions & 14 deletions Horion/Module/Modules/NoSlowDown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ const char* NoSlowDown::getModuleName() {
void NoSlowDown::onEnable() {
if (opcode == 0 || opcode1 == 0) {
opcode = reinterpret_cast<uint8_t*>(FindSignature("F3 0F 11 46 ? 45 89 ? ? F3 0F 10 46 ?"));

if (g_Data.getVersion() == GAMEVERSION::g_1_16_0)
opcode1 = reinterpret_cast<uint8_t*>(FindSignature("F3 0F 11 47 ? F3 0F 10 05"));
else
opcode1 = reinterpret_cast<uint8_t*>(FindSignature("F3 0F 11 46 ? F3 0F 10 4E ?"));
opcode1 = reinterpret_cast<uint8_t*>(FindSignature("F3 0F 11 46 ? F3 0F 10 4E ?"));
}

DWORD oldProtect = 0;
Expand Down Expand Up @@ -58,11 +54,7 @@ void NoSlowDown::onEnable() {
void NoSlowDown::onDisable() {
if (opcode == 0 || opcode1 == 0) {
opcode = reinterpret_cast<uint8_t*>(FindSignature("F3 0F 11 46 ? 45 89 ? ? F3 0F 10 46 ?"));

if (g_Data.getVersion() == GAMEVERSION::g_1_16_0)
opcode1 = reinterpret_cast<uint8_t*>(FindSignature("F3 0F 11 47 ? F3 0F 10 05"));
else
opcode1 = reinterpret_cast<uint8_t*>(FindSignature("F3 0F 11 46 ? F3 0F 10 4E ?"));
opcode1 = reinterpret_cast<uint8_t*>(FindSignature("F3 0F 11 46 ? F3 0F 10 4E ?"));
}

DWORD oldProtect = 0;
Expand Down Expand Up @@ -91,10 +83,7 @@ void NoSlowDown::onDisable() {
opcode1[1] = 0x0F;
opcode1[2] = 0x11;

if (g_Data.getVersion() == GAMEVERSION::g_1_16_0)
opcode1[3] = 0x47;
else
opcode1[3] = 0x46;
opcode1[3] = 0x46;

opcode1[4] = 0x0C;
//opcode[5] = {0xF3; 0x0F, 0x11, 0x46, 0x0C};
Expand Down
5 changes: 1 addition & 4 deletions Horion/path/JoePathFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ __forceinline bool isDangerous(const vec3_ti& pos, C_BlockSource* reg, bool allo
static uintptr_t** witherRoseVtable = nullptr;
if (witherRoseVtable == nullptr) {
uintptr_t sigOffset = 0;
if(g_Data.getVersion() == GAMEVERSION::g_1_16_0)
sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 49 89 06 48 B9");
else
sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 06 48 B9");
sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 06 48 B9");
int offset = *reinterpret_cast<int*>(sigOffset + 3);
witherRoseVtable = reinterpret_cast<uintptr_t**>(sigOffset + offset + /*length of instruction*/ 7);
}
Expand Down
17 changes: 0 additions & 17 deletions Memory/GameData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,6 @@ void GameData::retrieveClientInstance() {
#endif
}

void GameData::checkGameVersion() {
static uintptr_t sigOffset = 0;
// near string MinimumCompatibleClientVersion
if (sigOffset == 0)
sigOffset = FindSignature("48 8D 15 ?? ?? ?? ?? 48 3B CA 74 ?? 48 83 3D ?? ?? ?? ?? 10 48 0F 43 15 ?? ?? ?? ?? 4C 8B 05 ?? ?? ?? ?? E8 ?? ?? ?? ?? 49 8B C7");
int offset = *reinterpret_cast<int*>((sigOffset + 3));
std::string ver = reinterpret_cast<TextHolder*>(sigOffset + offset + 7)->getText();
auto lastDot = ver.find_last_of(".");
if (lastDot == std::string::npos || lastDot >= ver.size() - 1) {
this->version = static_cast<GAMEVERSION>(0);
return;
}

int num = std::stoi(ver.substr(lastDot + 1));
this->version = static_cast<GAMEVERSION>(num);
}

bool GameData::canUseMoveKeys() {
MinecraftGame* mc = g_Data.clientInstance->minecraftGame;
if (mc == nullptr) {
Expand Down
10 changes: 0 additions & 10 deletions Memory/GameData.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ enum DATAPACKET_CMD : int {
CMD_LOG
};

enum GAMEVERSION : int {
g_1_16_0 = 0,
g_1_16_1 = 1,
g_1_16_10 = 10,
g_1_16_20 = 20
};

struct HorionDataPacket {
DATAPACKET_CMD cmd;
int params[5] = {0};
Expand Down Expand Up @@ -102,7 +95,6 @@ class GameData {
AccountInformation accountInformation = AccountInformation::asGuest();
static void retrieveClientInstance();
TextHolder* fakeName;
GAMEVERSION version;

public:
NetworkedData networkedData;
Expand All @@ -124,7 +116,6 @@ class GameData {
static void setHIDController(C_HIDController* Hid);
static void setRakNetInstance(C_RakNetInstance* raknet);
static void log(const char* fmt, ...);
void checkGameVersion();
float fov = 0.f;
int fps = 0;
int frameCount = 0;
Expand Down Expand Up @@ -260,7 +251,6 @@ class GameData {
int getFPS() { return fps; };
int getLeftCPS() { return cpsLeft; };
int getRightCPS() { return cpsRight; };
GAMEVERSION getVersion() { return version; };
};

extern GameData g_Data;
5 changes: 1 addition & 4 deletions Memory/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -975,10 +975,7 @@ void Hooks::Actor_lerpMotion(C_Entity* _this, vec3_t motVec) {
static void* networkSender = nullptr;

if (!networkSender) {
if (g_Data.getVersion() == GAMEVERSION::g_1_16_0)
networkSender = reinterpret_cast<void*>(6 + FindSignature("FF 90 ?? ?? ?? ?? 4C 8D 9C 24 ?? ?? ?? ?? 49 8B 5B 18 49 8B 73 28 49 8B E3 5F C3"));
else
networkSender = reinterpret_cast<void*>(3 + FindSignature("FF 50 ? 41 80 BE ? ? ? ? ? 0F 85 ? ? ? ? EB 76"));
networkSender = reinterpret_cast<void*>(3 + FindSignature("FF 50 ? 41 80 BE ? ? ? ? ? 0F 85 ? ? ? ? EB 76"));
}

if (networkSender == _ReturnAddress()) {
Expand Down
5 changes: 1 addition & 4 deletions SDK/CBlockLegacy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ void C_BlockLegacy::liquidGetFlow(vec3_t* flowOut, C_BlockSource* reg, const vec
using liquid_getFlow_t = int(__fastcall*)(C_BlockLegacy*, vec3_t*, C_BlockSource*, const vec3_ti*);
static liquid_getFlow_t liquid_getDepth = nullptr;
if(liquid_getDepth == nullptr){
if(g_Data.getVersion() == GAMEVERSION::g_1_16_0)
liquid_getDepth = reinterpret_cast<liquid_getFlow_t>(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 0F 29 70 ? 0F 29 78 ? 44 0F 29 40 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 49 8B F1 4C 89 4C 24"));
else
liquid_getDepth = reinterpret_cast<liquid_getFlow_t>(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? ?? ?? ?? ?? 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 49 8B F1 4C 89 4C"));
liquid_getDepth = reinterpret_cast<liquid_getFlow_t>(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 C7 45 ?? ?? ?? ?? ?? 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 ?? 49 8B F1 4C 89 4C"));
}
liquid_getDepth(this, flowOut, reg, pos);
}
Expand Down

1 comment on commit ec768c2

@Intoprelised
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

insane

Please sign in to comment.