REDIVIVUS

Proposals / #736

FindMPQOnCd returns a Storm archive through its output pointer

applied · by Commit-Will · submitted 2026-11-01, applied 2026-11-02

Ghidra v1804 · 39698f0

Stack[0xc] ppArchive points to one D2ArchiveStrc* output, not int*. The complete helper forwards the unchanged address to SFileOpenArchive in both path attempts. The complete producer allocates 0x25c bytes, initializes the existing D2ArchiveStrc fields, and its internal opener stores that same record pointer through the supplied output address. The sole caller passes the address of its reused local handle slot; its caller stores the result in existing D2FogArchiveStrc::hArchive. Retype only this helper's output slot to D2ArchiveStrc**. Preserve all names, other arguments, the ESI path-buffer parameter, stdcall, int result and RET 0xc. The intermediate helper's custom return remains untouched. Full target/caller/producer bodies and existing object layouts were checked against original bytes.

Changes 1, applied together

  1. Retype variable win 0x00517128 Stack[0xc]

    typeint * *→D2ArchiveStrc * *