Skip to content

Commit 6df32d4

Browse files
committed
DLL bypass update
1 parent 27ad9a3 commit 6df32d4

File tree

1 file changed

+55
-9
lines changed

1 file changed

+55
-9
lines changed

lol/dll.cpp

+55-9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "MinHook.h"
55
#include "Sig.hpp"
66
#include <format>
7+
#include <inttypes.h>
78
#include <iostream>
89

910
bool fakeResp = false;
@@ -14,6 +15,9 @@ callback_t callback = nullptr;
1415
typedef void (*options_t)(void *, size_t, void *);
1516
options_t oOptions = nullptr;
1617

18+
typedef intmax_t (*strtoimax_t)(const char *nptr, char **endptr, int base);
19+
strtoimax_t oStrtoimax = nullptr;
20+
1721
void options(void *a1, size_t a2, void *a3) {
1822
if (a2 == 10002) {
1923
if (memcmp(a3, "https://md5c.", 13) == 0) {
@@ -33,7 +37,7 @@ void options(void *a1, size_t a2, void *a3) {
3337
}
3438

3539
const std::string resp =
36-
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})";
40+
R"({"msg": "AtZAfcAb+qtSipkXI9CP8u5XUYPGyCbGq5C/VYyt6tcelFYehMuYs0q8m/q+RwGx0/jOB3jDRAqjcqmunJpoKrIFV9W/YC9wzY+GaSU2L8oNQHlpx9KgJ0K50aqwxQD0dKiWmd16b76sLCn8GvpVrSk1k6SoFtUtPe30Cf1BkOsFD2oxSGBioUK22MkPFO2uj5xIXfZ5tC1dB4cS5ttzVlDiLPXY1hlJBqgFpZTj8znRz5qpMhflK5euefmKRPTKzwt+JHFF2YImsmDf49bMCgS6ZIwHL/jbK8dRJwFRjfkZjvpw2XxrL3wKubLqZKjUG3lHP6oKijmcWFTeu68xHphRKmqy43Gg3MZ1wCoYwcQL6tPPoqMy6TJwJdt/mBfhklPRq0XcTAjpnTIJeIo7zH/L1kFaGRAVFtqbwGLIIN08bb+7/tV3MOOc8BEp4RCb721hakBRNFqJAeYrt7yzr/VeK2igLuByrTcBkd0SOIB5LgI5K/qrMf/90bB8sfcicIgJXSVxyuuov45UXM2Rdo4YiL5M8b4LCJwhEkmplS8=", "code": 200})";
3741

3842
typedef size_t (*perform_t)(void *);
3943
perform_t oPerform = nullptr;
@@ -48,6 +52,25 @@ size_t perform(void *a1) {
4852
return oPerform(a1);
4953
}
5054

55+
intmax_t strtoint(const char *nptr, char **endptr, int base) {
56+
if (memcmp(nptr, "1721968703399", 13) == 0) {
57+
return 0x1f0ed5537a7;
58+
}
59+
60+
return oStrtoimax(nptr, endptr, base);
61+
}
62+
63+
char *base = nullptr;
64+
const auto expectedRegion = 0x3d3000;
65+
66+
void initWrapper() {
67+
const void *init = Sig::find(base, expectedRegion,
68+
"48 89 5C 24 08 48 89 74 24 10 48 89 7C 24 18 4C 89 74 24 20 55 48 8D AC 24 10");
69+
70+
CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)init, nullptr, 0, nullptr);
71+
ExitThread(0);
72+
}
73+
5174
void start() {
5275
MH_Initialize();
5376

@@ -72,8 +95,6 @@ void start() {
7295

7396
MEMORY_BASIC_INFORMATION mbi;
7497
bool foundBase = false;
75-
const auto expectedRegion = 0x3c7000;
76-
char *base = nullptr;
7798

7899
while (foundBase == false) {
79100
base = nullptr;
@@ -87,21 +108,46 @@ void start() {
87108
}
88109
}
89110

111+
// {
112+
// const void *found =
113+
// Sig::find(base, expectedRegion, "89 54 24 10 4C 89 44 24 18 4C 89 4C 24 20 48 83 EC 28 48 85 C9");
114+
115+
// if (found != nullptr) {
116+
// MH_CreateHook((LPVOID)found, (LPVOID)options, (LPVOID *)&oOptions);
117+
// MH_EnableHook((LPVOID)found);
118+
// }
119+
// }
120+
121+
// {
122+
// const void *found = Sig::find(base, expectedRegion, "40 55 56 48 83 EC 38 48 8B F1 48 85 C9 75 0A 8D");
123+
124+
// if (found != nullptr) {
125+
// MH_CreateHook((LPVOID)found, perform, (LPVOID *)&oPerform);
126+
// MH_EnableHook((LPVOID)found);
127+
// }
128+
// }
129+
130+
// {
131+
// MH_CreateHook((LPVOID)strtoimax, (LPVOID)strtoint, (LPVOID *)&oStrtoimax);
132+
// MH_EnableHook((LPVOID)strtoimax);
133+
// }
134+
90135
{
91-
const void *found =
92-
Sig::find(base, expectedRegion, "89 54 24 10 4C 89 44 24 18 4C 89 4C 24 20 48 83 EC 28 48 85 C9");
136+
const void *found = Sig::find(base, expectedRegion, "83 3D ? ? ? ? 00 75 04 33 C9 CD 29");
93137

94138
if (found != nullptr) {
95-
MH_CreateHook((LPVOID)found, (LPVOID)options, (LPVOID *)&oOptions);
96-
MH_EnableHook((LPVOID)found);
139+
const auto relative = *(int32_t *)((uintptr_t)found + 2);
140+
int32_t *role = (int32_t *)((uintptr_t)found + relative + 7);
141+
*role = 31;
97142
}
98143
}
99144

100145
{
101-
const void *found = Sig::find(base, expectedRegion, "40 55 56 48 83 EC 38 48 8B F1 48 85 C9 75 0A 8D");
146+
const void *found =
147+
Sig::find(base, expectedRegion, "48 89 5C 24 ? 48 89 7C 24 ? 55 48 8D 6C 24 ? 48 81 EC C0 00 00 00");
102148

103149
if (found != nullptr) {
104-
MH_CreateHook((LPVOID)found, perform, (LPVOID *)&oPerform);
150+
MH_CreateHook((LPVOID)found, (LPVOID)initWrapper, nullptr);
105151
MH_EnableHook((LPVOID)found);
106152
}
107153
}

0 commit comments

Comments
 (0)