How n3rdl0rd/crashlink works
Project type and purpose
• This is an open‑source, pure‑Python library and CLI tool (“Swiss Army knife”) for working with HashLink bytecode: parsing, serializing, disassembling, (limited) decompiling, assembling, patching, interpreting, and testing. It also provides a built‑in testing harness (crashtest), auto‑generated documentation, and a small CLI.
File structure
• Top‑level components:
• crashlink/ – the core library (modules: core, asm, disasm, decomp, pseudo, opcodes, interp, errors, globals; __main__.py entry point)
• crashtest/ – the test‑harness CLI (build.py, run.py, models.py, JSON “runs” outputs, Jinja templates for HTML)
• docs/ – generated API docs and static assets (flow.svg, templates, out‑dirs)
• tests/ – unit tests (pytest-based) and Haxe sample files under tests/haxe/ for decompiler validation
• justfile, pyproject.toml, GitHub Actions workflow – build, test, doc generation, CI/CD
• Architectural clues:
• Clear separation between core library, CLI wrappers, test harness, and documentation
• Modular decomposition by functionality (parsing, disassembly, decompilation, pseudo‑code generation, VM interpretation)
• Use of an external command runner (just/uv) and CI (GitHub Actions)
Pull additional insights from the README
• Describes a pipeline: Deserialisation → Disassembly → (future) IR lifting & optimization → Pseudocode targets → (optional) recompilation/patching
• Mentions dependencies: zero pure‑Python core, optional extras (tqdm, graphviz) for progress bars & CFG generation