Hello everyone
I just recently started getting into reverse engineering (although you might not wanna call it like that yet..) and was trying my luck on the 'jumping procedure' to track down the height one jumps.
I 'think' that I found the static address that holds the height, but I can't seem to patch it permanently..
Code:
0060EFD0 /$ 8B81 B8000000 MOV EAX,DWORD PTR DS:[ECX+B8]
0060EFD6 |. 85C0 TEST EAX,EAX
0060EFD8 |. 74 0E JE SHORT Wow.0060EFE8
0060EFDA |. 8B40 28 MOV EAX,DWORD PTR DS:[EAX+28]
0060EFDD |. A8 04 TEST AL,4
0060EFDF |. 75 07 JNZ SHORT Wow.0060EFE8
0060EFE1 |. A9 00020000 TEST EAX,200
0060EFE6 |. 75 0C JNZ SHORT Wow.0060EFF4
0060EFE8 |> F741 40 00040000 TEST DWORD PTR DS:[ECX+40],400
0060EFEF |. 75 03 JNZ SHORT Wow.0060EFF4
0060EFF1 |. 33C0 XOR EAX,EAX
0060EFF3 |. C3 RETN
0060EFF4 |> B8 01000000 MOV EAX,1
0060EFF9 \. C3 RETN
As I said I'm new to this.. but I think this is the innermost function that handles jumping. Setting a breakpoint on it in Olly always causes it to pause as soon as I hit the space bar ingame.
Following back the code trying earlier breakpoints, i came along this line(s):
Code:
008D65B1 |. F7C7 00002000 TEST EDI,200000
008D65B7 EB 08 JMP SHORT Wow.008D65C1
008D65B9 |. D905 70829A00 FLD DWORD PTR DS:[9A8270]
008D65BF |. EB 06 JMP SHORT Wow.008D65C7
008D65C1 |> D905 6C829A00 FLD DWORD PTR DS:[9A826C]
008D65C7 |> 51 PUSH ECX ; /Arg1 = 0019FBA0
008D65C8 |. 8BCE MOV ECX,ESI ; |
008D65CA |. D91C24 FSTP DWORD PTR SS:[ESP] ; |
008D65CD |. E8 4EFDFFFF CALL Wow.008D6320 ; \Wow.008D6320
Or more specific: this single line:
Code:
008D65C1 |> D905 6C829A00 FLD DWORD PTR DS:[9A826C]
In the Hex Dump, (again, I think..) the address 009A826C holds the height.
To be more exact: [009A826C]=-7.955547 (hex: D8 93 FE C0)
So.. I tried my luck and modified the binary.. I changed the last byte to C1 instead of the normal C0, that leads to quite a change to the float (now being about -31.00f), changed back to WoW and was able to jump quite high.
Now the problem (again, new to this business..): I tried to patch this value via C#. So far I didn't have alot of trouble reading/writing to WoW and doing the 'beginner stuff'.
Code:
private string ChangeJumpHeight()
{
IntPtr hProcess = Memory.OpenProcess(Memory.GetProcessIdByProcessName("Wow.exe"));
Process.EnterDebugMode();
if (hProcess != IntPtr.Zero)
{
Memory.WriteMemory(hProcess, 0x009A826F, 0xC1);
// Memory.WriteMemory(hProcess, 0x1F098987, 0xC1);
byte _4 = Memory.ReadByte(hProcess, 0x009A826F);
return "SUCCESS";
}
else
{
return "FAILED";
}
}
I'm just trying to patch the last byte of the float and after that immeadiately read it to see my changes.. where I fail, badly. The value seems to pop back instantly because im just reading 0xC0 again. (standard value).
I couldn't find any other references to this address, but found another address that holds the exact same value, no success there either. (the commented one)
(Thanks again Shynd for your great library btw.)
Any ideas how to patch the value permanently or an explanation why my way doesn't work and I suck so much at everything.
Thanks in advance.