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

Commit

Permalink
fix inventoryMove , scaffold, tower , skin ,a
Browse files Browse the repository at this point in the history
  • Loading branch information
SurvirvorHRG committed Jan 10, 2021
1 parent c72e42e commit 3a9d538
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Horion/Module/Modules/AntiVoid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions Horion/Module/Modules/Scaffold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Horion/Module/Modules/TestModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions Horion/Module/Modules/Tower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
Expand Down
18 changes: 9 additions & 9 deletions Memory/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ 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<int*>(sigOffset + 3);
uintptr_t** moveInputVtable = reinterpret_cast<uintptr_t**>(sigOffset + offset + 7);
if (moveInputVtable == 0x0 || sigOffset == 0x0)
logF("C_GameMode signature not working!!!");
else {
g_Hooks.MoveInputHandler_tickHook = std::make_unique<FuncHook>(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<int*>(sigOffset + 3);
uintptr_t** directoryPackVtable = reinterpret_cast<uintptr_t**>(sigOffset + offset + 7);
Expand All @@ -94,13 +94,13 @@ void Hooks::Init() {

uintptr_t sigOffset2 = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 03 49 8D 57");
int offset2 = *reinterpret_cast<int*>(sigOffset2 + 3);
uintptr_t** directoryPackVtable2 = reinterpret_cast<uintptr_t**>(sigOffset2 + offset2 + / 7);
uintptr_t** directoryPackVtable2 = reinterpret_cast<uintptr_t**>(sigOffset2 + offset2 + 7);

{
g_Hooks.ZipPackAccessStrategy__isTrustedHook = std::make_unique<FuncHook>(directoryPackVtable2[6], Hooks::ReturnTrue);
}
g_Hooks.SkinRepository___checkSignatureFileInPack = std::make_unique<FuncHook>(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
Expand Down Expand Up @@ -257,7 +257,7 @@ void Hooks::Init() {
void* PaintingRenderer__renderAddr = reinterpret_cast<void*>(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<FuncHook>(PaintingRenderer__renderAddr, Hooks::PaintingRenderer__render);

void* _getSkinPack = reinterpret_cast<void*>(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<void*>(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<FuncHook>(_getSkinPack, Hooks::SkinRepository___loadSkinPack);

void* _toStyledString = reinterpret_cast<void*>(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"));
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion SDK/CBlockLegacy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<getBlock_t>(FindSignature("40 53 48 83 EC ?? 48 8B DA 8B 52 ?? 85 D2"));
static getBlock_t getBlock = reinterpret_cast<getBlock_t>(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) {
Expand Down
6 changes: 3 additions & 3 deletions SDK/CBlockLegacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion SDK/CEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion SDK/CItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};
Expand Down

1 comment on commit 3a9d538

@UltimateBoi
Copy link

Choose a reason for hiding this comment

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

Pls make scaffold work faster and better for hive and mineplex
i keep falling off on the bridge

Please sign in to comment.