༆⃤𝐊𝐈𝐍𝐆 𝐂𝐇𝐄𝐀𝐓༆⃤
Відкрити в Telegram
╔─━━━━━ 👑 ━━━━─╗ 🔱قناة خاصة بـهاك ببــجي ╚─━━━━━ 👑 ━━━━─╝ ┄─━━◉━━─┄ ☯️نسخ مهكره✔️ ☯️حمايات✔️ ☯️نشر سورسات مجانية جاهزة للخمط ✔️ ┄─━━◉━━─┄
Показати більшеКраїна не вказанаКатегорія не вказана
480
Підписники
Немає даних24 години
Немає даних7 днів
Немає даних30 днів
Архів дописів
VTable_Hook(GameViewport->VTable, 132, PostRender, oPostRender);
04 серп 2024, 16:22
int GetMemoryProtection(void *address) {
char line[PATH_MAX] = {0};
char perms[5];
int bol = 1;
FILE *fp = fopen("/proc/self/maps", "r");
if (fp == nullptr)
return 0;
while (fgets(line, PATH_MAX, fp) != nullptr) {
unsigned long start, end;
int eol = (strchr(line, '\n') != nullptr);
if (bol){
if (!eol){
bol = 0;
}
} else {
if (eol){
bol = 1;
}
continue;
}
if (sscanf(line, "%lx-%lx %4s", &start, &end, perms) != 3){
continue;
}
if (start <= (unsigned long) address && (unsigned long) address < end){
int prot = 0;
if (perms[0] == 'r'){
prot |= PROT_READ;
} else if (perms[0] != '-'){
goto unknown_perms;
}
if (perms[1] == 'w'){
prot |= PROT_WRITE;
} else if (perms[1] != '-'){
goto unknown_perms;
}
if (perms[2] == 'x'){
prot |= PROT_EXEC;
} else if (perms[2] != '-'){
goto unknown_perms;
}
if (perms[3] != 'p'){
goto unknown_perms;
}
if (perms[4] != '\0'){
perms[4] = '\0';
goto unknown_perms;
}
fclose(fp);
return prot;
}
}
unknown_perms:
fclose(fp);
return 0;
}
int32_t ChangeMemoryProtection(void *address, int32_t protection) {
unsigned long page_size = sysconf(_SC_PAGESIZE);
unsigned long size = page_size * sizeof(uintptr_t);
return mprotect((void *) ((uintptr_t) address - ((uintptr_t) address % page_size) - page_size), (size_t) size, protection);
}
template <typename T>
void VTable_Hook(void **vtable, int32_t index, T newFunction, T& oldFunction) {
if (vtable[index] != newFunction) {
int oldProtection = GetMemoryProtection(vtable[index]);
if (oldProtection != 0) {
if (ChangeMemoryProtection(&vtable[index], PROT_READ | PROT_WRITE) == 0) {
oldFunction = reinterpret_cast<T>(vtable[index]);
vtable[index] = (void *) newFunction;
if (vtable[index] == newFunction) {
ChangeMemoryProtection(&vtable[index], oldProtection);
}
}
}
}
}04 серп 2024, 16:21
size_t calculateVTableSize(void** vtable) {
std::size_t size = 0;
while (vtable[size] != nullptr) {
++size;
}
return size;
}
void (*oPostRender)(UGameViewportClient*, UCanvas*);
void PostRender(UGameViewportClient* Viewport, UCanvas* Canvas) {
oPostRender(Viewport, Canvas);
if (Canvas) {
screenWidth = Canvas->SizeX;
screenHeight = Canvas->SizeY;
RenderESP(Canvas);
}
}
GameViewport = UObject::FindObject<UGameViewportClient>(XorEnc("GameViewportClient Transient.UAEGameEngine_1.GameViewportClient_1"));
while (!GameViewport) {
GameViewport = UObject::FindObject<UGameViewportClient>(XorEnc("GameViewportClient Transient.UAEGameEngine_1.GameViewportClient_1"));
std::this_thread::sleep_for(std::chrono::milliseconds(iEnc("50")));
}
if (GameViewport) {
auto vtableSize = Memory::calculateVTableSize(GameViewport->VTable);
void** vtableCopy = new void*[vtableSize];
memcpy(vtableCopy, GameViewport->VTable, sizeof(void*) * vtableSize);
oPostRender = decltype(oPostRender)(GameViewport->VTable[iEnc("132")]);
vtableCopy[iEnc("132")] = (void *) PostRender;
GameViewport->VTable = vtableCopy;
}04 серп 2024, 16:13
27 вер 2022, 14:35
09 жовт 2022, ~04:02
