Hi There, Im trying to use modified code from (i think Shynd's blog) to call Object->Interact(); via Asm.
my Method:
PHP Code:
public void Interact()
{
uint ObjectVTable = MemoryUtils.ReadPointer(BaseAddress);
uint InteractMethod = MemoryUtils.ReadPointer(ObjectVTable + (42 * 4)); // Object->Interact(); is the 42nd Method in the VTable
uint CodeCave = MemoryUtils.Reader.AllocateMemory();
Console.WriteLine("VTable: {0}, InteractMethod: {1}, CodeCave: {2}", ObjectVTable, InteractMethod, CodeCave);
Lua.Lua.instance.Clear();
Lua.Lua.instance.AddLine("MOV EDX,DWORD PTR DS:["+WowObjects.ObjectManagerBase+"]");
Lua.Lua.instance.AddLine("MOV EAX,DWORD PTR FS:[2C]");
Lua.Lua.instance.AddLine("MOV EAX,DWORD PTR DS:[EAX]");
Lua.Lua.instance.AddLine("ADD EAX,08");
Lua.Lua.instance.AddLine("MOV DWORD PTR DS:[EAX],EDX");
Lua.Lua.instance.AddLine("MOV ECX,DWORD PTR DS:["+BaseAddress+"]");
Lua.Lua.instance.AddLine("CALL "+InteractMethod);
Lua.Lua.instance.AddLine("RETN");
try
{
Lua.Lua.instance.Execute();
}
catch (Exception E)
{
Console.WriteLine("[WowObjects] Error in Object.Interact()");
}
finally
{
if (CodeCave != 0)
MemoryUtils.Reader.FreeMemory(CodeCave);
}
}
calling this method on valid object output what seem totally valid locations. yet this actually seems to do nothing. im at a loss. any ideas?