From 3a9d538afa2b4d4684359235ef68f782794c1ce7 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Sat, 9 Jan 2021 21:10:32 -0400 Subject: [PATCH] fix inventoryMove , scaffold, tower , skin ,a --- Horion/Module/Modules/AntiVoid.cpp | 2 +- Horion/Module/Modules/Scaffold.cpp | 5 +++-- Horion/Module/Modules/TestModule.cpp | 2 +- Horion/Module/Modules/Tower.cpp | 4 ++-- Memory/Hooks.cpp | 18 +++++++++--------- SDK/CBlockLegacy.cpp | 2 +- SDK/CBlockLegacy.h | 6 +++--- SDK/CEntity.h | 3 ++- SDK/CItem.h | 2 +- 9 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Horion/Module/Modules/AntiVoid.cpp b/Horion/Module/Modules/AntiVoid.cpp index 5b7dbf93..7e0691b2 100644 --- a/Horion/Module/Modules/AntiVoid.cpp +++ b/Horion/Module/Modules/AntiVoid.cpp @@ -17,7 +17,7 @@ void AntiVoid::onTick(C_GameMode* gm) { blockBelow.y -= player->height; blockBelow.y -= 0.5f; - if ((*(player->region->getBlock(blockBelow)->blockLegacy))->blockId != 0 && (*(player->region->getBlock(blockBelow)->blockLegacy))->material->isSolid) { + if (((player->region->getBlock(blockBelow)->blockLegacy))->blockId != 0 && ((player->region->getBlock(blockBelow)->blockLegacy))->material->isSolid) { savepos = blockBelow; savepos.y += player->height; savepos.y += 0.5f; diff --git a/Horion/Module/Modules/Scaffold.cpp b/Horion/Module/Modules/Scaffold.cpp index 44eec4af..8d884d1b 100644 --- a/Horion/Module/Modules/Scaffold.cpp +++ b/Horion/Module/Modules/Scaffold.cpp @@ -17,7 +17,7 @@ bool Scaffold::tryScaffold(vec3_t blockBelow) { blockBelow = blockBelow.floor(); C_Block* block = g_Data.getLocalPlayer()->region->getBlock(vec3_ti(blockBelow)); - C_BlockLegacy* blockLegacy = *(block->blockLegacy); + C_BlockLegacy* blockLegacy = (block->blockLegacy); if (blockLegacy->material->isReplaceable) { vec3_ti blok(blockBelow); @@ -38,7 +38,8 @@ bool Scaffold::tryScaffold(vec3_t blockBelow) { int i = 0; for (auto current : checklist) { vec3_ti calc = blok.sub(*current); - if (!(*(g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) { + bool Y = ((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable; + if (!((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) { // Found a solid block to click foundCandidate = true; blok = calc; diff --git a/Horion/Module/Modules/TestModule.cpp b/Horion/Module/Modules/TestModule.cpp index c52b423c..938f1d87 100644 --- a/Horion/Module/Modules/TestModule.cpp +++ b/Horion/Module/Modules/TestModule.cpp @@ -158,7 +158,7 @@ bool tryPlace(const vec3_ti& blockPos) { for (const auto& current : checklist) { vec3_ti calc = blockPos.sub(current); - if (!(*(g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) { + if (!((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) { // Found a solid block to click g_Data.getCGameMode()->buildBlock(&calc, i); diff --git a/Horion/Module/Modules/Tower.cpp b/Horion/Module/Modules/Tower.cpp index 5c45c45c..d02d95bd 100644 --- a/Horion/Module/Modules/Tower.cpp +++ b/Horion/Module/Modules/Tower.cpp @@ -24,7 +24,7 @@ bool Tower::tryTower(vec3_t blockBelow) { DrawUtils::drawBox(blockBelow, vec3_t(blockBelow).add(1), 0.4f); C_Block* block = g_Data.getLocalPlayer()->region->getBlock(vec3_ti(blockBelow)); - C_BlockLegacy* blockLegacy = *(block->blockLegacy); + C_BlockLegacy* blockLegacy = (block->blockLegacy); if (blockLegacy->material->isReplaceable) { vec3_ti blok(blockBelow); @@ -44,7 +44,7 @@ bool Tower::tryTower(vec3_t blockBelow) { int i = 0; for (auto current : checklist) { vec3_ti calc = blok.sub(*current); - if (!(*(g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) { + if (!((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) { // Found a solid block to click foundCandidate = true; blok = calc; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 2ce2675d..e60df23b 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -71,8 +71,8 @@ void Hooks::Init() { } // MoveInputHandler::vtable - /*{ - uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 03 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B 42 ?? 48 85 C0 74 04"); + { + uintptr_t sigOffset = FindSignature("48 8D 0D ? ? ? ? 49 89 48 ? 49 89 80 ? ? ? ? 49 89 80 ? ? ? ? 48 39 87 ? ? ? ? 74 20 48 8B 8F"); int offset = *reinterpret_cast(sigOffset + 3); uintptr_t** moveInputVtable = reinterpret_cast(sigOffset + offset + 7); if (moveInputVtable == 0x0 || sigOffset == 0x0) @@ -80,10 +80,10 @@ void Hooks::Init() { else { g_Hooks.MoveInputHandler_tickHook = std::make_unique(moveInputVtable[1], Hooks::MoveInputHandler_tick); } - }*/ + } // PackAccessStrategy vtables for isTrusted - /*{ + { uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 49 89 06 49 8D 76 50"); int offset = *reinterpret_cast(sigOffset + 3); uintptr_t** directoryPackVtable = reinterpret_cast(sigOffset + offset + 7); @@ -94,13 +94,13 @@ void Hooks::Init() { uintptr_t sigOffset2 = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 03 49 8D 57"); int offset2 = *reinterpret_cast(sigOffset2 + 3); - uintptr_t** directoryPackVtable2 = reinterpret_cast(sigOffset2 + offset2 + / 7); + uintptr_t** directoryPackVtable2 = reinterpret_cast(sigOffset2 + offset2 + 7); { g_Hooks.ZipPackAccessStrategy__isTrustedHook = std::make_unique(directoryPackVtable2[6], Hooks::ReturnTrue); } g_Hooks.SkinRepository___checkSignatureFileInPack = std::make_unique(FindSignature("40 57 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 48 8B 39 48 8B 59 ? 48 85 DB"), Hooks::ReturnTrue); - }*/ + } } // d3d11 @@ -257,7 +257,7 @@ void Hooks::Init() { void* PaintingRenderer__renderAddr = reinterpret_cast(FindSignature("48 8B C4 57 41 54 41 55 41 56 41 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 68 ?? 48 89 70 ?? 4D 8B F0 4C 8B FA 48 8B F1 B9 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??")); g_Hooks.PaintingRenderer__renderHook = std::make_unique(PaintingRenderer__renderAddr, Hooks::PaintingRenderer__render); - void* _getSkinPack = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 48 C7 85 ? ? ? ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 48 8B F2")); + void* _getSkinPack = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? B8 ? ? ? ? E8 ? ? ? ? 48 2B E0 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B E2 48 8B F1")); g_Hooks.SkinRepository___loadSkinPackHook = std::make_unique(_getSkinPack, Hooks::SkinRepository___loadSkinPack); void* _toStyledString = reinterpret_cast(FindSignature("40 55 56 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? FE FF FF FF 48 89 9C 24 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B FA 48 8B D9 48 89 54 24 ?? 33 D2")); @@ -1210,7 +1210,7 @@ void Hooks::GameMode_startDestroyBlock(C_GameMode* _this, vec3_ti* a2, uint8_t f const bool isAutoMode = nukerModule->isAutoMode(); C_BlockSource* region = g_Data.getLocalPlayer()->region; - int selectedBlockId = (*(region->getBlock(*a2)->blockLegacy))->blockId; + int selectedBlockId = ((region->getBlock(*a2)->blockLegacy))->blockId; uint8_t selectedBlockData = region->getBlock(*a2)->data; if (!isAutoMode) { @@ -1223,7 +1223,7 @@ void Hooks::GameMode_startDestroyBlock(C_GameMode* _this, vec3_ti* a2, uint8_t f if (tempPos.y > 0) { C_Block* blok = region->getBlock(tempPos); uint8_t data = blok->data; - int id = (*(blok->blockLegacy))->blockId; + int id = ((blok->blockLegacy))->blockId; if (id != 0 && (!isVeinMiner || (id == selectedBlockId && data == selectedBlockData))) _this->destroyBlock(&tempPos, face); } diff --git a/SDK/CBlockLegacy.cpp b/SDK/CBlockLegacy.cpp index f601669f..ce26440a 100644 --- a/SDK/CBlockLegacy.cpp +++ b/SDK/CBlockLegacy.cpp @@ -4,7 +4,7 @@ #include "../Utils/Utils.h" C_Block* C_BlockSource::getBlock(const vec3_ti& block) { using getBlock_t = C_Block*(__fastcall*)(C_BlockSource*, const vec3_ti&); - static getBlock_t getBlock = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 48 8B DA 8B 52 ?? 85 D2")); + static getBlock_t getBlock = reinterpret_cast(FindSignature("48 89 5C 24 ? 57 48 83 EC ? 48 8B F9 48 8B DA 8B 4A")); return getBlock(this, block); } C_BlockActor* C_BlockSource::getBlockEntity(const vec3_ti& block) { diff --git a/SDK/CBlockLegacy.h b/SDK/CBlockLegacy.h index 874f7bd9..b32d4c0f 100644 --- a/SDK/CBlockLegacy.h +++ b/SDK/CBlockLegacy.h @@ -37,7 +37,7 @@ class C_BlockLegacy { TextHolder name; //0x0030 private: char idk1[0x8]; //0x0050 - char pad_0x0048[0x78]; //0x0058 + char pad_0x0048[0x80]; //0x0058 public: C_Material* material; //0x00C0 private: @@ -63,9 +63,9 @@ class C_Block { char pad[0x7]; public: - C_BlockLegacy** blockLegacy; // 0x10 + C_BlockLegacy* blockLegacy; // 0x10 - inline C_BlockLegacy* toLegacy() { return *blockLegacy; } + inline C_BlockLegacy* toLegacy() { return blockLegacy; } virtual ~C_Block(); virtual int getRenderLayer(); diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 3dc03e09..094dfaed 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -648,7 +648,7 @@ class C_Entity { virtual __int64 initBodyControl(void); public: - virtual __int64 jumpFromGround(__int64); + virtual __int64 jumpFromGround0(__int64); virtual __int64 jumpFromGround(void); private: @@ -664,6 +664,7 @@ class C_Entity { virtual __int64 prepareRegion(__int64 &); virtual __int64 destroyRegion(void); virtual __int64 suspendRegion(void); + virtual void resendAllChunks(void); virtual __int64 _fireWillChangeDimension(void); virtual __int64 _fireDimensionChanged(void); virtual __int64 changeDimensionWithCredits(__int64); diff --git a/SDK/CItem.h b/SDK/CItem.h index 934e7281..2a05b8ec 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -233,7 +233,7 @@ class C_Item { return false; } bool isBlock(void) { - auto val = *reinterpret_cast<__int64***>(reinterpret_cast<__int64>(this) + 0x170); + auto val = *reinterpret_cast<__int64***>(reinterpret_cast<__int64>(this) + 0x1D0); return val != nullptr && *val != nullptr; } };