REDIVIVUS

Proposals / #686

ADPCM decompression uses byte inputs and scalar length outputs

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

Ghidra v1797 · 3bccb89

The mono/stereo wrappers' EDX argument points to one uint32_t capacity/result, not short**. Each loads its DWORD as the decoder's unsigned byte capacity, then stores the returned byte distance. The full decoder returns EBX-outputStart at its sole epilogue and advances output by two bytes per sample. The table dispatcher passes a DWORD local in EDX and uses the result as the next stage's byte count. The wrappers' Stack[4] and decoder's Stack[8] are input byte-buffer addresses: the core reads header bytes, 16-bit initial samples and subsequent byte codes within a byte end pointer. Retype only these five existing argument slots. Preserve all names, returns, conventions and storage, including the decoder's custom ECX/EAX parameters. Its incorrectly pointer-typed return is intentionally held; no set_prototype is used. All table refs, the full dispatcher and its two producer bodies were inspected. Static original Windows proof only.

Changes 5, applied together

  1. Retype variable win 0x0041e3a0 EDX

    typeshort * *→uint32_t *
  2. Retype variable win 0x0041e400 EDX

    typeshort * *→uint32_t *
  3. Retype variable win 0x0041e3a0 Stack[0x4]

    typeint32_t→uint8_t *
  4. Retype variable win 0x0041e400 Stack[0x4]

    typeint32_t→uint8_t *
  5. Retype variable win 0x0041dce0 Stack[0x8]

    typeint32_t→uint8_t *