Skip to content

Commit 27ad9a3

Browse files
committed
Launcher bypass update
1 parent f3b0bf1 commit 27ad9a3

File tree

1 file changed

+52
-32
lines changed

1 file changed

+52
-32
lines changed

lol/exe.cpp

+52-32
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@
1010
#include "MinHook.h"
1111
#include "Sig.hpp"
1212

13+
bool doneMagic = false;
14+
1315
typedef char **(*hwid_t)(char **);
1416
hwid_t oHwid = nullptr;
1517
char **hwid(char **hwid_out) {
1618
auto result = oHwid(hwid_out);
17-
const auto s = std::string("---------Hi-Korepi-Devs---------");
19+
const auto s = std::string("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
1820
memcpy(*hwid_out, s.c_str(), s.size() + 1);
21+
doneMagic = true;
1922
return result;
2023
}
2124

22-
bool fakeResp = false;
2325
bool fakeVer = false;
2426

2527
void *userData;
@@ -31,10 +33,6 @@ options_t oOptions = nullptr;
3133

3234
void options(void *a1, size_t a2, void *a3) {
3335
if (a2 == 10002) {
34-
if (memcmp(a3, "https://md5c.", 13) == 0) {
35-
fakeResp = true;
36-
}
37-
3836
if (memcmp(a3, "https://ghp.", 12) == 0) {
3937
fakeVer = true;
4038
}
@@ -55,46 +53,35 @@ const std::string versionResp = R"|({
5553
"msg": "success",
5654
"code": 200,
5755
"data": {
58-
"latest_version": "1.3.2.0",
56+
"latest_version": "1.3.3.0",
5957
"update_required": true,
6058
"update_url": "https://github.com/Cotton-Buds/calculator/releases",
61-
"announcement": "4.7 os&cn",
62-
"updated_by": "Strigger(main) & Micah(auth) & EtoShinya(tech)",
63-
"updated_at": "2024-06-13 00:21",
59+
"announcement": "4.8 os&cn",
60+
"updated_by": "Strigger(main) & Micah(auth) & EtoShinya(update)",
61+
"updated_at": "2024-07-24 00:21",
6462
"update_diff": {
6563
"added_features": [
66-
"fix all 409",
67-
"Fix camera issues"
64+
"fix auto fish",
65+
"update 4.8"
6866
],
6967
"deleted_features": [
70-
"修复所有失效功能",
7168
"Restore all malfunctioning features."
7269
],
73-
"total_size": "124 MB"
70+
"total_size": "135 MB"
7471
},
7572
"compatible_versions": [
7673
"none"
7774
]
7875
},
79-
"sign2": "CCDPv7klKvXwkImpFaE+WfSJxrijj4nKHH5sSOQke2rdEpd+jCkiPMU24HCulrEtEfBQEUF2H7vBAQCbb5C8za5//+b77ccfumA63fFuie9WbeLhAIyq6t+UGpu5Ecfh6iLSNyPFZANTyjs3Cn5uXoiBPKgbczCMVN2fy80uUgVqaGYznWlD6zJYla/oPmuAewnd4AHv0kidNUPu9JQI2d++9+Un+GKbsKveN2LjEsc+SdCUtHCadMuJXcMx8lMCfUkORy6q7md2HcvNBc5EZQHQ+xvBy4GHa6qYs6pOfpdZP25ixuiaYtuLyf9572Fg1R3HS3lueFbhAyKDFvn4VA=="
76+
"sign2": "eMDldspy36kqMIRWWiGE/3J2e6/KAWdC8heSec80zZV8Ck2Z6mesGxGM8hPPkJODChzi8fA6xILl1VdNrZcG7saYa3TL/cyngmiofl0ZO52gepyMqQTY9b91iV1cfPa4SiRaNIag/l/5yAXaCLIyd5SkJ5ie3zu8xw9Pc9UM0CAGcdOO8HlnQNzRyoUtJoGcezdio7rsX/bLPbKC7zx7V1na7y9HULBKjQ1ysDJaRhBFpUthDKD5DZS4zzSWOnST5nc129X/XDDL9H9taRrUwECPnMe1dKjW/dvReKpheimmPLPYr425kTKPUbOh/wVVJuPR0cstrikuDrvxx4JmOw=="
8077
})|";
81-
const std::string resp =
82-
R"({"msg": "vpJSftgQ2noDAZR3Iri/ForvdhDZvxwlJCXowV9TgKSs+BoMyBMOIuxjpDcMTSov1thaXhg/d9aAKcpxOP6glQ3bSd8bHIGMku3Ck/33VdYhtzx4HwC4Lel5mVGZ9+2jffsIgHyIwxMl+8kYwh/QGQRlkC8zFfyNaMszsZiOxIJCy/RMYfI3buvCDPH/4D1/VxysPnaX+QtrVrs7Bt74byqnd38bi0GhpllEWL7CO+7fI+vMe2OSv6s0CUaOqzhDC5N8wIkHsthyVyP+GYoltTov3Bu5iaxmgZc/eYQPTkTWQ759pIVNjKJwnQI3EtOEdrRog6LAkA/CMGwMwBkScvY508Z3KhnNqqIIF9RpYLI6rdST+o2t5gIK4sElQg/2wHZT6wSm23t7YdxnwzEFZysv/H0y63iI4NMUmyZIkRvCyxlWVMpTt/rV9qubdbCjGDxG7A/0LbxCJBfBgEWu4Krpp1S+hk4qgIB+2apCh5sxU76mLzQdFLzNrgmbQADapyDO6rWw777F9FKlo/r9II8kISi/+2FxXp7TZE3ALbcyUo7zKucahsq7u9ucENm64D3PKV4YZCHchQY7xyYI4DaC1PQzleJxGaGbCoBQ0PZK7f33d3N3qB10OaEfe2de4uTcOKbVAjtjSLrlZcMGiZd40Bho76xCtcgAKG2FDxbH/PJo4BoIYwqiDzqpmxXBOsn0JqKLGLaAyU840GAgyLO62lE7/A26w+B9q7hkOIcKlfXZpdwjsll/dADe2U/uF5nrLxEOUGDx9gbUoB95KLD1S3KCCyaLuv8j4imt2E9EgDzk/1XdIwnbPGAECajV5z4yTpMuyD9XBhmJQIFutw==", "code": 200})";
83-
84-
bool doneMagic = false;
85-
8678
typedef size_t (*perform_t)(void *);
8779
perform_t oPerform = nullptr;
8880
size_t perform(void *a1) {
8981
if (fakeVer == true) {
9082
fakeVer = false;
9183
callback((char *)versionResp.c_str(), versionResp.size(), 1, userData);
9284
return 0;
93-
} else if (fakeResp == true) {
94-
fakeResp = false;
95-
callback((char *)resp.c_str(), resp.size(), 1, userData);
96-
doneMagic = true;
97-
return 0;
9885
}
9986

10087
return oPerform(a1);
@@ -159,6 +146,30 @@ HANDLE WINAPI createThread(HANDLE hProcess, LPSECURITY_ATTRIBUTES lpThreadAttrib
159146
dwCreationFlags, lpAttributeList, lpThreadId);
160147
}
161148

149+
typedef char **(*hwidInternal_t)(char **, char **);
150+
hwidInternal_t oHwidInternal = nullptr;
151+
char **hwidInternal(char **a1, char **a2) {
152+
auto result = oHwidInternal(a1, a2);
153+
const auto s = std::string("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
154+
memcpy(*a1, s.c_str(), s.size() + 1);
155+
return result;
156+
}
157+
158+
const void *hwidAddr = nullptr;
159+
160+
typedef void *(*GetSystemFirmwareTable_t)(DWORD, DWORD, void *, DWORD);
161+
GetSystemFirmwareTable_t oGetSystemFirmwareTable = nullptr;
162+
void *getSystemFirmware(DWORD FirmwareTableProviderSignature, DWORD FirmwareTableID, void *pFirmwareTableBuffer,
163+
DWORD BufferSize) {
164+
if (hwidAddr != nullptr) {
165+
MH_CreateHook((LPVOID)hwidAddr, (LPVOID)hwidInternal, (LPVOID *)&oHwidInternal);
166+
MH_EnableHook((LPVOID)hwidAddr);
167+
hwidAddr = nullptr;
168+
}
169+
170+
return oGetSystemFirmwareTable(FirmwareTableProviderSignature, FirmwareTableID, pFirmwareTableBuffer, BufferSize);
171+
}
172+
162173
void cont() {
163174
const auto exe = GetModuleHandle(nullptr);
164175
const auto header = (PIMAGE_DOS_HEADER)exe;
@@ -169,7 +180,7 @@ void cont() {
169180
const void *found = Sig::find(exe, size, "48 89 5C 24 10 48 89 7C 24 18 55 48 8D 6C");
170181

171182
if (found != nullptr) {
172-
MH_CreateHook((LPVOID)found, hwid, (LPVOID *)&oHwid);
183+
MH_CreateHook((LPVOID)found, (LPVOID)hwid, (LPVOID *)&oHwid);
173184
MH_EnableHook((LPVOID)found);
174185
}
175186
}
@@ -178,7 +189,7 @@ void cont() {
178189
const void *found = Sig::find(exe, size, "89 54 24 10 4C 89 44 24 18 4C 89 4C 24 20 48 83 EC 28 48 85 C9");
179190

180191
if (found != nullptr) {
181-
MH_CreateHook((LPVOID)found, options, (LPVOID *)&oOptions);
192+
MH_CreateHook((LPVOID)found, (LPVOID)options, (LPVOID *)&oOptions);
182193
MH_EnableHook((LPVOID)found);
183194
}
184195
}
@@ -187,13 +198,13 @@ void cont() {
187198
const void *found = Sig::find(exe, size, "40 55 56 48 83 EC 38 48 8B F1 48 85 C9 75 0A 8D");
188199

189200
if (found != nullptr) {
190-
MH_CreateHook((LPVOID)found, perform, (LPVOID *)&oPerform);
201+
MH_CreateHook((LPVOID)found, (LPVOID)perform, (LPVOID *)&oPerform);
191202
MH_EnableHook((LPVOID)found);
192203
}
193204
}
194205

195206
{
196-
const void *found = Sig::find(exe, size, "40 53 B8 20 00 00 00 E8 64 6F 13 00 48 2B E0 48 83 79 30 00");
207+
const void *found = Sig::find(exe, size, "40 53 B8 20 00 00 00 E8 ?? ?? ?? ?? 48 2B E0 48 83 79 30 00");
197208

198209
if (found != nullptr) {
199210
MH_CreateHook((LPVOID)found, (LPVOID)connectWrite, nullptr);
@@ -203,7 +214,7 @@ void cont() {
203214

204215
{
205216
const void *found =
206-
Sig::find(exe, size, "B8 38 00 00 00 E8 96 55 13 00 48 2B E0 45 85 C0 79 2A BA D0 00 00 00");
217+
Sig::find(exe, size, "B8 38 00 00 00 E8 ?? ?? ?? ?? 48 2B E0 45 85 C0 79 2A BA D0 00 00 00");
207218

208219
if (found != nullptr) {
209220
MH_CreateHook((LPVOID)found, (LPVOID)connectWrite, nullptr);
@@ -213,22 +224,31 @@ void cont() {
213224

214225
{
215226
const void *found =
216-
Sig::find(exe, size, "B8 38 00 00 00 E8 66 5B 13 00 48 2B E0 45 85 C0 79 2A BA DF 00 00 00");
227+
Sig::find(exe, size, "B8 38 00 00 00 E8 ?? ?? ?? ?? 48 2B E0 45 85 C0 79 2A BA DF 00 00 00");
217228

218229
if (found != nullptr) {
219230
MH_CreateHook((LPVOID)found, (LPVOID)read, nullptr);
220231
MH_EnableHook((LPVOID)found);
221232
}
222233
}
223234

224-
std::thread([]() {
235+
std::thread([exe, size]() {
225236
while (doneMagic == false) {
226237
Sleep(1);
227238
}
228239

229240
MH_DisableHook(MH_ALL_HOOKS);
230241
MH_RemoveHook(MH_ALL_HOOKS);
231242

243+
{
244+
hwidAddr = Sig::find(exe, size, "48 89 5C 24 18 55 56 57 48 8D AC 24");
245+
const auto getSystemFirmwareTable =
246+
GetProcAddress(GetModuleHandle(L"kernel32.dll"), "GetSystemFirmwareTable");
247+
MH_CreateHook((LPVOID)getSystemFirmwareTable, (LPVOID)getSystemFirmware,
248+
(LPVOID *)&oGetSystemFirmwareTable);
249+
MH_EnableHook((LPVOID)getSystemFirmwareTable);
250+
}
251+
232252
{
233253
const auto remoteThreadEx = GetProcAddress(GetModuleHandle(L"kernel32.dll"), "CreateRemoteThreadEx");
234254
MH_CreateHook((LPVOID)remoteThreadEx, (LPVOID)createThread, (LPVOID *)&oCreateRemoteThreadEx);

0 commit comments

Comments
 (0)