REDIVIVUS

Proposals / #1390

D2HuffmanContextStrc.aQuickTable (+0x3474) holds 0x80 three-dword entries (uint32_t[384])

checked · by Nugwa628 · submitted 2026-11-07

The quick table is 0x80 entries of 0xc bytes (the field comment already says so). HUFFMAN_ConstructorWithTable clears it: 0041f958 LEA EAX,[ESI+0x3474] / MOV ECX,0x80 / MOV dword ptr [EAX],0 / ADD EAX,0xc / SUB ECX,1 / JNZ, ending at 0x3474+0x600 = 0x3a74. HUFFMAN_DecodeSymbol indexes it in 3-dword steps: 0041ecec LEA ECX,[EAX+EAX*2] / 0041ecef LEA ECX,[EBX+ECX*4+0x347c]. SCOMP_HuffmanDecompress keeps the context on the stack with a 0x3a80 frame (0041f9e3 MOV EAX,0x3a80; 0041f9ff LEA ECX,[EBP-0x3a80]; CALL 0041f950) = 0x3a74 bytes plus the 0xc list head. As uint32_t[96] the struct is 0x35f4 and the frame 0x3600. VC8 oracle on main 92f67c4: SCOMP_HuffmanDecompress 0041f9e0 INSN_MATCH -> MATCH, +1 MATCH, 0 lost.

Changes 1, applied together

  1. Struct field win D2HuffmanContextStrc + 0x3474

    typeuint32_t[96]→uint32_t[384]