REDIVIVUS

Proposals / #1293

Mac D2FILE_ReadFile: void __cdecl (pMemory, D2MPQFileStrc* pFile, void* pBuffer, uint nBytesToRead)

checked · by KierTaylor · submitted 2026-11-06

The caller D2FILE_AllocAndLoadD2File 0x002b6907 stores four slots: [ESP] (the pool, kept from the earlier calls), [ESP+4]=the file handle, [ESP+8]=EBX (the freshly allocated buffer), [ESP+0xc]=EDI (the byte count from D2FILE_GetFileSize). It does not use EAX afterwards (it loads [EBP-0x10] for CloseFile). Same layout and void return as the Windows twin 0x00516f85 (pMemory unused, pFile, pBuffer, nBytesToRead).

Changes 1, applied together

  1. Set prototype mac 0x002b678f

    signatureundefined D2FILE_ReadFile(void)→void D2FILE_ReadFile(D2PoolManagerStrc* pMemory, D2MPQFileStrc* pFile, void* pBuffer, uint nBytesToRead)
    conventionunknown→__cdecl