2 different approaches cause the same error:
This application has encountered a critical error:
ERROR #134 (0x85100086) Fatal Condition
WoWBuild: 12340
Code:
//GGGameUI_Target 3.3.5 0x00524BF0
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void SelectUnitDelegate(ulong guid);
public static SelectUnitDelegate SelectUnit;
Code:
uint codeCave = wow.AllocateMemory(0x108);
wow.WriteUInt64(codeCave + 0x100, guid);
wow.Asm.Clear();
wow.Asm.AddLine("MOV EAX, [0x{0}]", (codeCave + 0x100 + 0x4).ToString("X"));
wow.Asm.AddLine("PUSH EAX");
wow.Asm.AddLine("MOV EAX, [0x{0}]", (codeCave + 0x100 + 0x0).ToString("X"));
wow.Asm.AddLine("PUSH EAX");
wow.Asm.AddLine("CALL 0x00524BF0");
wow.Asm.AddLine("ADD esp, 0x08");
wow.Asm.AddLine("RETN");
wow.Asm.InjectAndExecute(codeCave);