My currently working code is almost the same, although you are not using the GUID mask in order to select the correct linked list. Look at nameMaskOffset and the offset variable calculation using mask and shortGUID:
Code:
class RE_Data
{
public:
static const unsigned long nameStorePtr = 0x00C76018 + 0x8;
static const unsigned long nameMaskOffset = 0x024;
static const unsigned long nameBaseOffset = 0x01c;
static const unsigned long nameStringOffset = 0x020;
}
bool ProgHelper::getPlayerName(const GUID guid, QString * const nome)
{
unsigned long mask, base, offset, current, shortGUID, testGUID;
if (C.peek(RE_Data::nameStorePtr + RE_Data::nameMaskOffset, &mask) and C.peek(RE_Data::nameStorePtr + RE_Data::nameBaseOffset, &base))
{
shortGUID = guid & 0xffffffff; // Only half the guid used to check for a cache hit
if (mask == 0xffffffff) {*nome = ""; return false;}
offset = 12 * (mask & shortGUID); // select the appropriate linked list
C.peek(base + offset + 8, ¤t); // first element
if (!C.peek(base + offset, &offset)) {*nome = ""; return false;} // offset for the next element
if (current == 0 or (current & 0x1)) {*nome = ""; return false;}
if (!C.peek(current, &testGUID)) {*nome = ""; return false;}
while (testGUID != shortGUID)
{
C.peek(current + offset + 4, ¤t);
if (current == 0 or (current & 0x1)) {*nome = ""; return false;}
if (!C.peek(current, &testGUID)) {*nome = ""; return false;}
}
return C.peekQString(current + RE_Data::nameStringOffset, nome);
}
*nome = ""; return false;
}
Your code might work under limited circunstances, but should break depending on the GUID of the player you are trying to search the name for.