#decompiling #lua #script #emit #hcb #hcb2lua

app hcb2lua_decompiler

A decompiler for HCB scripts to Lua

1 unstable release

0.1.0 Jan 29, 2026

#3 in #decompiling

MPL-2.0 license

58KB
1.5K SLoC

hcb2lua

A standalone first-pass HCB bytecode decompiler that emits Lua.

Build

cargo build --release

Run

./target/release/hcb2lua_decompiler --input /path/to/script.hcb --output script.lua --lang sjis

Notes

  • The generated Lua targets Lua 5.3+ (uses bitwise operators for BitTest).
  • Call/Syscall store their return value in __ret; PushReturn pushes __ret onto the value stack.
  • Syscalls are emitted as __syscall("Name", ...) stubs.

Dependencies

~7.5MB
~204K SLoC