REDIVIVUS

Proposals / #1292

Mac D2FILE_GetFileSize: DWORD __cdecl (pMemory, D2MPQFileStrc* pFile, DWORD* pFileSizeOut)

checked · by KierTaylor · submitted 2026-11-06

The Mac body reads [EBP+0xc] (pFile: halts on line 0x59 if NULL, then is passed to the Storm size call) and [EBP+0x10] (the high-size out pointer, forwarded as its 2nd arg). The size is kept in EDI, halts on line 0x5f if it is 0, and is returned in EAX (MOV EAX,EDI) with a plain RET. [EBP+8] is the unused pool slot, as in the Windows twin 0x00516eab (pMemory ECX unused; DWORD return used by AllocAndLoadD2File as the allocation size). LPDWORD is written DWORD* for the Mac DB.

Changes 1, applied together

  1. Set prototype mac 0x002b661f

    signatureundefined D2FILE_GetFileSize(void)→DWORD D2FILE_GetFileSize(D2PoolManagerStrc* pMemory, D2MPQFileStrc* pFile, DWORD* pFileSizeOut)
    conventionunknown→__cdecl