ADPCM decompression uses byte inputs and scalar length outputs
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
Retype variable
win 0x0041e3a0 EDXtypeshort * *→uint32_t *Retype variable
win 0x0041e400 EDXtypeshort * *→uint32_t *Retype variable
win 0x0041e3a0 Stack[0x4]typeint32_t→uint8_t *Retype variable
win 0x0041e400 Stack[0x4]typeint32_t→uint8_t *Retype variable
win 0x0041dce0 Stack[0x8]typeint32_t→uint8_t *