I'm having a few issues with injecting to cast a spell. This piece of code is not even putting the asm into the WOW.exe process. I don't see why it's not, seeing that everyone else does this fine.
Code:
g_clientCon = magic.ReadUInt(0x11CB310);
s_curMgr = magic.ReadUInt(g_clientCon + 0x28A4);
codecave = magic.AllocateMemory(0x1000);
if (g_clientCon == 0)
return;
magic.Asm.Clear();
magic.Asm.AddLine("retn");
magic.WriteUInt(codecave, (uint)1000);
magic.Asm.Inject(magic.ProcessHandle, codecave);
uint value = magic.ReadUInt(codecave);
MessageBox.Show(value.ToString());
Here's even a shortened down version of what I had, doesn't do the same thing but has the same result. I'm having no problems doing standard Reads/Writes. It looks like BlackMagic.Asm doesn't want to write to the process, but I'm not sure why. I thought all of the ProcessHandle setting etc. was handled inside the constructors... I even tried just assembling it with the Asm subclass and writing it with the original BlackMagic class. Still no working.