Hey guys! I'm still kind of new here, and I'm learning pretty quick, but there is still alot I don't quite understand yet.
I know how to access memory etc, and I'm successfully getting my player's health, mana, and xyz based on the static player base.
Right now I'm trying to learn how to get information on targets, and this seems alot more complicated.
My impression is that a target NPC is an object, of which there are a few types, such as items, NPCs, Players, corpses etc. It seems that these are stored as structs containing many variables and different data types.
What I don't quite understand is how I use a GUID, and how these relate to an 'objectmanager' which sounds like a linked list of all of the objects and has pointers to the various objects.
This is the code I have for my object structs:
Code:
Func _wowObject() ; misc
Return DllStructCreate( _
"uint staticClientConnection;" & _
"uint DataPTR;" & _
"uint64 GUID;" & _
"uint FirstObject;" & _
"uint NextObject;")
EndFunc ;==>_wowObject
Func _wowUnitObject() ;
Return DllStructCreate( _
"uint64 GUID;" & _
"ptr NextObject;" & _
"dword ObjectType;" & _
"float x;" & _
"float y;" & _
"float z;" & _
"float rot;" & _
"uint64 DescriptorFieldsOffset;")
EndFunc ;==>_wowUnitObject
Func _wowObjectData()
return DllStructCreate ( _
"uint64 charm;" & _
"uint64 summon;" & _
"uint64 critter;" & _
"uint64 charmedBy;" & _
"uint64 summonedBy;" & _
"uint64 createdBy;" & _
"uint64 target;" & _
"uint64 channelObject;" & _
"char bytes0[4];" & _
"uint health;" & _
"uint power1;" & _
"uint power2;" & _
"uint power3;" & _
"uint power4;" & _
"uint power5;" & _
"uint power6;" & _
"uint power7;" & _
"uint maxHealth;" & _
"uint maxPower1;" & _
"uint maxPower2;" & _
"uint maxPower3;" & _
"uint maxPower4;" & _
"uint maxPower5;" & _
"uint maxPower6;" & _
"uint maxPower7;" & _
"float powerRegenFlatModifier[7];" & _
"float powerRegenInterruptedFlatModifier[7];" & _
"uint level;" & _
"uint factionTemplate;" & _
"uint virtualItemSlotDisplay[3];" & _
"uint flags;" & _
"uint flags2;" & _
"uint auraState;" & _
"uint baseAttackTime[2];" & _
"uint rangedAttackTime;" & _
"float boundingRadius;" & _
"float combatReach;" & _
"uint displayID;" & _
"uint nativeDisplayID;" & _
"uint mountDisplayID;" & _
"float minDamage;" & _
"float maxDamage;" & _
"float minOffhandDamage;" & _
"float maxOffhandDamage;" & _
"char bytes1[4];" & _
"uint petNumber;" & _
"uint petNameTimestamp;" & _
"uint petExperience;" & _
"uint petNextLevelExp;" & _
"uint dynamicFlags;" & _
"uint channelSpell;" & _
"float modCastSpeed;" & _
"uint createdBySpell;" & _
"uint npcFlags;" & _
"uint npcEmoteState;" & _
"uint Stat0;" & _
"uint Stat1;" & _
"uint Stat2;" & _
"uint Stat3;" & _
"uint Stat4;" & _
"uint PosStat0;" & _
"uint PosStat1;" & _
"uint PosStat2;" & _
"uint PosStat3;" & _
"uint PosStat4;" & _
"uint NegStat0;" & _
"uint NegStat1;" & _
"uint NegStat2;" & _
"uint NegStat3;" & _
"uint NegStat4;" & _
"uint resistances[7];" & _
"uint resistanceBuffModsPositive[7];" & _
"uint resistanceBuffModsNegative[7];" & _
"uint baseMana;" & _
"uint baseHealth;" & _
"char bytes2[4];" & _
"uint attackPower;" & _
"int attackPowerMods;" & _
"float attackPowerMultiplier;" & _
"uint rangedAttackPower;" & _
"int rangedAttackPowerMods;" & _
"float rangedAttackPowerMultiplier;" & _
"float minRangedDamage;" & _
"float maxRangedDamage;" & _
"uint powerCostModifer[7];" & _
"float powerCostMultiplier[7];" & _
"float maxHealthModifier;" & _
"float HoverHeight;" & _
"uint padding;" )
EndFunc
* Please forgive some of the random spacing, the code didn't copy well.
I understand that these are outdated, and I am confident I can update the information in _wowObjectData to the correct information using the information at wow-3-3-2-info-dump-thread.
I cannot find anything that is equivalent to either _wowObject or _wowUnitObject. Can anyone provide some insight into this? My guess is that _wowObject is related to
Code:
public enum ObjectManager
{
CurMgrPointer = 0x00C93410, // 3.3.2
CurMgrOffset = 0x2E04, // 3.3.2
localGuidOffset = 0xC0, // 3.3.2
firstObjectOffset = 0xAC, // 3.3.2
nextObjectOffset = 0x3C, // 3.3.2
}
from the same thread, but I am not sure. I also don't know how to translate those offsets into datatypes if in fact it is the same.
Here is a selection of my code for traversing the object manager:
Code:
Func _getObjectOffset($objectCondition)
_ReadProcess($wowProcessHwnd, $baseObjectPTR + 0x2E04, $buffer_ptr)
$currentObject = DllStructGetData($buffer_ptr, 1)
$wowObject = _wowObject()
$wowObjectData = _wowObjectData()
$guid = 0
$next = 0
While ($currentObject <> 0 And Mod(Number($currentObject), 2) == 0)
_ReadProcess($wowProcessHwnd, $currentObject, $wowObject)
$guid = DllStructGetData($wowObject, 'GUID')
$next = DllStructGetData($wowObject, 'NextObject')
$data = DllStructGetData($wowObject, 'DataPTR')
Switch ($objectCondition)
Case $C_PLAYER
If ($guid == $playerID) Then
_ReadProcess($wowProcessHwnd, $currentObject, $player)
_ReadProcess($wowProcessHwnd, $data, $playerData)
Return $currentObject
EndIf
EndSwitch
$currentObject = $next
WEnd
EndFunc ;==>_getObjectOffset
Your help and patience are greatly appreciated.