hlbc-python
A (terrible) Python wrapper for hlbc - A Hashlink bytecode disassembler and decompiler.
Installation
pip install hlbc
Usage
Before running this example, download either the prebuilt bytecode or the source code of the Clazz test file and place the compiled bytecode in the same directory as the script.
import hlbc
# Open and disassemble a file
code = hlbc.Bytecode("./Clazz.hl")
# Get the debug files
print(code.get_debug_files())
# > ['Clazz.hx', 'C:\\HaxeToolkit\\haxe\\std/hl/_std/Std.hx', 'C:\\HaxeToolkit\\haxe\\std/hl/_std/String.hx', ... '?']
# Get all functions from a specific debug file in the bytecode
print(code.get_functions("Clazz.hx"))
# > ['fn main@22 () -> void', 'fn method@23 (Clazz) -> i32', 'fn <none>@337 ((f64, f64) -> i32, i32, i32) -> i32', ...]
# Decompile a single function by index
print(code.decompile("23"))
# > static function method(_: Clazz): Int {
# > return 42;
# > }
# Stub a function
print(code.stub("23"))
# > static function method(_: Clazz): Int {}
Notes
- Any errors will be raised back to Python as simple
Exceptions, but this is subject to change. - The
Bytecodeclass is thread-safe. You can use the same instance multiple times in different threads. It also doesn't hold the file open, so you can create multiple instances of it with the same file.
Credits
Metadata
Release files for hlbc 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hlbc-0.5.0.tar.gz | 28.5 kB | Without provenance | Details for hlbc-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hlbc-0.5.0-cp310-none-win_amd64.whl | CPython 3.10 | none | Windows x86-64 | Details for hlbc-0.5.0-cp310-none-win_amd64.whl |
Total release size: 318.9 kB
Release files / hlbc-0.5.0.tar.gz
| Download URL | hlbc-0.5.0.tar.gz |
|---|---|
| Size | 28.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21c8b0a3bdde506b588094e61ee51789c8e5485b72b70544da6504936f73f815
|
|
BLAKE2b-256 checksum How to use checksums |
279d357b9d2a8848308455725066f8e08e4d27e678616171226ddfa812dd03d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Release files / hlbc-0.5.0-cp310-none-win_amd64.whl
| Download URL | hlbc-0.5.0-cp310-none-win_amd64.whl |
|---|---|
| Size | 290.3 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5feed59051c95c8a7a959c9915f23b2cd50865a29167906a766dc25b2940e300
|
|
BLAKE2b-256 checksum How to use checksums |
cce50be193cacfe2e4f8e918b45b6cde02dabfa52ce78eef213cd3a48a595584
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.7.0
|
Security for hlbc 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.