REDIVIVUS

Proposals / #724

Type UI_AppendColorCodeToString wide input and next-line output

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

Ghidra v1804 · 39698f0

The complete84-byte function accepts a writable WCHAR string in ECX and an output WCHAR** in EDX. It saves the output address in EBX and writes a null pointer, saves the input in EDI/ESI, calls wide strlen, scans WORDs with a2-byte stride, replaces newline0xA with a WORD NUL, then on success writes the following WCHAR address through EBX. Failure returns0 with null output; success returns1. Both callers pass wide buffers and addresses of pointer slots, then draw the returned second line through an existing WCHAR* text consumer. Full target, both caller ranges and wide strlen match original Windows bytes; the skill caller’s complete two-target switch/nine-byte selector map and all four input reaching definitions were checked. Retype only pWszString void* to WCHAR* and pNextLineOut void* to WCHAR**. Preserve chosen names, ECX/EDX storage, fastcall and int return; both exits are bare RET. No rename, shared layout or runtime/build claim.

Changes 2, applied together

  1. Retype variable win 0x004a7660 ECX

    typevoid *→WCHAR *
  2. Retype variable win 0x004a7660 EDX

    typevoid *→WCHAR * *