mirror of
https://github.com/araxiaonline/WoW-Launcher.git
synced 2026-06-13 01:22:21 -04:00
Fixed custom file loading crash. Closes https://github.com/Arctium/WoW-Launcher/issues/32
This commit is contained in:
@@ -12,11 +12,11 @@ class ModLoader
|
||||
{
|
||||
var asm = new byte[]
|
||||
{
|
||||
0x85, 0xD2, 0x0F, 0x88, 0x72, 0xAF, 0xFF, 0xFF, 0x33, 0xC0,
|
||||
0x49, 0xB9, 0x22, 0x22, 0x22, 0x22, 0x11, 0x11, 0x11, 0x11,
|
||||
0x8D, 0x0C, 0x40, 0xC1, 0xE1, 0x02, 0x42, 0x39, 0x14, 0x09,
|
||||
0x74, 0x0C, 0xFF, 0xC0, 0x3D, 0xEF, 0xBE, 0xAD, 0xDE, 0x72,
|
||||
0xEB, 0x33, 0xC0, 0xC3, 0x4A, 0x8B, 0x44, 0x09, 0x04, 0xC3
|
||||
0x85, 0xD2, 0x0F, 0x88, 0x72, 0xAF, 0xFF, 0xFF, 0x33, 0xC0,
|
||||
0x49, 0xB9, 0x22, 0x22, 0x22, 0x22, 0x11, 0x11, 0x11, 0x11,
|
||||
0x8D, 0x0C, 0x40, 0xC1, 0xE1, 0x02, 0x42, 0x39, 0x14, 0x09,
|
||||
0x74, 0x0C, 0xFF, 0xC0, 0x3D, 0xEF, 0xBE, 0xAD, 0xDE, 0x72,
|
||||
0xEB, 0x33, 0xC0, 0xC3, 0x4A, 0x8B, 0x44, 0x09, 0x04, 0xC3
|
||||
};
|
||||
|
||||
var trampolineInjectAddress = NativeWindows.VirtualAllocEx(processHandle, IntPtr.Zero, (uint)asm.Length + 32, 0x00001000, (uint)MemProtection.ExecuteRead);
|
||||
@@ -44,7 +44,7 @@ class ModLoader
|
||||
Buffer.BlockCopy(BitConverter.GetBytes(idAlloc), 0, asm, 12, 8);
|
||||
|
||||
// Calculate the jump address bytes.
|
||||
var trampolineJmpAddress = (uint)(trampolineInjectAddress + asm.Length - (memory.BaseAddress + (int)trampolineInjectAddress + 2) - 6);
|
||||
var trampolineJmpAddress = (uint)(trampolineInjectAddress + asm.Length - (trampolineInjectAddress + 2) - 6);
|
||||
|
||||
// Copy trampoline bytes.
|
||||
Buffer.BlockCopy(BitConverter.GetBytes(trampolineJmpAddress), 0, asm, 4, 4);
|
||||
|
||||
Reference in New Issue
Block a user