mirror of
https://github.com/WPMGPRoSToTeMa/SafeNameAndChat.git
synced 2025-01-27 03:17:54 +03:00
Fixed linux build error
This commit is contained in:
parent
7294986558
commit
d2bc30e94b
8
Main.cpp
8
Main.cpp
@ -383,12 +383,12 @@ void Init() {
|
||||
dlclose(handle);
|
||||
|
||||
uintptr_t addr = (uintptr_t)g_engfuncs.pfnMessageEnd;
|
||||
mprotect(addr/PAGESIZE*PAGESIZE, 5 + addr%PAGESIZE, PROT_EXEC | PROT_READ | PROT_WRITE);
|
||||
mprotect((void*)(addr/PAGESIZE*PAGESIZE), 5 + addr%PAGESIZE, PROT_EXEC | PROT_READ | PROT_WRITE);
|
||||
memcpy(g_originalBytes, (void*)g_engfuncs.pfnMessageEnd, 5);
|
||||
g_patchedBytes[0] = char(0xE9);
|
||||
*(uint32_t*)&g_patchedBytes[1] = (uint32_t)&PF_MessageEnd_I - ((uint32_t)g_engfuncs.pfnMessageEnd + 5);
|
||||
memcpy((void*)g_engfuncs.pfnMessageEnd, g_patchedBytes, 5);
|
||||
mprotect(addr/PAGESIZE*PAGESIZE, 5 + addr%PAGESIZE, PROT_EXEC | PROT_READ);
|
||||
mprotect((void*)(addr/PAGESIZE*PAGESIZE), 5 + addr%PAGESIZE, PROT_EXEC | PROT_READ);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -965,10 +965,10 @@ void PF_MessageEnd_I() {
|
||||
VirtualProtect(g_engfuncs.pfnMessageEnd, 5, oldProtect, &oldProtect);
|
||||
#else
|
||||
uintptr_t addr = (uintptr_t)g_engfuncs.pfnMessageEnd;
|
||||
mprotect(addr/PAGESIZE*PAGESIZE, 5 + addr%PAGESIZE, PROT_EXEC | PROT_READ | PROT_WRITE);
|
||||
mprotect((void*)(addr/PAGESIZE*PAGESIZE), 5 + addr%PAGESIZE, PROT_EXEC | PROT_READ | PROT_WRITE);
|
||||
memcpy((void*)g_engfuncs.pfnMessageEnd, g_originalBytes, 5);
|
||||
g_engfuncs.pfnMessageEnd();
|
||||
memcpy((void*)g_engfuncs.pfnMessageEnd, g_patchedBytes, 5);
|
||||
mprotect(addr/PAGESIZE*PAGESIZE, 5 + addr%PAGESIZE, PROT_EXEC | PROT_READ);
|
||||
mprotect((void*)(addr/PAGESIZE*PAGESIZE), 5 + addr%PAGESIZE, PROT_EXEC | PROT_READ);
|
||||
#endif
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user