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

Stuff v2 #4431

Merged
merged 8 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Horion/Command/Commands/TeleportCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bool TeleportCommand::execute(std::vector<std::string>* 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);
Expand Down
2 changes: 1 addition & 1 deletion Horion/Module/Modules/Killaura.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Memory/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void Hooks::Init() {
void* fogColorFunc = reinterpret_cast<void*>(FindSignature("41 0F 10 08 48 8B C2 0F"));
g_Hooks.Dimension_getFogColorHook = std::make_unique<FuncHook>(fogColorFunc, Hooks::Dimension_getFogColor);

void* timeOfDay = reinterpret_cast<void*>(FindSignature("44 8B C2 B8 F1 19 76 05"));
void* timeOfDay = reinterpret_cast<void*>(FindSignature("44 8B C2 B8 F1 19 76 05 F7 EA"));
g_Hooks.Dimension_getTimeOfDayHook = std::make_unique<FuncHook>(timeOfDay, Hooks::Dimension_getTimeOfDay);

void* chestTick = reinterpret_cast<void*>(FindSignature("40 53 57 48 83 EC ?? 48 83 79 ?? ?? 48"));
Expand Down
2 changes: 1 addition & 1 deletion SDK/CBlockLegacy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<getBlockEntity_t>(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<getBlockEntity_t>(FindSignature("40 55 56 57 48 83 EC ?? 8B 02"));
return getBlockEntity(this, block);
}
C_Block* C_BlockSource::getLiquidBlock(const vec3_ti& block) {
Expand Down
16 changes: 16 additions & 0 deletions SDK/CEntity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,19 @@ void C_LocalPlayer::setGameModeType(int gma) {
//static setGameMode Game_Mode = reinterpret_cast<setGameMode>(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;
}
18 changes: 11 additions & 7 deletions SDK/CEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion SDK/CItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void C_ItemStack::save(CompoundTag **tag) {
}
void C_ItemStack::setUserData(std::unique_ptr<Tag> tag) {
using setUserData_t = void(__fastcall *)(C_ItemStack *, std::unique_ptr<Tag>);
setUserData_t setUserData = reinterpret_cast<setUserData_t>(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<setUserData_t>(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) {
Expand Down
8 changes: 4 additions & 4 deletions SDK/CPacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int*>(sigOffset + 3);
PlayerAuthInputPacketVtable = reinterpret_cast<uintptr_t**>(sigOffset + offset + /*length of instruction*/ 7);
#ifdef _DEBUG
Expand All @@ -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<int*>(sigOffset + 3);
PlayerAuthInputPacketVtable = reinterpret_cast<uintptr_t**>(sigOffset + offset + /*length of instruction*/ 7);
#ifdef _DEBUG
Expand Down Expand Up @@ -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<int*>(sigOffset + 3);
movePlayerPacketVtable = reinterpret_cast<uintptr_t**>(sigOffset + offset + /*length of instruction*/ 7);
#ifdef _DEBUG
Expand All @@ -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<int*>(sigOffset + 3);
movePlayerPacketVtable = reinterpret_cast<uintptr_t**>(sigOffset + offset + /*length of instruction*/ 7);
#ifdef _DEBUG
Expand Down
4 changes: 2 additions & 2 deletions Utils/Target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down