REDIVIVUS

Proposals / #999

SKILLDESC_FormatSignedRangeOrValue and SKILLDESC_FormatMinMaxRange return BOOL (0/1), not void

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

Ghidra v1846 · 842c624

SKILLDESC_FormatSignedRangeOrValue 004e7e70 sets EAX on both exits: 004e7e76 XOR EAX,EAX (EAX then zero-fills the buffer), 004e7e78 TEST ECX,ECX / 004e7eaa JNE / 004e7eaf RET 0xC returns 0 when nValue is 0; the normal exit is 004e7f26 MOV EAX,1 / 004e7f2e RET 0xC. SKILLDESC_FormatMinMaxRange 004e7f40 returns that value on its nMinVal == nMaxVal path (004e7f52 CALL 0x004e7e70 / 004e7f57 POP ESI / 004e7f5b RET 8, EAX untouched in between); its normal exit is 004e800c MOV EAX,1 / 004e8015 RET 8. The callers at 004ec52b, 004ede3d and 004e8032 ignore the value, consistent with an unused BOOL. Same shape as SKILLDESC_FormatSignedValue 004e79e0 void -> BOOL. Return type only; both keep their register parameter storage. Recompiled with VC8 both functions then match byte for byte.

Changes 2, applied together

  1. Set prototype win 0x004e7e70

    signaturevoid SKILLDESC_FormatSignedRangeOrValue(int32_t nValue, uint16_t nPrefixLabelId, uint16_t nSuffixLabelId, int32_t bPrefixSign, WCHAR * wszText)→BOOL SKILLDESC_FormatSignedRangeOrValue(int32_t nValue, uint16_t nPrefixLabelId, uint16_t nSuffixLabelId, int32_t bPrefixSign, WCHAR * wszText)
    convention__stdcall
  2. Set prototype win 0x004e7f40

    signaturevoid SKILLDESC_FormatMinMaxRange(int32_t nMinVal, int32_t nMaxVal, WCHAR * wszText, int32_t bPrefixSign, uint16_t nPrefixLabelId, uint16_t nSuffixLabelId)→BOOL SKILLDESC_FormatMinMaxRange(int32_t nMinVal, int32_t nMaxVal, WCHAR * wszText, int32_t bPrefixSign, uint16_t nPrefixLabelId, uint16_t nSuffixLabelId)
    convention__stdcall