REDIVIVUS

Proposals / #1031

HireMercFromNpc's nNameFirst and nNameLast are ints: the hireling name range is walked with JG/JLE

applied · by Niehztog · submitted 2026-11-02, applied 2026-11-02

Ghidra v1841 · 4ca0e98

nNameFirst ([EBP-0x18] = Stack[-0x1c]) and nNameLast ([EBP-0x28] = Stack[-0x2c]) are loaded from the hireling.txt row and compared signed both times: 00579245 CMP ECX,EDX ... 00579250 MOV [EBP-0x18],ECX / 00579253 JG (skip when first > last), and the loop end 00579285 ADD [EBP-0x18],1 ... 00579295 CMP [EBP-0x18],EDI (EDI = [EBP-0x28]) / 00579298 JLE. Ghidra leaves both undefined4 and resolves them to uint, so the generator declares uint32_t and the guard comes out unsigned (JA). Recompiled with VC8 SP1 (the 1.14d compiler) on main f26206a with both as int: the guard is the original's JG and no conditional jump in the function differs in condition any more; no function in the TU changes status.

Changes 2, applied together

  1. Retype variable win 0x00579180 Stack[-0x1c]

    typeundefined4→int
  2. Retype variable win 0x00579180 Stack[-0x2c]

    typeundefined4→int