diff --git a/Horion/Command/Commands/TeleportCommand.cpp b/Horion/Command/Commands/TeleportCommand.cpp index f03bdaa6..443ac49e 100644 --- a/Horion/Command/Commands/TeleportCommand.cpp +++ b/Horion/Command/Commands/TeleportCommand.cpp @@ -14,7 +14,7 @@ bool TeleportCommand::execute(std::vector* args) { vec3_t pos; pos.x = assertFloat(args->at(1)); - pos.y = assertFloat(args->at(2)); + pos.y = assertFloat(args->at(2)) + 1; pos.z = assertFloat(args->at(3)); g_Data.getLocalPlayer()->setPos(pos); diff --git a/Horion/Module/Modules/Killaura.cpp b/Horion/Module/Modules/Killaura.cpp index f3e459a7..c7ca45a3 100644 --- a/Horion/Module/Modules/Killaura.cpp +++ b/Horion/Module/Modules/Killaura.cpp @@ -38,7 +38,7 @@ void findEntity(C_Entity* currentEntity, bool isRegularEntity) { return; if (killauraMod->isMobAura) { - if (currentEntity->getNameTag()->getTextLength() <= 1 && currentEntity->getEntityTypeId() == 63) + if (currentEntity->getNameTag()->getTextLength() <= 1 && currentEntity->getEntityTypeId() == 319) return; if(currentEntity->width <= 0.01f || currentEntity->height <= 0.01f) // Don't hit this pesky antibot on 2b2e.org return; diff --git a/Memory/Hooks.cpp b/Memory/Hooks.cpp index 180beb6f..0cffabc3 100644 --- a/Memory/Hooks.cpp +++ b/Memory/Hooks.cpp @@ -196,7 +196,7 @@ void Hooks::Init() { void* fogColorFunc = reinterpret_cast(FindSignature("41 0F 10 08 48 8B C2 0F")); g_Hooks.Dimension_getFogColorHook = std::make_unique(fogColorFunc, Hooks::Dimension_getFogColor); - void* timeOfDay = reinterpret_cast(FindSignature("44 8B C2 B8 F1 19 76 05")); + void* timeOfDay = reinterpret_cast(FindSignature("44 8B C2 B8 F1 19 76 05 F7 EA")); g_Hooks.Dimension_getTimeOfDayHook = std::make_unique(timeOfDay, Hooks::Dimension_getTimeOfDay); void* chestTick = reinterpret_cast(FindSignature("40 53 57 48 83 EC ?? 48 83 79 ?? ?? 48")); diff --git a/SDK/CBlockLegacy.cpp b/SDK/CBlockLegacy.cpp index dd0c2ff9..d5fdeea2 100644 --- a/SDK/CBlockLegacy.cpp +++ b/SDK/CBlockLegacy.cpp @@ -10,7 +10,7 @@ C_Block* C_BlockSource::getBlock(const vec3_ti& block) { } C_BlockActor* C_BlockSource::getBlockEntity(const vec3_ti& block) { using getBlockEntity_t = C_BlockActor*(__fastcall*)(C_BlockSource*, const vec3_ti&); - static getBlockEntity_t getBlockEntity = reinterpret_cast(FindSignature("48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC ? 8B 02 48 8B DA C1 F8 ? 48 8B F1 89 44 24 ? 8B 42")); + static getBlockEntity_t getBlockEntity = reinterpret_cast(FindSignature("40 55 56 57 48 83 EC ?? 8B 02")); return getBlockEntity(this, block); } C_Block* C_BlockSource::getLiquidBlock(const vec3_ti& block) { diff --git a/SDK/CEntity.cpp b/SDK/CEntity.cpp index e3863a74..e1c94cf0 100644 --- a/SDK/CEntity.cpp +++ b/SDK/CEntity.cpp @@ -34,3 +34,19 @@ void C_LocalPlayer::setGameModeType(int gma) { //static setGameMode Game_Mode = reinterpret_cast(FindSignature("48 8B C4 56 57 41 56 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 89 58 ? 48 89 68 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 8B EA 48 8B D9 44 8B B1 ? ? ? ? 83 FA ? 75 2D")); this->setC_PlayerGameType(gma); } + +bool PointingStruct::hasEntity() { + return rayHitType == 1; +} + +C_Entity *PointingStruct::getEntity() { + if (rayHitType != 1) return nullptr; + C_Entity *retval = nullptr; + g_Data.forEachEntity([this, &retval](C_Entity *ent, bool b) { + if (*(__int64 *)((__int64)ent + 0x10) == GamingEntityFinder) { + retval = ent; + return; + } + }); + return retval; +} diff --git a/SDK/CEntity.h b/SDK/CEntity.h index 1ac31332..d9f2fa1e 100644 --- a/SDK/CEntity.h +++ b/SDK/CEntity.h @@ -11,13 +11,17 @@ class C_GameMode; class PointingStruct { private: - char pad_0x0000[0x938]; //0x0000 -public: - int rayHitType; //0x08E0 - int blockSide; //0x08E4 - vec3_ti block; //0x08E8 - vec3_t rayHitVec; //0x08F4 - C_Entity *entityPtr; //0x0900 + char pad_0x0000[0x980]; //0x0000 +public: + int rayHitType; //0x08E0 + int blockSide; //0x08E4 + vec3_ti block; //0x08E8 + vec3_t rayHitVec; //0x08F4 + C_Entity *entityPtr; //0x0900 + C_Entity *entityPtr2; //0x0908 + uint64_t GamingEntityFinder; //0x0910 + bool hasEntity(); //to not go trough the entity list twice + C_Entity *getEntity(); //returns the entity that the player is looking at }; class C_Player; diff --git a/SDK/CItem.cpp b/SDK/CItem.cpp index c744f5be..2498ad65 100644 --- a/SDK/CItem.cpp +++ b/SDK/CItem.cpp @@ -52,7 +52,7 @@ void C_ItemStack::save(CompoundTag **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 8B DA 48 8D 51 20 48 3B D3 74 1F 48 8B 03 48 C7 03 ? ? ? ?")); + setUserData_t setUserData = reinterpret_cast(FindSignature("40 53 48 83 EC ?? 48 8B DA 48 8D 51 50 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) { diff --git a/SDK/CPacket.cpp b/SDK/CPacket.cpp index 3145c527..43f5da1d 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 97 48 89 75 BF 0F"); + uintptr_t sigOffset = FindSignature("48 8D 05 25 ?? ?? ?? 48 89 45 97 48 89 7D 9F"); 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 97 48 89 75 BF 0F"); + uintptr_t sigOffset = FindSignature("48 8D 05 25 ?? ?? ?? 48 89 45 97 48 89 7D 9F"); int offset = *reinterpret_cast(sigOffset + 3); PlayerAuthInputPacketVtable = 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 05 ? ? ? ? 48 89 01 48 8B 82 ? ? ? ? 48 89 41 ? 48 8B 02 48 8B CA"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 48 8B 82 70 ? ? ? 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 05 ? ? ? ? 48 89 01 48 8B 82 ? ? ? ? 48 89 41 ? 48 8B 02 48 8B CA"); + uintptr_t sigOffset = FindSignature("48 8D 05 ? ? ? ? 48 89 01 48 8B 82 70 ? ? ? 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 diff --git a/Utils/Target.cpp b/Utils/Target.cpp index 4dd34d81..743d1eb5 100644 --- a/Utils/Target.cpp +++ b/Utils/Target.cpp @@ -24,10 +24,10 @@ bool Target::isValidTarget(C_Entity* ent) { if (!ent->isAlive()) return false; - if (ent->getEntityTypeId() <= 122 && ent->getEntityTypeId() != 63 && antibot->isEntityIdCheckEnabled()) + if (ent->getEntityTypeId() <= 122 && ent->getEntityTypeId() != 319 && antibot->isEntityIdCheckEnabled()) return false; - if (ent->getEntityTypeId() == 63) { + if (ent->getEntityTypeId() == 319) { if (teams->isColorCheckEnabled()) { std::string targetName = ent->getNameTag()->getText(); std::string localName = g_Data.getLocalPlayer()->getNameTag()->getText();