Skip to content

Commit 3f160f5

Browse files
authored
Update MainFunctions.cpp
1 parent a49ce03 commit 3f160f5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Client/loader/MainFunctions.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,18 @@ BOOL StartGtaProcess(const SString& lpApplicationName, const SString& lpCommandL
10521052
*FromUTF8(lpCurrentDirectory), &startupInfo, lpProcessInformation);
10531053

10541054
if (wasProcessCreated)
1055+
{
1056+
// Rough patch
1057+
constexpr char newDocumentPath[] = "MTA San Andreas User Files";
1058+
void* ducumentPathAddress = (void*)0x8747A9;
1059+
1060+
DWORD oldProtect;
1061+
VirtualProtectEx(lpProcessInformation->hProcess, ducumentPathAddress, 32, PAGE_EXECUTE_READWRITE, &oldProtect);
1062+
WriteProcessMemory(lpProcessInformation->hProcess, ducumentPathAddress, newDocumentPath, sizeof(newDocumentPath), nullptr);
1063+
VirtualProtectEx(lpProcessInformation->hProcess, ducumentPathAddress, 32, oldProtect, &oldProtect);
1064+
10551065
return true;
1066+
}
10561067

10571068
std::vector<DWORD> processIdListBefore = GetGTAProcessList();
10581069

0 commit comments

Comments
 (0)