As a little example of how easy life can be being injected I got a little snippet for you:
/// <summary>
/// Set the target by guid
/// </summary>
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void SetTargetDelegate(ulong guid);
private static SetTargetDelegate SetTargetFunction;
internal static void SetTarget(ulong parGuid)
{
if (SetTargetFunction == null)
SetTargetFunction = Memory.Reader.RegisterDelegate<SetTargetDelegate>((IntPtr)0x493540);
SetTargetFunction(parGuid);
}
VS
internal static void SetTarget(UInt64 guid)
{
lock (Call_Lock)
{
byte[] guidBytes = BitConverter.GetBytes(guid);
String[] asm = new String[]
{
"push " + BitConverter.ToInt32(guidBytes, 4),
"push " + BitConverter.ToInt32(guidBytes, 0),
"call " + (uint)0x493540,
"retn",
};
//Console.WriteLine(DateTime.Now.ToString("HH:mm:ss") + " Calling Set Target");
Inject.InjectAndExecute(asm, true);
}
}
There is no more dealing with calling conventions beside telling your program which one to use. Functions are much easier to detour and in general every aspect of interacting with WoW will be easier and cleaner. For example I run my whole bot logic inside the DirectX Endscene now Instead of injecting new ASM for each function I want to call.
Personally I dodged going injected for a long time because I was to lazy to learn how to do it but afterall I can only advice it to everyone who downloaded my previous bot and started with the same bullshit I did.
Once I find a few days I will start explaining how to be inprocess using C# and also continue a few things like the WoW hacking tutorials I started to write previously but stopped somewhere inbetween. If you want to try your luck I can advice IceFlake by Miceiken from Ownedcore which was a very big help getting started. Thanks to Miceiken at this point :).