Hi guys,
I'm trying to read the units name. As for the NPC's, it was easy, for the players is a quiet hard...
So I've read some threads explaining how to get the player's name.
The most of them, I don't really understand the code but what I've understand is the player's name are stocked in something called "cache" and fetches with the GUID (reduced).
We have so to browse the linked list of the matchings ShortedGUID <=> PlayerName to find out the needed player name.
Correct me if I'm wrong.
By the way if anybody can talk more about this "DBC" cache... How do yo how guys find how to read players name, use the cache... ?
So now the code I've found and tried to edit
Code:
public static string PlayerNameFromGuid(ulong Guid)
{
uint nameStorePtr = 0xC03D58 + 0x8; // Player name database
uint nameMaskOffset = 0x024; // Offset for the mask used with GUID to select a linked list
uint nameBaseOffset = 0x18; // Offset for the start of the name linked list
uint nameStringOffset = 0x21; // Offset to the C string in a name structure
ulong mask, base_, offset, current, shortGUID, testGUID;
mask = m_WoWMemory.ReadUInt64((uint)m_WoWProcess.MainModule.BaseAddress + nameStorePtr + nameMaskOffset);
base_ = m_WoWMemory.ReadUInt64((uint)m_WoWProcess.MainModule.BaseAddress + nameStorePtr + nameBaseOffset);
shortGUID = Guid & 0xffffffff;
offset = 12 * (mask & shortGUID);
current = m_WoWMemory.ReadUInt64((uint)base_ + (uint)offset + 0x8);
offset = m_WoWMemory.ReadUInt64((uint)base_ + (uint)offset);
if ((current & 0x1) == 0x1)
return "Unknwown1";
testGUID = m_WoWMemory.ReadUInt64((uint)current);
while (testGUID != shortGUID)
{
current = m_WoWMemory.ReadUInt64((uint)current + (uint)offset + 0x4);
if ((current & 0x1) == 0x1)
return "Unknown2";
testGUID = m_WoWMemory.ReadUInt64((uint)current);
}
return m_WoWMemory.ReadASCIIString((uint)(current + nameStringOffset), 30);
}
I'm using BlackMagin as memory reader.
So when I try this function, I have only "Unknwown[1|2]' as player name..