Return the existing Books table row type from its Windows index lookup
Ghidra v1797 · 3bccb89
Win 006374b0 returns D2BooksTxt* or null, currently void*. It reads the existing D2BooksTableStrc global at 0096cc60, loads its D2BooksTxt* member at +4, and returns base + index*32; rejected indices clear full EAX. Other paths terminate through CRT exit(-1). Constructor 00637320 passes row size 32 and the global count address to CompileTxt, then stores the table base at 0096cc64, its sole write. Existing D2BooksTxt is 32 bytes. All 10 calls across 7 complete caller bodies consume matching fields: icon+2, spell+4, scroll skill+8, book skill+12 and cost per charge+20. Restore that record pointer return, preserving the signed index, chosen name, one stack argument and stdcall RET4. Complete target, producer, accessor, callers and exit chain are decoded from the original Windows PE. Mac return remains held because neither corresponding record nor wrapper type exists there. Static only.
Changes 1, applied together
Set prototype
win 0x006374b0signaturevoid * TXT_Books_GetLine(int32_t nIndex)→D2BooksTxt * TXT_Books_GetLine(int32_t nIndex)convention__stdcall