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

Commit 3a9d538

Browse files
committed
fix inventoryMove , scaffold, tower , skin ,a
1 parent c72e42e commit 3a9d538

9 files changed

Lines changed: 23 additions & 21 deletions

File tree

Horion/Module/Modules/AntiVoid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void AntiVoid::onTick(C_GameMode* gm) {
1717
blockBelow.y -= player->height;
1818
blockBelow.y -= 0.5f;
1919

20-
if ((*(player->region->getBlock(blockBelow)->blockLegacy))->blockId != 0 && (*(player->region->getBlock(blockBelow)->blockLegacy))->material->isSolid) {
20+
if (((player->region->getBlock(blockBelow)->blockLegacy))->blockId != 0 && ((player->region->getBlock(blockBelow)->blockLegacy))->material->isSolid) {
2121
savepos = blockBelow;
2222
savepos.y += player->height;
2323
savepos.y += 0.5f;

Horion/Module/Modules/Scaffold.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ bool Scaffold::tryScaffold(vec3_t blockBelow) {
1717
blockBelow = blockBelow.floor();
1818

1919
C_Block* block = g_Data.getLocalPlayer()->region->getBlock(vec3_ti(blockBelow));
20-
C_BlockLegacy* blockLegacy = *(block->blockLegacy);
20+
C_BlockLegacy* blockLegacy = (block->blockLegacy);
2121
if (blockLegacy->material->isReplaceable) {
2222
vec3_ti blok(blockBelow);
2323

@@ -38,7 +38,8 @@ bool Scaffold::tryScaffold(vec3_t blockBelow) {
3838
int i = 0;
3939
for (auto current : checklist) {
4040
vec3_ti calc = blok.sub(*current);
41-
if (!(*(g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) {
41+
bool Y = ((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable;
42+
if (!((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) {
4243
// Found a solid block to click
4344
foundCandidate = true;
4445
blok = calc;

Horion/Module/Modules/TestModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ bool tryPlace(const vec3_ti& blockPos) {
158158
for (const auto& current : checklist) {
159159

160160
vec3_ti calc = blockPos.sub(current);
161-
if (!(*(g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) {
161+
if (!((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) {
162162
// Found a solid block to click
163163
g_Data.getCGameMode()->buildBlock(&calc, i);
164164

Horion/Module/Modules/Tower.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ bool Tower::tryTower(vec3_t blockBelow) {
2424
DrawUtils::drawBox(blockBelow, vec3_t(blockBelow).add(1), 0.4f);
2525

2626
C_Block* block = g_Data.getLocalPlayer()->region->getBlock(vec3_ti(blockBelow));
27-
C_BlockLegacy* blockLegacy = *(block->blockLegacy);
27+
C_BlockLegacy* blockLegacy = (block->blockLegacy);
2828
if (blockLegacy->material->isReplaceable) {
2929
vec3_ti blok(blockBelow);
3030

@@ -44,7 +44,7 @@ bool Tower::tryTower(vec3_t blockBelow) {
4444
int i = 0;
4545
for (auto current : checklist) {
4646
vec3_ti calc = blok.sub(*current);
47-
if (!(*(g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) {
47+
if (!((g_Data.getLocalPlayer()->region->getBlock(calc)->blockLegacy))->material->isReplaceable) {
4848
// Found a solid block to click
4949
foundCandidate = true;
5050
blok = calc;

Memory/Hooks.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,19 @@ void Hooks::Init() {
7171
}
7272

7373
// MoveInputHandler::vtable
74-
/*{
75-
uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 48 89 03 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 8B 42 ?? 48 85 C0 74 04");
74+
{
75+
uintptr_t sigOffset = FindSignature("48 8D 0D ? ? ? ? 49 89 48 ? 49 89 80 ? ? ? ? 49 89 80 ? ? ? ? 48 39 87 ? ? ? ? 74 20 48 8B 8F");
7676
int offset = *reinterpret_cast<int*>(sigOffset + 3);
7777
uintptr_t** moveInputVtable = reinterpret_cast<uintptr_t**>(sigOffset + offset + 7);
7878
if (moveInputVtable == 0x0 || sigOffset == 0x0)
7979
logF("C_GameMode signature not working!!!");
8080
else {
8181
g_Hooks.MoveInputHandler_tickHook = std::make_unique<FuncHook>(moveInputVtable[1], Hooks::MoveInputHandler_tick);
8282
}
83-
}*/
83+
}
8484

8585
// PackAccessStrategy vtables for isTrusted
86-
/*{
86+
{
8787
uintptr_t sigOffset = FindSignature("48 8D 05 ?? ?? ?? ?? 49 89 06 49 8D 76 50");
8888
int offset = *reinterpret_cast<int*>(sigOffset + 3);
8989
uintptr_t** directoryPackVtable = reinterpret_cast<uintptr_t**>(sigOffset + offset + 7);
@@ -94,13 +94,13 @@ void Hooks::Init() {
9494

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

9999
{
100100
g_Hooks.ZipPackAccessStrategy__isTrustedHook = std::make_unique<FuncHook>(directoryPackVtable2[6], Hooks::ReturnTrue);
101101
}
102102
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);
103-
}*/
103+
}
104104
}
105105

106106
// d3d11
@@ -257,7 +257,7 @@ void Hooks::Init() {
257257
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 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??"));
258258
g_Hooks.PaintingRenderer__renderHook = std::make_unique<FuncHook>(PaintingRenderer__renderAddr, Hooks::PaintingRenderer__render);
259259

260-
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"));
260+
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"));
261261
g_Hooks.SkinRepository___loadSkinPackHook = std::make_unique<FuncHook>(_getSkinPack, Hooks::SkinRepository___loadSkinPack);
262262

263263
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"));
@@ -1210,7 +1210,7 @@ void Hooks::GameMode_startDestroyBlock(C_GameMode* _this, vec3_ti* a2, uint8_t f
12101210
const bool isAutoMode = nukerModule->isAutoMode();
12111211

12121212
C_BlockSource* region = g_Data.getLocalPlayer()->region;
1213-
int selectedBlockId = (*(region->getBlock(*a2)->blockLegacy))->blockId;
1213+
int selectedBlockId = ((region->getBlock(*a2)->blockLegacy))->blockId;
12141214
uint8_t selectedBlockData = region->getBlock(*a2)->data;
12151215

12161216
if (!isAutoMode) {
@@ -1223,7 +1223,7 @@ void Hooks::GameMode_startDestroyBlock(C_GameMode* _this, vec3_ti* a2, uint8_t f
12231223
if (tempPos.y > 0) {
12241224
C_Block* blok = region->getBlock(tempPos);
12251225
uint8_t data = blok->data;
1226-
int id = (*(blok->blockLegacy))->blockId;
1226+
int id = ((blok->blockLegacy))->blockId;
12271227
if (id != 0 && (!isVeinMiner || (id == selectedBlockId && data == selectedBlockData)))
12281228
_this->destroyBlock(&tempPos, face);
12291229
}

SDK/CBlockLegacy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "../Utils/Utils.h"
55
C_Block* C_BlockSource::getBlock(const vec3_ti& block) {
66
using getBlock_t = C_Block*(__fastcall*)(C_BlockSource*, const vec3_ti&);
7-
static getBlock_t getBlock = reinterpret_cast<getBlock_t>(FindSignature("40 53 48 83 EC ?? 48 8B DA 8B 52 ?? 85 D2"));
7+
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"));
88
return getBlock(this, block);
99
}
1010
C_BlockActor* C_BlockSource::getBlockEntity(const vec3_ti& block) {

SDK/CBlockLegacy.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class C_BlockLegacy {
3737
TextHolder name; //0x0030
3838
private:
3939
char idk1[0x8]; //0x0050
40-
char pad_0x0048[0x78]; //0x0058
40+
char pad_0x0048[0x80]; //0x0058
4141
public:
4242
C_Material* material; //0x00C0
4343
private:
@@ -63,9 +63,9 @@ class C_Block {
6363
char pad[0x7];
6464

6565
public:
66-
C_BlockLegacy** blockLegacy; // 0x10
66+
C_BlockLegacy* blockLegacy; // 0x10
6767

68-
inline C_BlockLegacy* toLegacy() { return *blockLegacy; }
68+
inline C_BlockLegacy* toLegacy() { return blockLegacy; }
6969

7070
virtual ~C_Block();
7171
virtual int getRenderLayer();

SDK/CEntity.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ class C_Entity {
648648
virtual __int64 initBodyControl(void);
649649

650650
public:
651-
virtual __int64 jumpFromGround(__int64);
651+
virtual __int64 jumpFromGround0(__int64);
652652
virtual __int64 jumpFromGround(void);
653653

654654
private:
@@ -664,6 +664,7 @@ class C_Entity {
664664
virtual __int64 prepareRegion(__int64 &);
665665
virtual __int64 destroyRegion(void);
666666
virtual __int64 suspendRegion(void);
667+
virtual void resendAllChunks(void);
667668
virtual __int64 _fireWillChangeDimension(void);
668669
virtual __int64 _fireDimensionChanged(void);
669670
virtual __int64 changeDimensionWithCredits(__int64);

SDK/CItem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class C_Item {
233233
return false;
234234
}
235235
bool isBlock(void) {
236-
auto val = *reinterpret_cast<__int64***>(reinterpret_cast<__int64>(this) + 0x170);
236+
auto val = *reinterpret_cast<__int64***>(reinterpret_cast<__int64>(this) + 0x1D0);
237237
return val != nullptr && *val != nullptr;
238238
}
239239
};

0 commit comments

Comments
 (0)