For those interested in some more details, here you are:
Code:
<Pattern desc="GetUnitAura" pattern="\x55\x8B\xEC\x8B\x81\xB0\x0D\x00\x00\x83\xF8\xFF\x75\x08\x8B\x91\x34\x0C\x00\x00\xEB\x02\x8B\xD0\x8B\x45\x08\x3B\xC2" mask="xxxxx????xxxxxxx????xxxxxx?xx" />
Code:
struct AURA
{
WGUID creatorGuid; // 0x00 - 0x07
unsigned long auraId; // 0x08 - 0x0B
unsigned long unk1; // 0x0C - 0x0F
unsigned long unk2; // 0x10 - 0x13
unsigned long endTime; // 0x14 - 0x17
};
AURA *CGUnit_C::GetAura(const int dwIndex)
{
unsigned long dwGetUnitAura = gpWoWX->GetFindPattern()->GetAddress( "GetUnitAura" );
_asm
{
mov ecx, this
push dwIndex
call dwGetUnitAura
mov dwGetUnitAura, eax
}
return (AURA *)(dwGetUnitAura);
}
Note that since this is an array, as opposed to some sort of linked list structure, once an aura expires or is removed, in its place in memory will be an aura with id 0.
Code:
CGUnit_C *target;
AURA *aura;
if (!(target = gpWoWX->GetCurMgr()->GetObjectByGUID(gpWoWX->GetCurMgr()->GetLocalPlayer()->GetTarget())->GetUnit()))
target = gpWoWX->GetCurMgr()->GetLocalPlayer()->GetUnit();
for (int i = 0; 1; i++)
{
if (!(aura = target->GetAura(i)))
break;
if (!aura->auraId)
continue;
DBGLOG("Aura #" << std::dec << i << " ID: " << aura->auraId << " Creator GUID: 0x" << std::hex << aura->creatorGuid.ullGuid <<
" Ticks remaining: 0x" << (DWORD)(aura->endTime - GetTickCount()));
}
Those two unknown fields appear to be some sort of flags, probably to tell you thinks like whether they're dispellable or positive/negative or whatever, but I haven't looked into it as it's not relevant to my purposes at this time.