REDIVIVUS

Proposals / #748

Recover the full Boolean result of the Mac body-slot placement wrapper

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

Ghidra vmac 109 · 39698f0

The complete65-byte wrapper returns full EAX=0 for invalid inventory/body location, otherwise forwards the placement helper result unchanged. The complete799-byte placement helper has one EAX return loaded from a local status slot; control-flow reaching definitions prove only its literal0 initialization or literal1 success store can reach that load. Intermediate arithmetic reuse of the slot is overwritten before every return. Thus every wrapper result is full32-bit0/1, matching existing4-byte BOOL and Windows0063bdb0. All14 incoming code calls and the sole non-executable LINKEDIT ref are accounted for. Change only undefined4 to BOOL, preserving all three existing parameters, their names, cdecl and stack positions. Complete original bodies and Windows bytes checked; no placement-helper prototype, shared layout, caller, runtime or matching change.

Changes 1, applied together

  1. Set prototype mac 0x00168414

    signatureundefined4 INVENTORY_GetItemAtBodyLoc(D2InventoryStrc * pInventory, D2UnitStrc * pUnit, int32_t eBodyLoc)→BOOL INVENTORY_GetItemAtBodyLoc(D2InventoryStrc * pInventory, D2UnitStrc * pUnit, int32_t eBodyLoc)
    convention__cdecl