REDIVIVUS

Proposals / #1457

Mac SFILE_Decrypt: void __fastcc (uint* pData ECX, uint32_t nByteLen EDX, uint32_t nSeed)

checked · by KierTaylor · submitted 2026-11-08

The MPQ block decrypt. ECX = the dword buffer (XORed in place, stepping by 4). EDX = the length in bytes (SHR EDX,2 gives the dword count). [EBP+8] = the seed (key, rotated with 0x11111111 / 0xeeeeeeee using the crypt table at +0x1000). Plain RET, and nothing loads EAX. The caller SFILE_s_OpenArchive 0x00014855 sets ECX, EDX and [ESP]=seed. Same roles as Windows twin 0x004152d0 (nSeed, pData, nByteLen), in Mac register order.

Changes 1, applied together

  1. Set prototype mac 0x00014d7d

    signatureundefined SFILE_Decrypt(void)→void SFILE_Decrypt(uint* pData, uint32_t nByteLen, uint32_t nSeed)
    conventionunknown→__fastcc