Skip to content

Commit 5f74104

Browse files
authored
Merge pull request #22 from marioCST/feat/1.21.70
Initial 1.21.70 update
2 parents 7574e23 + 61dba55 commit 5f74104

File tree

14 files changed

+66
-27
lines changed

14 files changed

+66
-27
lines changed

src/client/Latite.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,10 @@ DWORD __stdcall startThread(HINSTANCE dll) {
143143
int deadCount = 0;
144144

145145
std::unordered_map<std::string, SDK::Version> versNumMap = {
146-
{ "1.21.62", SDK::VLATEST },
147-
{ "1.21.61", SDK::VLATEST },
148-
{ "1.21.60", SDK::VLATEST },
146+
{ "1.21.70", SDK::V1_21_70 },
147+
//{ "1.21.62", SDK::V1_21_60 },
148+
//{ "1.21.61", SDK::V1_21_60 },
149+
//{ "1.21.60", SDK::V1_21_60 },
149150
//{ "1.21.51", SDK::V1_21_50 },
150151
//{ "1.21.50", SDK::V1_21_50 },
151152
//{ "1.21.44", SDK::V1_21_40 },

src/client/feature/module/impl/game/TextHotkey.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void TextHotkey::onKey(Event& evG) {
3838
auto pkt = SDK::MinecraftPackets::createPacket(SDK::PacketID::TEXT);
3939
SDK::TextPacket* tp = reinterpret_cast<SDK::TextPacket*>(pkt.get());
4040

41-
tp->chat(util::WStrToStr(std::get<TextValue>(this->textMessage).str));
41+
tp->chat(msg);
4242

4343
SDK::ClientInstance::get()->getLocalPlayer()->packetSender->sendToServer(pkt.get());
4444

src/sdk/Util.h

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,38 @@ namespace util {
2929
}
3030

3131
namespace SDK {
32+
template <int offs_1_21_70, int offs_1_21_60, int offs_1_21_50, int offs_1_21_40, int offs_1_21_30, int offs_1_21_20, int offs_1_20_50, int offs_1_20_40, int offs_1_20_30, int offs_1_18_12, int offs_1_19_51>
33+
extern inline const int mvGetOffset() {
34+
switch (SDK::internalVers) {
35+
case SDK::V1_21_70:
36+
default:
37+
return offs_1_21_70;
38+
case SDK::V1_21_60:
39+
return offs_1_21_60;
40+
case SDK::V1_21_50:
41+
return offs_1_21_50;
42+
case SDK::V1_21_40:
43+
return offs_1_21_40;
44+
case SDK::V1_21_30:
45+
return offs_1_21_30;
46+
case SDK::V1_21_20:
47+
return offs_1_21_20;
48+
case SDK::V1_20_50:
49+
return offs_1_20_50;
50+
case SDK::V1_20_40:
51+
return offs_1_20_40;
52+
case SDK::V1_20_30:
53+
return offs_1_20_30;
54+
case SDK::V1_19_51:
55+
return offs_1_19_51;
56+
break;
57+
case SDK::V1_18_12:
58+
return offs_1_18_12;
59+
}
60+
}
61+
3262
template <int offs_1_21_60, int offs_1_21_50, int offs_1_21_40, int offs_1_21_30, int offs_1_21_20, int offs_1_20_50, int offs_1_20_40, int offs_1_20_30, int offs_1_18_12, int offs_1_19_51>
33-
extern inline const int mvGetOffset() {
63+
extern inline const int mvGetOffset() {
3464
switch (SDK::internalVers) {
3565
case SDK::V1_21_60:
3666
default:

src/sdk/Version.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ namespace SDK {
2020
V1_21_40 = 12140,
2121
V1_21_50 = 12150,
2222
V1_21_60 = 12160,
23-
VLATEST = V1_21_60,
23+
V1_21_70 = 12170,
24+
VLATEST = V1_21_70,
2425
};
2526

2627
extern int internalVers;

src/sdk/common/client/game/ClientInstance.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ SDK::GuiData* SDK::ClientInstance::getGuiData() {
7070
{
7171
return util::directAccess<GuiData*>(this, 0x558);
7272
}
73+
if (internalVers >= V1_21_70) {
74+
return util::directAccess<GuiData*>(this, 0x5B0);
75+
}
7376
if (internalVers >= V1_21_40) {
7477
return util::directAccess<GuiData*>(this, 0x590);
7578
}
@@ -79,7 +82,7 @@ SDK::GuiData* SDK::ClientInstance::getGuiData() {
7982
}
8083

8184
SDK::Options* SDK::ClientInstance::getOptions() {
82-
return memory::callVirtual<Options*>(this, 0xC4);
85+
return memory::callVirtual<Options*>(this, 0xC7);
8386
}
8487

8588
void SDK::ClientInstance::grabCursor() {

src/sdk/common/client/game/ClientInstance.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace SDK {
99
MVCLASS_FIELD(class Minecraft*, minecraft, 0xD8, 0xD0, 0xD0, 0xD0, 0xD0, 0xD0, 0xC0, 0xC0);
1010
MVCLASS_FIELD(class LevelRenderer*, levelRenderer, 0xE8, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xD0, 0xD0);
1111
MVCLASS_FIELD(class ClientInputHandler*, inputHandler, 0x118, 0x110, 0x110, 0x110, 0x110, 0x110, 0x100, 0x100);
12-
MVCLASS_FIELD(struct Vec2, cursorPos, 0x4D0, 0x4C8, 0x4C8, 0x4C8, 0x4C8, 0x498, 0x458, 0x458);
12+
MVCLASS_FIELD(struct Vec2, cursorPos, 0x4F0, 0x4D0, 0x4D0, 0x4D0, 0x4C8, 0x4C8, 0x4C8, 0x4C8, 0x498, 0x458, 0x458);
1313

1414
static ClientInstance* get();
1515
class BlockSource* getRegion();

src/sdk/common/client/game/MinecraftGame.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ bool SDK::MinecraftGame::isCursorGrabbed() {
1212

1313
SDK::ClientInstance* SDK::MinecraftGame::getPrimaryClientInstance() {
1414
if (SDK::internalVers >= V1_21_40) {
15-
const auto map = reinterpret_cast<std::map<unsigned char, std::shared_ptr<SDK::ClientInstance>>*>(reinterpret_cast<uintptr_t>(this) + 0x898);
15+
const auto map = reinterpret_cast<std::map<unsigned char, std::shared_ptr<SDK::ClientInstance>>*>(reinterpret_cast<uintptr_t>(this) + 0x8D8);
1616
return map->at(0).get();
1717
}
1818
//19AAAB62768

src/sdk/common/client/game/MinecraftGame.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ namespace SDK {
88
public:
99
bool isCursorGrabbed();
1010

11-
MVCLASS_FIELD(std::string, xuid, 0x310, 0x320, 0x318, 0x318, 0x2F8, 0x618, 0x228);
11+
MVCLASS_FIELD(std::string, xuid, 0x320, 0x310, 0x310, 0x310, 0x310, 0x320, 0x318, 0x318, 0x2F8, 0x618, 0x228);
1212
private:
13-
MVCLASS_FIELD(class FontRepository**, fontRepo, 0xE08, 0xEB0, 0xDE0, 0xE08, 0xE00, 0xF60, 0xF30, 0xF20, 0x110, 0xF88);
13+
MVCLASS_FIELD(class FontRepository**, fontRepo, 0xE38, 0xE08, 0xEB0, 0xDE0, 0xE08, 0xE00, 0xF60, 0xF30, 0xF20, 0x110, 0xF88);
1414
public:
15-
MVCLASS_FIELD(class Font*, minecraftFont, 0xE10, 0xEB8, 0xDE8, 0xE18, 0xE10, 0xF70, 0xF40, 0xF30, 0x120, 0xF78);
15+
MVCLASS_FIELD(class Font*, minecraftFont, 0xE40, 0xE10, 0xEB8, 0xDE8, 0xE18, 0xE10, 0xF70, 0xF40, 0xF30, 0x120, 0xF78);
1616

1717
class FontRepository* getFontRepository() {
1818
if (internalVers >= V1_21_40) {

src/sdk/common/client/renderer/game/LevelRendererPlayer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Vec3& SDK::LevelRendererPlayer::getOrigin() {
1010
}
1111

1212
float& SDK::LevelRendererPlayer::getFovX() {
13+
if (SDK::internalVers >= SDK::V1_21_70) return util::directAccess<float>(this, 0xF30);
1314
if (SDK::internalVers >= SDK::V1_21_60) return util::directAccess<float>(this, 0xEC8);
1415
if (SDK::internalVers >= SDK::V1_21_50) return util::directAccess<float>(this, 0xED0);
1516
if (SDK::internalVers >= SDK::V1_21_40) return util::directAccess<float>(this, 0xED8);
@@ -24,6 +25,7 @@ float& SDK::LevelRendererPlayer::getFovX() {
2425
}
2526

2627
float& SDK::LevelRendererPlayer::getFovY() {
28+
if (SDK::internalVers >= SDK::V1_21_70) return util::directAccess<float>(this, 0xF44);
2729
if (SDK::internalVers >= SDK::V1_21_60) return util::directAccess<float>(this, 0xEDC);
2830
if (SDK::internalVers >= SDK::V1_21_50) return util::directAccess<float>(this, 0xEE4);
2931
if (SDK::internalVers >= SDK::V1_21_40) return util::directAccess<float>(this, 0xEEC);

src/sdk/common/network/PacketSender.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ namespace SDK {
55
class PacketSender {
66
virtual ~PacketSender() = 0;
77
public:
8+
virtual bool isInitialized() = 0;
89
virtual void send(Packet*) = 0;
10+
virtual void sendTo(void* networkIdentifier, uint8_t subClientId, Packet* pkt);
911
virtual void sendToServer(Packet* pkt) = 0;
1012
};
1113
}

0 commit comments

Comments
 (0)