It's fairly simple. Rather than null terminating their linked list they chose to set it to an 'odd' value. Alignment says this value is invalid.
EnumVisibleObjects() from WoW:
Code:
signed int __cdecl EnumVisibleObjects(int (__cdecl *pCallback)(WGUID, _DWORD), eWOWOBJECTTYPE filter)
{
int v2; // eax@1
int v3; // esi@1
int v4; // ebx@3
eWOWOBJECTTYPE v5; // edi@5
v3 = *(_DWORD *)(*MK_FP(__FS__, 44) + 4 * TlsIndex);
v2 = *(_DWORD *)(*(_DWORD *)(v3 + 8) + 172);
if ( !(v2 & 1) && v2 )
v4 = *(_DWORD *)(*(_DWORD *)(v3 + 8) + 172);
else
v4 = 0;
v5 = filter;
while ( !(v4 & 1) && v4 )
{
if ( !((int (__cdecl *)(_DWORD, _DWORD, eWOWOBJECTTYPE))pCallback)(*(_DWORD *)(v4 + 48), *(_DWORD *)(v4 + 52), v5) )
return 0;
v4 = *(_DWORD *)(v4 + *(_DWORD *)(*(_DWORD *)(v3 + 8) + 164) + 4);
}
return 1;
}
The line of interest there is the while statement. v4 is their iterator. It's anyone's guess why they did it this way.. but they did. Perhaps they use other bits there for something else? It's unimportant.
Bookmarks