mirror of
https://github.com/WPMGPRoSToTeMa/SafeNameAndChat.git
synced 2025-06-02 08:37:36 +03:00
Fixed crashes on the latest ReHLDS (#4)
Fixes #1 by updating the memory pattern for `gMsgBuffer` and `gMsgType` variables.
This commit is contained in:
parent
83fc271222
commit
baf100c59d
4
Main.cpp
4
Main.cpp
@ -355,7 +355,7 @@ void Init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isReHLDS) {
|
if (isReHLDS) {
|
||||||
uintptr_t addr = FindMemoryByPattern(g_engfuncs.pfnMessageEnd, "F6 05 ?? ?? ?? ?? 02 0F 85 ?? ?? ?? ?? 8B ?? ?? ?? ?? ?? 83 ?? 3A");
|
uintptr_t addr = FindMemoryByPattern(g_engfuncs.pfnMessageEnd, "F6 05 ?? ?? ?? ?? 02 0F 85 ?? ?? ?? ?? 8B ?? ?? ?? ?? ?? 83");
|
||||||
g_msgBuffer = decltype(g_msgBuffer)(*(uintptr_t *)(addr + 2) - offsetof(remove_pointer_t<decltype(g_msgBuffer)>, flags));
|
g_msgBuffer = decltype(g_msgBuffer)(*(uintptr_t *)(addr + 2) - offsetof(remove_pointer_t<decltype(g_msgBuffer)>, flags));
|
||||||
g_msgType = *(int **)(addr + 15);
|
g_msgType = *(int **)(addr + 15);
|
||||||
} else {
|
} else {
|
||||||
@ -381,7 +381,7 @@ void Init() {
|
|||||||
if (g_msgBuffer != nullptr) {
|
if (g_msgBuffer != nullptr) {
|
||||||
g_msgType = (decltype(g_msgType))dlsym(handle, "gMsgType");
|
g_msgType = (decltype(g_msgType))dlsym(handle, "gMsgType");
|
||||||
} else {
|
} else {
|
||||||
uintptr_t addr = FindMemoryByPattern(g_engfuncs.pfnMessageEnd, "F6 05 ?? ?? ?? ?? 02 0F 85 ?? ?? ?? ?? 8B ?? ?? ?? ?? ?? 83 ?? 3A");
|
uintptr_t addr = FindMemoryByPattern(g_engfuncs.pfnMessageEnd, "F6 05 ?? ?? ?? ?? 02 0F 85 ?? ?? ?? ?? 8B ?? ?? ?? ?? ?? 83");
|
||||||
g_msgBuffer = decltype(g_msgBuffer)(*(uintptr_t *)(addr + 2) - offsetof(remove_pointer_t<decltype(g_msgBuffer)>, flags));
|
g_msgBuffer = decltype(g_msgBuffer)(*(uintptr_t *)(addr + 2) - offsetof(remove_pointer_t<decltype(g_msgBuffer)>, flags));
|
||||||
g_msgType = *(int **)(addr + 15);
|
g_msgType = *(int **)(addr + 15);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user