| Crates.io | hlbc-cli |
| lib.rs | hlbc-cli |
| version | 0.7.0 |
| created_at | 2022-05-21 15:22:30.85071+00 |
| updated_at | 2023-11-16 21:24:55.266773+00 |
| description | Hashlink bytecode disassembler, analyzer and decompiler cli |
| homepage | |
| repository | https://github.com/Gui-Yom/hlbc |
| max_upload_size | |
| id | 590763 |
| size | 69,983 |
Hashlink bytecode disassembler, decompiler and analyzer command line interface.
This crate is a program, see hlbc for the core bytecode library or hlbc-decompiler for the decompiler library

Download a prebuilt binary from the releases page (built from the CI, Windows & Linux).
Or build from the latest version :
cargo install hlbc-cli
Or build the crate from the latest sources :
git clone https://github.com/Gui-Yom/hlbc
cd hlbc-cli
cargo build --release
# The resulting binary can be found in ../target/release
hlbc <file> [-c <command>] [-w <command>]
You get access to a prompt where you can enter commands.
You can execute commands on startup with the -c switch.
e.g. Dump all strings from the bytecode then exit : hlbc main.hl -c "s ..; exit".
If you omit the exit command, the app will simply launch the normal prompt after executing the startup commands.
With -w, the given command will execute each time the file changes. The cli won't show a command prompt.
You can also pass a .hx file containing Haxe source code directly to be compiled on the fly if the haxe compiler is
present in the PATH.
exit Exit the programhelp Help messageexplain <op> Get information about an opcodewiki Open the bytecode wiki page in a browserinfo General information about the bytecodeentrypoint Get the bytecode entrypointi|int <idx> Get the int at indexf|float <idx> Get the float at indexs|string <idx> Get the string at indexsstr <str> Find a stringd|debugfile <idx> Get the debug file name at indexsfile <str> Find the debug file namedt|type <idx> Get the type at indexg|global <idx> Get global at indexc|constant <idx> Get constant at indexn|native <idx> Get native at indexfnh <findex> Get header of function (findex)fn <findex> Get function (findex)sfn <str> Get function namedinfile <idx|str> Find functions in filefileof <findex> Get the file where findex is definedrefto <any@idx> Find references to a given bytecode elementsaveto <filename> Serialize the bytecode to a filecallgraph <findex> <depth> Create a dot call graph from a function and a max depthdecomp <findex> Decompile a functiondecompt <idx> Decompile a classIn most of the commands that accept an index, you can pass a Rust style range too : a..b, ..b, a.., a..=b, ...
Where ..10 means 'select the first 10 items' and .. means 'display everything'.
The decompiler has its own crate ! More info here.
See CHANGELOG.md.
A wiki detailing the specifics of Hashlink bytecode is available here or by
using the command wiki.
fn (entrypoint) to display the
entry function or refto (sstr Hello)