Skip to content

Commit

Permalink
Fixed xincode on trsro (#715)
Browse files Browse the repository at this point in the history
* Fixed xincode on trsro
  • Loading branch information
SDClowen authored Sep 13, 2023
1 parent 2587c1a commit bb62d53
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions Library/RSBot.Core/Components/ClientManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static async Task<bool> Start()
ReadProcessMemory(process.Handle, process.MainModule.BaseAddress, moduleMemory, process.MainModule.ModuleMemorySize, out _);

var pattern = !isVtcGame ?
"6A 00 6A 00 FF D6 6A 00 8D 85" :
"6A 00 68 58 5C 29 01 68 64 5C 29 01" :
"6A 00 68 D8 15 26 01 68 E4";

var patchNop = new byte[] { 0x90, 0x90 };
Expand All @@ -103,21 +103,10 @@ public static async Task<bool> Start()
return false;
}

if(!isVtcGame)
{
WriteProcessMemory(pi.hProcess, address - 0x15, patchNop, 2, out _);
WriteProcessMemory(pi.hProcess, address + 0x04, patchNop, 2, out _);
WriteProcessMemory(pi.hProcess, address + 0x1D, patchJmp, 1, out _);
WriteProcessMemory(pi.hProcess, address + 0x9A, patchJmp, 1, out _);
}
else
{
WriteProcessMemory(pi.hProcess, address - 0x6A, patchJmp, 1, out _);
WriteProcessMemory(pi.hProcess, address + 0xC, patchNop2, 5, out _);
WriteProcessMemory(pi.hProcess, address + 0x13, patchJmp, 1, out _);
WriteProcessMemory(pi.hProcess, address + 0x90, patchJmp, 1, out _);
}

WriteProcessMemory(pi.hProcess, address - 0x6A, patchJmp, 1, out _);
WriteProcessMemory(pi.hProcess, address + 0xC, patchNop2, 5, out _);
WriteProcessMemory(pi.hProcess, address + 0x13, patchJmp, 1, out _);
WriteProcessMemory(pi.hProcess, address + 0x90, patchJmp, 1, out _);

moduleMemory = null;
GC.Collect();
Expand Down

0 comments on commit bb62d53

Please sign in to comment.