Thanks very much for the help on this.
The code executes fine now. No more wow crashes which is nice.
Only problem is is that it always returns 0 -_-
Code:
OM.wow.Asm.AddLine("mov eax, [0x010BD5F4]");
OM.wow.Asm.AddLine("mov eax, [eax+0x34]");
OM.wow.Asm.AddLine("mov eax, [eax+0x24]");
OM.wow.Asm.AddLine("mov ecx, eax");
// get targetguid of local player
OM.wow.Asm.AddLine("mov ecx, [ecx+0x8]");
OM.wow.Asm.AddLine("mov ebx, dword [ecx+0x13*4]"); // high
OM.wow.Asm.AddLine("mov edx, dword [ecx+0x12*4]"); // low
OM.wow.Asm.AddLine("push 0x10");
OM.wow.Asm.AddLine("push ebx"); // high
OM.wow.Asm.AddLine("push edx"); // low
OM.wow.Asm.AddLine("call {0}", 0x007BE110); // always returns 0
OM.wow.Asm.AddLine("add esp, 0x0C");
OM.wow.Asm.AddLine("retn");
I did try setting "push 0x10" to "push 1" as suggested by shingetterrobo in this thread:
mmowned - problems calling objectbyguid console stuff
It had no effect, code still returns 0 (regardless of target: npc,player,self,mob)
I added a breakpoint to the start of the code and used to CE to trace what was happening:
Code:
\\0x007be110 call
007BE110 - 55 - push ebp
007BE111 - 8b ec - mov ebp,esp
007BE113 - 64 8b 0d 2c 00 00 00 - mov ecx,fs:[0000002c]
007BE11A - a1 fc d9 35 01 - mov eax,[0135d9fc] : 00000000
007BE11F - 8b 14 81 - mov edx,[ecx+eax*4]
007BE122 - 8b 8a 10 00 00 00 - mov ecx,[edx+00000010]
007BE128 - 83 ec 08 - sub esp,08
007BE12B - 85 c9 - test ecx,ecx
007BE12D - 74 2d - je 007be15c
//jump to 007be15c
007BE15C - 33 c0 - xor eax,eax
007BE15E - 8b e5 - mov esp,ebp
007BE160 - 5d - pop ebp
007BE161 - c3 - ret
//Returns to my function
003C001F - 83 c4 0c - add esp,0c
003C0022 - c3 - ret
I have to admit i'm not 100% sure what's happening there but at a guess I would say that my input variables are being tested against some criteria and fail to pass the test...
Just for added info the registers at the point just after the call to 0x007be110 (@push ebp) were:
Code:
Registers: Flags:
EAX 177FC4C8 CF 0
EBX F1300044 PF 1
ECX 177FDCA0 AF 0
EDX 910025A6 ZF 1
ESI 00000000 SF 0
EDI 00000000 DF 0
EBP 19ECFF94 OF 0
ESP 19ECFF7C
EIP 007BE110
Segment Registers:
CS 001B
SS 0023
DS 0023
ES 0023
FS 002B
GS 0000