From 74c3a18063280639885a65d17f249a2407662ca7 Mon Sep 17 00:00:00 2001 From: erwan celanie Date: Wed, 23 Dec 2020 14:00:33 -0400 Subject: [PATCH] Initial 1.16.201 support --- Horion/Command/Commands/EnchantCommand.cpp | 4 +-- Horion/Module/Modules/Godmode.cpp | 4 +-- Horion/Module/Modules/NoFall.cpp | 4 +-- Memory/GameData.cpp | 4 +-- Memory/Hooks.cpp | 16 +++++------- SDK/CEntity.cpp | 4 +-- SDK/CInventory.h | 4 +-- SDK/CInventoryTransaction.cpp | 2 +- SDK/CItem.cpp | 30 ++++++++-------------- SDK/CItem.h | 2 +- SDK/CPacket.cpp | 22 ++++++++-------- SDK/CPacket.h | 4 +-- SDK/TextHolder.h | 1 + 13 files changed, 46 insertions(+), 55 deletions(-) diff --git a/Horion/Command/Commands/EnchantCommand.cpp b/Horion/Command/Commands/EnchantCommand.cpp index caea8e1f1..6c07b515b 100644 --- a/Horion/Command/Commands/EnchantCommand.cpp +++ b/Horion/Command/Commands/EnchantCommand.cpp @@ -98,12 +98,12 @@ bool EnchantCommand::execute(std::vector* args) { using addEnchant_t = bool(__fastcall*)(void*, __int64); using saveEnchantsToUserData_t = void(__fastcall*)(C_ItemStack*, void*); - static getEnchantsFromUserData_t getEnchantsFromUserData = reinterpret_cast(FindSignature("48 8B C4 55 57 41 54 41 56 41 57 48 8D 68 ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 70 ?? 0F 29 70 C8 4C 8B E2 4C 8B F9 48 89 54 24 ?? 33 F6")); + static getEnchantsFromUserData_t getEnchantsFromUserData = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 48 81 EC ? ? ? ? 48 8B F2 48 8B D9 48 89 54 24 ? 33 FF 89 7C 24 ? E8 ? ? ? ? 84 C0")); static addEnchant_t addEnchant = reinterpret_cast(FindSignature("48 89 5C 24 ?? 48 89 54 24 ?? 57 48 83 EC ?? 45 0F")); static saveEnchantsToUserData_t saveEnchantsToUserData = 0x0; if (!saveEnchantsToUserData) { - saveEnchantsToUserData = reinterpret_cast(FindSignature("40 57 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? ?? ?? ?? ?? 48 89 9C 24 ?? ?? ?? ?? 48 8B FA 4C 8B C1 48 8B 41 ?? 48 85 C0 74 29 48 83 38 ?? 74 23 48 8D 42 ?? 48 83 C2 50")); + saveEnchantsToUserData = reinterpret_cast(FindSignature("48 89 5C 24 ? 56 57 41 56 48 81 EC ? ? ? ? 0F 29 B4 24 ? ? ? ? 48 8B FA 4C 8B C1 48 8B 41 08 48 85 C0")); } if (strcmp(args->at(1).c_str(), "all") == 0) { diff --git a/Horion/Module/Modules/Godmode.cpp b/Horion/Module/Modules/Godmode.cpp index 6370aa3ec..c301e5203 100644 --- a/Horion/Module/Modules/Godmode.cpp +++ b/Horion/Module/Modules/Godmode.cpp @@ -24,8 +24,8 @@ void Godmode::onSendPacket(C_Packet* p) { if (p->isInstanceOf()) { C_MovePlayerPacket* movePacket = reinterpret_cast(p); movePacket->onGround = true; - } else if (p->isInstanceOf()) { + } /*else if (p->isInstanceOf()) { C_ActorFallPacket* fallPacket = reinterpret_cast(p); fallPacket->fallDistance = 0.f; - } + }*/ } diff --git a/Horion/Module/Modules/NoFall.cpp b/Horion/Module/Modules/NoFall.cpp index 6aa2f6d32..b14ea6394 100644 --- a/Horion/Module/Modules/NoFall.cpp +++ b/Horion/Module/Modules/NoFall.cpp @@ -15,9 +15,9 @@ void NoFall::onSendPacket(C_Packet* packet) { if (packet->isInstanceOf()) { C_MovePlayerPacket* movePacket = reinterpret_cast(packet); movePacket->onGround = true; - } else if (packet->isInstanceOf()) { + } /*else if (packet->isInstanceOf()) { C_ActorFallPacket* fallPacket = reinterpret_cast(packet); fallPacket->fallDistance = 0.f; - } + }*/ } } diff --git a/Memory/GameData.cpp b/Memory/GameData.cpp index 0e212021d..f3f2d4787 100644 --- a/Memory/GameData.cpp +++ b/Memory/GameData.cpp @@ -17,7 +17,7 @@ void GameData::retrieveClientInstance() { logF("clinet: %llX", clientInstanceOffset); } }*/ - clientInstanceOffset = 0x03A30F18; // pointer scanned, can't find good signatures so it'll stay + clientInstanceOffset = 0x03A30ED8; // pointer scanned, can't find good signatures so it'll stay g_Data.clientInstance = reinterpret_cast(g_Data.slimMem->ReadPtr(g_Data.gameModule->ptrBase + clientInstanceOffset, {0x0, 0x0, 0x40})); #ifdef _DEBUG @@ -199,7 +199,7 @@ void GameData::forEachEntity(std::function callback) { C_EntityList* entList = g_Data.getEntityList(); if (entList == 0) { #ifdef _DEBUG - logF("EntityList broken btw"); + logF("EntityList broken btw yeeeeeeyt"); #endif } else { size_t listSize = entList->getListSize(); diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index a43768b42..ef7280e1f 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -42,19 +42,17 @@ void Hooks::Init() { } // BlockLegacy::vtable - /*{ - //uintptr_t sigOffset = FindSignature("48 8D ?? ?? ?? ?? ?? 48 89 ?? 4C 39"); // BlockLegacy constructor - intptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 4C 39 7A ? 75 1A 48 C7 45"); // BlockLegacy constructor + { + intptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 4C 8B 72 ? 48 B9"); // BlockLegacy constructor int offset = *reinterpret_cast(sigOffset + 3); uintptr_t** blockLegacyVtable = reinterpret_cast(sigOffset + offset + 7); if (blockLegacyVtable == 0x0 || sigOffset == 0x0) logF("C_BlockLegacy signature not working!!!"); else { - g_Hooks.BlockLegacy_getRenderLayerHook = std::make_unique(blockLegacyVtable[125], Hooks::BlockLegacy_getRenderLayer); - - g_Hooks.BlockLegacy_getLightEmissionHook = std::make_unique(blockLegacyVtable[16], Hooks::BlockLegacy_getLightEmission); + g_Hooks.BlockLegacy_getRenderLayerHook = std::make_unique(blockLegacyVtable[168], Hooks::BlockLegacy_getRenderLayer); + g_Hooks.BlockLegacy_getLightEmissionHook = std::make_unique(blockLegacyVtable[171], Hooks::BlockLegacy_getLightEmission); } - }*/ + } // LocalPlayer::vtable { @@ -64,7 +62,7 @@ void Hooks::Init() { if (localPlayerVtable == 0x0 || sigOffset == 0x0) logF("C_LocalPlayer signature not working!!!"); else { - g_Hooks.Actor_isInWaterHook = std::make_unique(localPlayerVtable[61], Hooks::Actor_isInWater); + g_Hooks.Actor_isInWaterHook = std::make_unique(localPlayerVtable[65], Hooks::Actor_isInWater); g_Hooks.Actor_startSwimmingHook = std::make_unique(localPlayerVtable[182], Hooks::Actor_startSwimming); @@ -220,7 +218,7 @@ void Hooks::Init() { g_Hooks.PleaseAutoCompleteHook = std::make_unique(autoComplete, Hooks::PleaseAutoComplete); uintptr_t** packetSenderVtable = reinterpret_cast(*(uintptr_t*)g_Data.getClientInstance()->loopbackPacketSender); - //g_Hooks.LoopbackPacketSender_sendToServerHook = std::make_unique(packetSenderVtable[2], Hooks::LoopbackPacketSender_sendToServer); + g_Hooks.LoopbackPacketSender_sendToServerHook = std::make_unique(packetSenderVtable[2], Hooks::LoopbackPacketSender_sendToServer); void* getFov = reinterpret_cast(FindSignature("40 53 48 83 EC 70 0F 29 7C 24 ? 44 0F 29 4C 24 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? F3 0F 10 3D ? ? ? ? 44 0F")); g_Hooks.LevelRendererPlayer_getFovHook = std::make_unique(getFov, Hooks::LevelRendererPlayer_getFov); diff --git a/SDK/CEntity.cpp b/SDK/CEntity.cpp index 425136a1f..f3d1e5035 100644 --- a/SDK/CEntity.cpp +++ b/SDK/CEntity.cpp @@ -6,12 +6,12 @@ C_InventoryTransactionManager *C_Entity::getTransactionManager() { if (offset == 0) { // EnchantCommand::execute //offset = *reinterpret_cast(FindSignature("48 8D 8B ?? ?? ?? ?? E8 ?? ?? ?? ?? 90 48 8D 8D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8D 8D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8B ?? ?? ?? 8B") + 3); - offset = *reinterpret_cast(FindSignature("49 8D 8E ? ? ? ? E8 ? ? ? ? 90 48 8D 8D ? ? ? ? E8 ? ? ? ? 48 8D 8D ? ? ? ? E8 ? ? ? ?") + 3); + offset = *reinterpret_cast(FindSignature("49 8D 8E ? ? ? ? E8 ? ? ? ? 90 48 8D 8D ? ? ? ? E8 ? ? ? ? 48 8D 8D ? ? ? ? E8 ? ? ? ? 48 8B 4D") + 3); } return reinterpret_cast(reinterpret_cast<__int64>(this) + offset); } C_PlayerInventoryProxy *C_Player::getSupplies() { - static unsigned int offset = 0xBD0; + static unsigned int offset = 0xBE8; /*if (offset == 0) { offset = *reinterpret_cast(FindSignature("48 8B 51 ?? 4C 8B 82 ?? ?? ?? ?? 48 8B B2 ?? ?? ?? ?? 41 80 B8") + 7); // GameMode::startDestroyBlock -> GameMode::_canDestroy -> getSupplies }*/ diff --git a/SDK/CInventory.h b/SDK/CInventory.h index 2855e6563..158bc8f16 100644 --- a/SDK/CInventory.h +++ b/SDK/CInventory.h @@ -49,11 +49,11 @@ class C_Inventory { virtual __int64 initializeContainerContents(C_BlockSource&); virtual __int64 add(C_ItemStack&); virtual __int64 canAdd(const C_ItemStack&); - virtual void unknown(); + //virtual void unknown(); virtual __int64 clearSlot(int); virtual __int64 clearInventory(int); virtual __int64 load(); // ListTag const&,SemVersion const&,Level & - virtual void unknown2(); + //virtual void unknown2(); virtual __int64 getEmptySlotsCount(); virtual int getFirstEmptySlot(); virtual __int64 setContainerSize(); diff --git a/SDK/CInventoryTransaction.cpp b/SDK/CInventoryTransaction.cpp index 9050470a0..9462638d6 100644 --- a/SDK/CInventoryTransaction.cpp +++ b/SDK/CInventoryTransaction.cpp @@ -3,7 +3,7 @@ void C_InventoryTransactionManager::addInventoryAction(const C_InventoryAction& action,bool idk) { using InventoryTransactionManager__addAction_t = void(__fastcall*)(C_InventoryTransactionManager*, C_InventoryAction const&,bool); //static auto InventoryTransactionManager__addAction = reinterpret_cast(FindSignature("40 55 56 57 41 56 41 57 48 83 EC 30 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 5C 24 ?? 48 8B EA 4C 8B F1 4C 8B C2 48 8B 51 ?? 48 8B 49 ?? E8")); - static auto InventoryTransactionManager__addAction = reinterpret_cast(FindSignature("40 56 57 41 54 41 56 41 57 48 83 EC 30 48 C7 44 24 ? ? ? ? ? 48 89 5C 24 ? 48 89 6C 24 ? 45 0F B6 F8 4C 8B F2 48 8B F9 48 8B 01 48 8B 88 ? ? ? ?")); + static auto InventoryTransactionManager__addAction = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 56 41 57 48 83 EC ? 45 0F B6 F8 48 8B EA 4C 8B F1 48 8B 01 48 8B 88 ? ? ? ? 48 85 C9")); if (InventoryTransactionManager__addAction != 0) InventoryTransactionManager__addAction(this, action,idk); } diff --git a/SDK/CItem.cpp b/SDK/CItem.cpp index 93763d27c..7195936f9 100644 --- a/SDK/CItem.cpp +++ b/SDK/CItem.cpp @@ -12,14 +12,14 @@ C_BaseActorRenderContext::C_BaseActorRenderContext(C_ScreenContext *ScreenCtx, C } void C_ItemRenderer::renderGuiItemNew(C_BaseActorRenderContext *BaseActorRenderCtx, C_ItemStack *item, MinecraftGame *game, float x, float y, float opacity, float scale, bool isEnchanted) { using renderGuiItemNew_t = void(__fastcall *)(C_ItemRenderer *, C_BaseActorRenderContext *, C_ItemStack *, MinecraftGame *, float, float, float, float, float, bool); - static renderGuiItemNew_t renderGuiItemNew = reinterpret_cast(FindSignature("48 8B C4 55 56 57 41 54 41 55 41 56 41 57 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 89 58 20 0F 29 70 B8 48 8B 05 ?? ?? ?? ??")); + static renderGuiItemNew_t renderGuiItemNew = reinterpret_cast(FindSignature("40 53 55 57 41 55 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 49 8B 40 ? 49 8B D8 48 8B EA 4C 8B E9 48 85 C0")); item->setShowPickUp(false); renderGuiItemNew(this, BaseActorRenderCtx, item, game, x, y, 1, opacity, scale, isEnchanted); } void C_ItemRenderer::renderGuiItemInChunk(C_BaseActorRenderContext* BaseActorRenderCtx, C_ItemStack* item, float x, float y, float opacity, float scale, bool isEnchanted, int mode) { using renderGuiItemInChunk_t = void(__fastcall *)(C_ItemRenderer *, C_BaseActorRenderContext *, __int64, C_ItemStack *, float, float, float, float, float, int); - static renderGuiItemInChunk_t renderGuiItem = reinterpret_cast(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 ?? 44 0F 29 48 ?? 44 0F 29 90 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 85 ?? ?? ?? ?? 49 8B F1 45")); + static renderGuiItemInChunk_t renderGuiItem = reinterpret_cast(FindSignature("48 8B C4 48 89 58 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 B8 0F 29 78 A8 44 0F 29 40 ? 44 0F 29 48 ? 44 0F 29 90 ? ? ? ? 44 0F 29 98 ? ? ? ? 44 0F 29 A0 ? ? ? ? 44 0F 29 A8 ? ? ? ? 48 8B 05 ? ? ? ?")); //item->setShowPickUp(false); renderGuiItem(this, BaseActorRenderCtx, 2, item, x, y, 1, 1, scale, 0); @@ -28,7 +28,7 @@ void C_ItemRenderer::renderGuiItemInChunk(C_BaseActorRenderContext* BaseActorRen C_ItemStack::C_ItemStack(const C_ItemStack &src) { memset(this, 0x0, sizeof(C_ItemStack)); using ItemStackCopyConstructor_t = void(__fastcall *)(C_ItemStack &, C_ItemStack const &); - static ItemStackCopyConstructor_t ItemStackCopyConstructor = reinterpret_cast(FindSignature("48 8B C4 56 57 41 54 41 56 41 57 48 83 EC ?? 48 ?? ?? ?? ?? ?? ?? ?? 48 89 58 ?? 48 89 68 ?? 48 8B FA 48 8B D9 48 89 48 ??")); + static ItemStackCopyConstructor_t ItemStackCopyConstructor = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 83 EC 40 4C 8B F2 48 8B F1 48 89 4C 24 ? 33 ED 89 6C 24 20 48 8D")); ItemStackCopyConstructor(*this, src); this->setVtable(); } @@ -42,38 +42,30 @@ C_ItemStack::C_ItemStack(const Tag &tag) { } void C_ItemStack::fromTag(const Tag &tag) { using ItemStackBase__loadItemF = void(__fastcall *)(C_ItemStack *, Tag const &); - static ItemStackBase__loadItemF fromTag = nullptr; - - if (!fromTag) { - if (g_Data.getVersion() == GAMEVERSION::g_1_16_0) - fromTag = reinterpret_cast(FindSignature("48 8B C4 55 57 41 56 48 8D 68 A1 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 48 8B DA 48 8B F9 48 89 4D ? 33 D2 41 B8 ? ? ? ? 48 8D 4D A7 E8 ? ? ? ? 48 8D 05 ? ? ? ?")); - else - fromTag = reinterpret_cast(FindSignature("40 55 57 41 56 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 48 8B DA 48 8B F9 48 89 4D ? 33 D2 41 B8 ? ? ? ?")); - } - + static ItemStackBase__loadItemF fromTag = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 55 57 41 56 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 37 48 8B DA 48 8B F9 48 89 4D 97 0F 57 C0 0F 11 45 A7 0F 11 45 B7 0F 11 45 C7 0F 11 45 D7 0F 11 45 E7 0F 11 45 F7 0F 11 45 07")); fromTag(this, tag); } void C_ItemStack::save(CompoundTag **tag) { using ItemStackBase__saveF = void(__fastcall *)(C_ItemStack *, CompoundTag **); - ItemStackBase__saveF save = reinterpret_cast(FindSignature("40 55 56 57 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 45 ? ? ? ? ? 48 89 9C 24 ? ? ? ? 48 8B F2 4C 8B F1 48 89 55")); + ItemStackBase__saveF save = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B FA 48 8B F1 48 89 55 F7 45 33 ED")); return save(this, tag); } void C_ItemStack::setUserData(std::unique_ptr tag) { using setUserData_t = void(__fastcall *)(C_ItemStack *, std::unique_ptr); - setUserData_t setUserData = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? 48 8B DA 48 8D 51 10 48 3B D3 74 20 48 8B 03 48 ?? ?? ?? ?? ?? ?? 48 8B 0A 48 89 02 48 85 C9 74 0B 48 8B 01 BA ?? ?? ?? ?? FF 10")); + setUserData_t setUserData = reinterpret_cast(FindSignature("40 53 48 83 EC ? 48 8B DA 48 8D 51 10 48 3B D3 74 1F 48 8B 03 48 C7 03 ? ? ? ?")); setUserData(this, std::move(tag)); } void C_ItemStack::reinit(C_BlockLegacy &legacy, int count) { this->setVtable(); - Utils::CallVFunc<1, void>(this, &legacy, count); + Utils::CallVFunc<2, void>(this, &legacy, count); } void C_ItemStack::reinit(C_Item &item, int count, int itemData) { this->setVtable(); - Utils::CallVFunc<2, void>(this, &item, count, itemData); + Utils::CallVFunc<3, void>(this, &item, count, itemData); } int C_ItemStack::getEnchantValue(int enchantId) { using getEnchantsLevel_t = int(__fastcall *)(int, C_ItemStack *); - static getEnchantsLevel_t getEnchantsLevel = reinterpret_cast(FindSignature("48 8B C4 57 48 81 EC ? ? ? ? 48 C7 40 ? ? ? ? ? 48 89 58 ? 48 89 70 ? 48 8B F2 0F B6 D9 33 FF 48 8B CA E8")); + static getEnchantsLevel_t getEnchantsLevel = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8B F2 0F B6 D9 33 FF 48 8B CA E8 ? ? ? ?")); return getEnchantsLevel(enchantId, this); } void C_ItemStack::setVtable(void) { @@ -83,12 +75,12 @@ void C_ItemStack::setVtable(void) { } C_Item ***ItemRegistry::getItemFromId(void *ptr, int itemId) { using getItemFromId_t = C_Item ***(__fastcall *)(void *, int); - static getItemFromId_t getItemFromId = reinterpret_cast(FindSignature("40 53 48 83 EC ? 48 8B D9 66 85 D2 0F 84 ? ? ? ? 44 0F BF C2 48 B9 ? ? ? ? ? ? ? ? 44")); + static getItemFromId_t getItemFromId = reinterpret_cast(FindSignature("40 53 48 83 EC ? 8D 42 ? 48 8B D9 66 83 F8 ? 0F 86 ? ? ? ? 44 0F BF C2 49 B9 ? ? ? ? ? ? ? ? 41 8B C0")); return getItemFromId(ptr, itemId); } C_Item ***ItemRegistry::lookUpByName(void *a1, void *a2, TextHolder &text) { using ItemRegistry__lookupByName_t = C_Item ***(__fastcall *)(void *, void *, TextHolder &); - static ItemRegistry__lookupByName_t ItemRegistry__lookupByNameF = reinterpret_cast(FindSignature("40 55 56 57 41 54 41 55 41 56 41 57 ?? ?? ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 ?? ?? ?? ?? ?? ?? ?? 4C 8B F9 48 89 4D ?? 45 33 ED 44 89 6C 24 ?? 4D 39 68")); + static ItemRegistry__lookupByName_t ItemRegistry__lookupByNameF = reinterpret_cast(FindSignature("48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B EA 48 89 54 24 ? 48 89 4C 24 ? 48 89 4D")); return ItemRegistry__lookupByNameF(a1, a2, text); } diff --git a/SDK/CItem.h b/SDK/CItem.h index cba0e9ae2..934e72815 100644 --- a/SDK/CItem.h +++ b/SDK/CItem.h @@ -22,7 +22,7 @@ class C_BaseActorRenderContext { public: C_ItemRenderer* renderer; //0x0058 private: - char pad_0x50[0x228]; //0x60 + char pad_0x50[0x238]; //0x60 public: C_BaseActorRenderContext(C_ScreenContext* ScreenCtx, C_ClientInstance* client, MinecraftGame* game); }; diff --git a/SDK/CPacket.cpp b/SDK/CPacket.cpp index 69d337d2c..3145c5270 100644 --- a/SDK/CPacket.cpp +++ b/SDK/CPacket.cpp @@ -22,7 +22,7 @@ LevelSoundEventPacket::LevelSoundEventPacket() { PlayerAuthInputPacket::PlayerAuthInputPacket() { static uintptr_t** PlayerAuthInputPacketVtable = 0x0; if (PlayerAuthInputPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 45 ? 48 89 4D ? 0F 57 C9 0F 29 4D"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 45 97 48 89 75 BF 0F"); int offset = *reinterpret_cast(sigOffset + 3); PlayerAuthInputPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -36,7 +36,7 @@ PlayerAuthInputPacket::PlayerAuthInputPacket() { PlayerAuthInputPacket::PlayerAuthInputPacket(__int64 entityRuntimeId, vec3_t pos, float pitch, float yaw, float yawUnused) { static uintptr_t** PlayerAuthInputPacketVtable = 0x0; if (PlayerAuthInputPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 45 ? 48 89 4D ? 0F 57 C9 0F 29 4D"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 45 97 48 89 75 BF 0F"); int offset = *reinterpret_cast(sigOffset + 3); PlayerAuthInputPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -52,12 +52,12 @@ PlayerAuthInputPacket::PlayerAuthInputPacket(__int64 entityRuntimeId, vec3_t pos this->yawUnused = yawUnused; this->entityRuntimeId = entityRuntimeId; } -C_ActorFallPacket::C_ActorFallPacket() { +/*C_ActorFallPacket::C_ActorFallPacket() { static uintptr_t** ActorFallPacketVtable = 0x0; if (ActorFallPacketVtable == 0x0) { uintptr_t sigOffset = FindSignature("48 8D ? ? ? ? ? 48 89 ? E7 48 89 45 0F F3 0F 11 75 ?"); int offset = *reinterpret_cast(sigOffset + 3); - ActorFallPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); + ActorFallPacketVtable = reinterpret_cast(sigOffset + offset + 7); #ifdef _DEBUG if (ActorFallPacketVtable == 0x0 || sigOffset == 0x0) __debugbreak(); @@ -65,11 +65,11 @@ C_ActorFallPacket::C_ActorFallPacket() { } memset(this, 0, sizeof(C_ActorFallPacket)); // Avoid overwriting vtable vTable = ActorFallPacketVtable; -} +}*/ C_MobEquipmentPacket::C_MobEquipmentPacket() { static uintptr_t** MobEquipmentPacketVtable = 0x0; if (MobEquipmentPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 48 89 51 ? 48 8D 59 ? 48 89 5C 24 ? 49 8B D0"); + uintptr_t sigOffset = FindSignature("48 8D 0D ? ? ? ? 48 89 4D 90 48 89 45 B8 48 8D 97 ? ? ? ?"); int offset = *reinterpret_cast(sigOffset + 3); MobEquipmentPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -83,7 +83,7 @@ C_MobEquipmentPacket::C_MobEquipmentPacket() { C_MobEquipmentPacket::C_MobEquipmentPacket(__int64 entityRuntimeId, C_ItemStack& item, int hotbarSlot, int inventorySlot) { memset(this, 0x0, sizeof(C_MobEquipmentPacket)); using MobEquimentPacketConstructor_t = void(__fastcall*)(C_MobEquipmentPacket*, __int64, C_ItemStack&, int, int, char); - static MobEquimentPacketConstructor_t MobEquimentPacketConstructor = reinterpret_cast(FindSignature("48 89 4C 24 ? 56 57 41 56 48 83 EC ? 48 C7 44 24 ? ? ? ? ? 48 89 5C 24 ? 41 8B F1 49 8B F8 4C 8B F1")); + static MobEquimentPacketConstructor_t MobEquimentPacketConstructor = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 4C 24 ? 57 48 83 EC ? 41 8B D9 48 8B F9 C7 41 ? ? ? ? ? C7 41")); if (MobEquimentPacketConstructor != 0) MobEquimentPacketConstructor(this, entityRuntimeId, item, hotbarSlot, inventorySlot, 0); @@ -91,7 +91,7 @@ C_MobEquipmentPacket::C_MobEquipmentPacket(__int64 entityRuntimeId, C_ItemStack& C_InventoryTransactionPacket::C_InventoryTransactionPacket() { static uintptr_t** InventoryTransactionPacketVtable = 0x0; if (InventoryTransactionPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 0D ? ? ? ? 48 89 4C 24 ? 44 89 44 24 ? 0F 57 C0 66 0F 7F 44 24 ? 4C 89 84 24"); + uintptr_t sigOffset = FindSignature("48 8D 15 ? ? ? ? 48 89 54 24 ? 44 89 75"); int offset = *reinterpret_cast(sigOffset + 3); InventoryTransactionPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -121,7 +121,7 @@ C_TextPacket::C_TextPacket() { C_MovePlayerPacket::C_MovePlayerPacket() { static uintptr_t** movePlayerPacketVtable = 0x0; if (movePlayerPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 15 ? ? ? ? 48 89 11 48 89 79 ? 48 89 79 ? 48 89 79 ? 48 89 79 ? 66 89 79 ? 48 89 79"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 48 8B 82 ? ? ? ? 48 89 41 ? 48 8B 02 48 8B CA"); int offset = *reinterpret_cast(sigOffset + 3); movePlayerPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -135,7 +135,7 @@ C_MovePlayerPacket::C_MovePlayerPacket() { C_MovePlayerPacket::C_MovePlayerPacket(C_LocalPlayer* player, vec3_t pos) { static uintptr_t** movePlayerPacketVtable = 0x0; if (movePlayerPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 15 ? ? ? ? 48 89 11 48 89 79 ? 48 89 79 ? 48 89 79 ? 48 89 79 ? 66 89 79 ? 48 89 79"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 48 8B 82 ? ? ? ? 48 89 41 ? 48 8B 02 48 8B CA"); int offset = *reinterpret_cast(sigOffset + 3); movePlayerPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG @@ -156,7 +156,7 @@ C_MovePlayerPacket::C_MovePlayerPacket(C_LocalPlayer* player, vec3_t pos) { C_PlayerActionPacket::C_PlayerActionPacket() { static uintptr_t** playerActionPacketVtable = 0x0; if (playerActionPacketVtable == 0x0) { - uintptr_t sigOffset = FindSignature("48 8D 0D ?? ?? ?? ?? 48 89 4C 24 ?? 48 89 54 24 ?? 48 89 54 24 ?? 40 0F B6 CF"); + uintptr_t sigOffset = FindSignature("48 8D 0D ? ? ? ? 48 89 4C 24 ? 48 89 74 24 ? 48 89 74 24 ? 8B CF 83 F1"); int offset = *reinterpret_cast(sigOffset + 3); playerActionPacketVtable = reinterpret_cast(sigOffset + offset + /*length of instruction*/ 7); #ifdef _DEBUG diff --git a/SDK/CPacket.h b/SDK/CPacket.h index 13cbf40f4..cf3521a63 100644 --- a/SDK/CPacket.h +++ b/SDK/CPacket.h @@ -50,7 +50,7 @@ class PlayerAuthInputPacket : public C_Packet { PlayerAuthInputPacket(__int64 entityRuntimeId, vec3_t pos, float pitch, float yaw, float yawUnused); }; -class C_ActorFallPacket : public C_Packet { +/*class C_ActorFallPacket : public C_Packet { private: char pad_0x8[0x20]; //0x8 public: @@ -58,7 +58,7 @@ class C_ActorFallPacket : public C_Packet { __int64 runtimeId; // 0x28 float fallDistance; bool isInVoid; -}; +};*/ class C_PlayerActionPacket : public C_Packet { public: diff --git a/SDK/TextHolder.h b/SDK/TextHolder.h index 8fa051ab0..070a8591c 100644 --- a/SDK/TextHolder.h +++ b/SDK/TextHolder.h @@ -11,6 +11,7 @@ class TextHolder { size_t textLength; //0x0010 size_t alignedTextLength; //0x0018 + size_t idk; //0x0020 TextHolder() { memset(this, 0, sizeof(TextHolder));