And to give back just a little bit.
Here's the c++ code that reads the spell table in x64.
Code:
struct Offsets
{
static const intptr_t UnitAuraCount = 0x2320;
static const intptr_t UnitAuraTable= 0x1CA0;
};
CurrentObjectList[guid].m_SpellsActive.clear();
uint32_t AuraCount = wowProcess.ReadMemory<intptr_t>(entity + Offsets::UnitAuraCount);
uint32_t AuraTablePtr = entity + Offsets::UnitAuraTable;
uint32_t RealAuraCount = 0;
if (AuraCount == 0xFFFFFFFF)
{
RealAuraCount = wowProcess.ReadMemory<uint32_t>(AuraTablePtr);
}
else
{
RealAuraCount = AuraCount;
}
while (1)
{
intptr_t temp = RealAuraCount--;
if (!temp)
{
break;
}
intptr_t AuraTableOffset = RealAuraCount * 104;
intptr_t AuraRecordPtr = 0;
if (AuraCount == 0xffffffff)
{
AuraRecordPtr = wowProcess.ReadMemory<intptr_t>(AuraTablePtr + 8) + AuraTableOffset;
}
else
{
AuraRecordPtr = AuraTablePtr + AuraTableOffset;
}
uint32_t spellid = wowProcess.ReadMemory<uint32_t>(AuraRecordPtr + 80);
if (spellid > 0)
{
CurrentObjectList[guid].m_SpellsActive.push_back(spellid);
}
}
CurrentObjectList[guid].m_AuraCount = CurrentObjectList[guid].m_SpellsActive.size();
Notice that I haven't yet thrown in the structure to get all spell data. This is mostly test code and hasn't been integrated into the actual bot read functions yet. (Edit: that 80 in there is the spellID offset within the spell structure)