@ImogenOC: Just to avoid any confusion, no PQR didn't have to stay up to run. It ran all of the code at once and then left the WoW process alone and unaltered. The only time it would touch WoW was when a rotation was started or stopped.
@DarkLinux:
My primary memory editing class:
[C#] using System; using System.Collections.Generic; using System.Text; using Magi - Pastebin.com
Not the prettiest code in the world, but it worked for my needs. Keep in mind this code was written 2.5+ years ago, so some of the terminology I may have used back then may not have been proper. Memory editing was a new world to me, and much of what I did back then was an amalgamation of things I learned on this forum and elsewhere. :P
I don't know the exact address that was used in the current build (I used a pattern), so if interested:
public static string DetourMask = "xxxxxxxxxxxxxxxx";
public static byte[] DetourOverWritten = { 0x55, 0x8b, 0xec, 0x81, 0xec, 0x94, 0, 0, 0 };
public static byte[] DetourPattern = { 0x55, 0x8B, 0xEC, 0x81, 0xEC, 0x94, 00, 00, 00, 0x83, 0x7D, 0x14, 00, 0x56, 0x8B, 0x75 };
Code:
clsMemory.Memory.DetourAddress = clsMemory.Memory.BlackMagic.FindPattern(clsMemory.DetourPattern, clsMemory.DetourMask) - (uint)clsMemory.Memory.BlackMagic.MainModule.BaseAddress;
Just called ApplyDetour ->
Lua_GetReturnValue -> RestoreDetour.
Lua_GetReturnValue was called with the following LUA code: [Lua] if PQR_Addon_Loaded == nil then PQR_Addon_Loaded = true --PQR --These are - Pastebin.com and an array (formatted in lua) of each rotation that was defined in the outside application, in the following format.
PQR[i].priorityTable = {}
PQR[i].priorityTable.index = {}
PQR[i].priorityTable.ability = {}
PQR[i].priorityTable.spellid = {}
PQR[i].priorityTable.target = {}
PQR[i].priorityTable.actions = {}
PQR[i].priorityTable.lua = {}
PQR[i].priorityTable.recast = {}
PQR[i].priorityTable.delay = {}
PQR[i].priorityTable.cancelChannel = {}
PQR[i].priorityTable.skipUnknown = {}
PQR[i].priorityTable.requireCombat = true
Nothing too fancy.