Not to resurrect a dead thread, but this is the closest, most recent match to what I am doing. I am currently trying to get simple DoString support in C# using BlackMagic, and have hit a brick wall.
When I invoke the function, it doesn't crash the client, it doesn't throw an exception, but nothing happens. No response whatsoever. Same story with CastSpellById, incidentally. I have double checked the function offsets in IDA to verify the parameters and everything looks ok there. I have all the required DLLs in the executable folder. I have read every LUA thread I could find, and aside from constantly being reminded that I should be using C++ for this, I can't find anything that I might be doing wrong.
Here's what I am using:
Code:
public static void Lua_DoString(string command)
{
// command is something like "DoEmote(\"dance\")"
wow.Asm.AddLine("fs mov eax, [0x2C]");
wow.Asm.AddLine("mov eax, [eax]");
wow.Asm.AddLine("add eax, 0x10");
wow.Asm.AddLine("mov dword [eax], {0}", s_curMgr);
wow.Asm.AddLine("mov eax, 0");
wow.Asm.AddLine("push eax");
wow.Asm.AddLine("mov eax, {0}", stringcave);
wow.Asm.AddLine("push eax");
wow.Asm.AddLine("push eax");
wow.Asm.AddLine("call {0}", 0x0049AE30);
wow.Asm.AddLine("add esp, 0xC");
wow.Asm.AddLine("retn");
wow.Asm.InjectAndExecute(codecave);
wow.FreeMemory(codecave);
wow.FreeMemory(stringcave);
wow.ResumeThread();
}
This seems like it
should be quite simple and I can't help the nagging feeling that I am missing something obvious. I don't really care about getting return values at this point, just basic commands. If anyone could give my function a looksie, I would really appreciate it.