Gibbed.MadMax-1.5.5
Bug Fixes
Fix: Library modules broken after decompile/recompile
Library modules (lib_*.xvmc) use flags: 0x1 to register their functions as globals so other scripts can call them. This flag was silently dropped during decompilation, causing recompiled library modules to stop working — any script depending on them would fail at runtime.
29 out of 842 game scripts are affected (all lib_*.xvmc files).
The decompiler now emits #! flags: 0x1 automatically, and the compiler preserves it through to the output .xvmc.
Fix: Missing trailing ret 0 sentinel
The compiler omitted the trailing ret 0 when a function's last statement was already a return. This caused the decompiler's CFG builder to lose if blocks whose jump targets pointed past the last instruction.
Fix: break statement and structural analysis
- Added
breakstatement support insidewhileloops - Fixed while-loop exit block causing post-loop code to be absorbed into the loop body
- Fixed elif chains breaking when the merge point coincided with an outer loop exit
Fix: stitem stack order
The decompiler and compiler had the wrong pop/push order for index store operations (obj[idx] = val), producing invalid code for scripts using indexed assignment.
New Directive: #! flags:
The #! flags: directive is emitted automatically by the decompiler for library modules. It is not gated by --hashes because it affects runtime behavior.
| Value | Meaning | Files in game |
|---|---|---|
0x0 |
Standard script | 813 |
0x1 |
Library module | 29 |
Known Differences (non-functional)
Round-tripped files may differ from originals in constant ordering, StringBuffer layout, max_stack values (precise vs over-estimated), and omission of dead-code jmp instructions after ret. All differences are functionally equivalent.