REDIVIVUS

Proposals / #1121

D2FILE_CreateProcess returns bool, not void

checked · by Nugwa628 · submitted 2026-11-03

Both exits set AL to a constant: 00516dbd CALL dword ptr [CreateProcessA] / 00516dc3 TEST EAX,EAX / 00516dc5 JNZ 0x00516dcb / 00516dc7 XOR AL,AL / 00516dc9 JMP 0x00516ddd (failure: AL = 0); 00516dcb PUSH dword ptr [EBP-0x10] / 00516dd4 CALL ESI (CloseHandle) / 00516dd6 PUSH dword ptr [EBP-0xc] / 00516dd9 CALL ESI / 00516ddb MOV AL,0x1 (success: AL = 1); 00516ddd POP EDI / 00516dde POP ESI / 00516ddf LEAVE / 00516de0 RET. Only AL is written (upper EAX is CloseHandle's/CreateProcessA's leftover), so the return is a 1-byte bool. A void function has no XOR AL,AL / MOV AL,1 on its exits. The one caller ignores it (00405c12). VC8 oracle on main a0c71b0 (D2Hell /O1): 00516d8b OUR-3 -> MATCH, +1, 0 lost.

Changes 1, applied together

  1. Set prototype win 0x00516d8b

    signaturevoid D2FILE_CreateProcess(LPCSTR szText)→bool D2FILE_CreateProcess(LPCSTR szText)
    convention__fastcall