Skip to content

Commit dd38f6a

Browse files
authored
Update CCore.cpp
1 parent 73ed91f commit dd38f6a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Client/core/CCore.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,15 @@ void CCore::ApplyHooks()
836836
{
837837
WriteDebugEvent("CCore::ApplyHooks");
838838

839+
constexpr char newDocumentPath[] = "MTA San Andreas User Files";
840+
void* ducumentPathAddress = (void*)0x8747A9;
841+
HANDLE currentProcess = GetCurrentProcess();
842+
843+
DWORD oldProtect;
844+
VirtualProtectEx(currentProcess, ducumentPathAddress, 32, PAGE_EXECUTE_READWRITE, &oldProtect);
845+
WriteProcessMemory(currentProcess, ducumentPathAddress, newDocumentPath, sizeof(newDocumentPath), nullptr);
846+
VirtualProtectEx(currentProcess, ducumentPathAddress, 32, oldProtect, &oldProtect);
847+
839848
// Create our hooks.
840849
m_pDirectInputHookManager->ApplyHook();
841850
// m_pDirect3DHookManager->ApplyHook ( );

0 commit comments

Comments
 (0)