REDIVIVUS

Proposals / #1108

NPCMENU_OpenInteractionDialog's wGoldCostWChar is a 10-wchar buffer, not 20 bytes

checked · by dtchitt · submitted 2026-11-03

The local at Stack[-0x2c] is typed byte[20], so the generated source casts it to uint16_t * at each of its four string calls. It is a wide string buffer: the code clears its first element with a word store (004b4aee MOV word ptr [EBP-0x28],BX), fills it through STRING_CopyCharToWCharWithSetMaxSize, whose destination is uint16_t * (004b4b24 LEA ECX,[EBP-0x28]; call at 004b4b27), appends it with AppendToBuffer's uint16_t * source (004b4b2c LEA EDX,[EBP-0x28]; call at 004b4b35), and initialises it with CONTAINER_InitializeBuffer(buffer, 2, 10, ...), element size 2 and count 10 (call at 004b4bc6). Its own name already says wchar. Same 20 bytes, so the frame does not move.

Changes 1, applied together

  1. Retype variable win 0x004b4830 Stack[-0x2c]

    typebyte[20]→uint16_t[10]