REDIVIVUS

Proposals / #1388

Recover the paired Kamap loader's Boolean success result

checked · by eejitgames · submitted 2026-11-07

Both UNICODE_LoadKamapFile bodies deliberately produce a full EAX success result despite stored void returns. Windows00527790 has five failure exits with XOR EAX,EAX and one success exit with MOV EAX,1. Mac002b804a merges the same five failures into XOR EAX,EAX at002b82fc and sets EAX1 after success cleanup at002b829e. All returning guard paths preserve EAX; Windows00681a48 is already modelled __stdcall_noclobber and its normal CMP/JNZ/RET path does not write EAX. Recover BOOL results while preserving both existing argument lists and conventions. The sole direct caller on each build discards the result, so this restores the stored contract and callee return expressions; no caller, build or runtime improvement is claimed. Pending1385 covers only Mac version-buffer types, and1386 only the file-loader parent/callee API.

Changes 2, applied together

  1. Set prototype win 0x00527790

    signaturevoid UNICODE_LoadKamapFile(D2PoolManagerStrc * pMemory, char * szFilename)→BOOL UNICODE_LoadKamapFile(D2PoolManagerStrc * pMemory, char * szFilename)
    convention__fastcall
  2. Set prototype mac 0x002b804a

    signaturevoid UNICODE_LoadKamapFile(D2MPQFileStrc * pMPQ, char * szFilename)→BOOL UNICODE_LoadKamapFile(D2MPQFileStrc * pMPQ, char * szFilename)
    convention__cdecl