| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A Rust disassembler for raw machine code, object-backed binaries, symbol-scoped inspection, and conservative semantic analysis.
Built for low-friction terminal workflows, deterministic verification, and evidence-backed output rather than decompiler theater.
assembler is a command-line disassembly frontend implemented in Rust.
It:
It is intentionally not a decompiler, source reconstructor, symbolic executor, or exploitability oracle.
cargo build --releasecargo install --path .assembler [FILE] [OPTIONS]
assembler --raw-hex <HEX> --arch <ARCH> [OPTIONS]
The CLI operates in two disjoint input modes:
| Mode | Trigger | Decode source |
|---|---|---|
| File mode | positional FILE | section and symbol data from object metadata |
| Raw-byte mode | --raw-hex <HEX> | direct decode of user-provided bytes |
Raw-byte mode requires --arch because there is no container metadata to infer decode mode safely.
| Flag | Meaning |
|---|---|
| --arch <x86|x86-64|arm|thumb|aarch64> | force architecture or override file-mode auto detection |
| --symbol <NAME> | restrict file disassembly to one or more symbol names |
| --section <NAME> | restrict file disassembly to one or more section names |
| --all-sections | disassemble every non-empty section instead of executable sections only |
| --syntax <intel|att> | x86/x86_64 syntax selection |
| --render <auto|pretty|plain> | layout selection |
| --color <auto|always|never> | ANSI color control |
| --output <text|json> | human-readable output or structured JSON |
| --analyze | append semantic analysis output |
| --analyze-exit-code | return exit code 1 when analysis findings exist |
| --base-address <ADDR> | override base address for raw-byte decoding |
cargo run -- --helpcargo run -- --raw-hex "55 48 89 e5 5d c3" --arch x86-64cargo run -- ./target/debug/assembler --symbol maincargo run -- ./target/debug/assembler --section .text --section .initcargo run -- --raw-hex "55 48 89 e5 5d c3" --arch x86-64 --render pretty --color nevercargo run -- --raw-hex "55 48 89 e5 5d c3" --arch x86-64 --render plain --color alwayscargo run -- ./target/debug/assembler --symbol main --analyze --output jsoncargo run -- ./target/debug/assembler --symbol main --analyze --analyze-exit-codeThe text renderer has two layouts:
| Mode | Behavior |
|---|---|
| pretty | structured box layout optimized for interactive reading |
| plain | flat, grep-friendly text optimized for logs, pipes, and captured output |
| auto | pretty on TTYs, plain on captured or piped stdout |
Color behavior:
| Mode | Behavior |
|---|---|
| auto | enabled on terminals, disabled when NO_COLOR is present or TERM=dumb |
| always | ANSI sequences always emitted |
| never | ANSI disabled entirely |
--output json emits a stable structured document:
{
"disassembly": {
"target": "...",
"architecture": "X86_64",
"metadata": [["format", "Elf"], ...],
"sections": [...]
},
"analysis": {
"architecture": "X86_64",
"findings": [...],
"notes": [...]
}
}analysis is omitted when --analyze is not requested.
--analyze runs a post-decoding pass that consumes Capstone detail-mode output and reasons over:
It does not inspect rendered text for keywords and does not claim exploitability from disassembly alone.
CLI
→ DisasmRequest
→ Capstone decode (detail mode)
→ DisassemblyReport
→ analyze()
→ AnalysisReport
→ text or JSON render
| Class | Meaning |
|---|---|
| potential-stack-buffer-write-risk | repeated indexed writes into stack-local memory with evidence that progression exceeds inferred capacity |
| possible-out-of-bounds-local-write | single or loop-driven local write whose offset plus width exceeds inferred frame bounds |
| suspicious-copy-loop | backward-branch write loop with weak or unrecoverable destination bound evidence |
| unsafe-stack-frame-write | write above the local frame through an established frame pointer |
| stack-pointer-frame-pointer-anomaly | indexed write using live stack pointer as base |
| indirect-write-risk | memory write through a non-stack computed pointer |
fixtures/ is a dedicated workspace member that builds a separate verification binary containing exact global_asm! symbols.
This is a major part of the project’s engineering discipline: analyzer and renderer regressions are validated against precise assembly programs, not compiler-accidental Rust or C code generation.
| Symbol | Expected result |
|---|---|
| fixture_stack_local_unbounded_loop | stack-buffer risk + out-of-bounds local write + suspicious copy loop |
| fixture_stack_oob_write_no_loop | out-of-bounds local write only |
| fixture_copy_loop_weak_bound | suspicious loop / weak-bound behavior without overclaiming stronger proof |
| fixture_frame_adjacent_write | unsafe stack-frame write |
| fixture_indirect_indexed_store | indirect write risk |
| fixture_indexed_rsp_write | stack-pointer / frame-pointer anomaly |
| fixture_bounded_local_loop | zero findings |
| fixture_compare_only_no_write | zero findings |
| fixture_frame_setup_no_risky_write | zero findings |
| fixture_frame_write_no_setup | zero findings |
| fixture_aarch64_basic_function | zero findings + unsupported-analysis note |
cargo build -p fixtures
cargo test --test fixtures
# inspect one positive fixture manually
cargo run -- ./target/debug/fixtures --symbol fixture_stack_local_unbounded_loop --analyze --output jsonexamples/password-login/ contains a small C target compiled to preserve readable machine code.
gcc -O0 -g -fno-inline -fno-builtin -no-pie \
-o examples/password-login/secret_login \
examples/password-login/secret_login.ccargo run -- examples/password-login/secret_login --symbol check_password --render pretty --color nevercargo run -- examples/password-login/secret_login --symbol check_password --analyze --render plain --color neverThis function is intentionally a negative analysis case: it reveals a secret through immediate byte comparisons, but it does not perform the stack-local copy or repeated write behavior required for a memory-safety finding.
See examples/password-login/README.md for the full walkthrough.
| Target | Raw bytes | File-backed | Notes |
|---|---|---|---|
| x86 | yes | yes | Intel syntax default, AT&T optional |
| x86_64 | yes | yes | Intel syntax default, AT&T optional |
| AArch64 | yes | yes | use --arch aarch64 for raw input |
| ARM | no | yes | explicit --arch arm required |
| Thumb | no | yes | explicit --arch thumb required; bit0 symbol normalization applied |
Important limits:
cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo build -p fixtures
cargo test
cargo test --test fixtures
bash scripts/smoke.shCI additionally performs:
src/
main.rs entry point and output dispatch
cli.rs CLI model and argument parsing
types.rs shared request/report/instruction data model
disasm.rs Capstone integration, object parsing, symbol resolution
render.rs text rendering, ANSI styling, operand token classification
analysis.rs semantic analyzer, CFG construction, finding model
fixtures/
src/main.rs symbol retention tables and fixture module wiring
src/x86_64.rs exact x86_64 analyzer fixtures
src/aarch64.rs exact AArch64 renderer fixtures
tests/
cli.rs CLI integration tests
fixtures.rs fixture-driven analyzer regression tests
scripts/
smoke.sh quick end-to-end verification
examples/
password-login/ reverse-engineering demo target
| Component | Technology |
|---|---|
| Language | Rust 2024 edition |
| Decoder backend | Capstone via capstone crate |
| Object parsing | object |
| CLI parsing | clap derive API |
| Structured output | serde + serde_json |
| Error handling | anyhow |
| Terminal layout | unicode-width |
| Verification fixtures | global_asm! + ELF .size directives |
assembler is optimized for the real work of low-level inspection:
If you want a terminal-native disassembler with explicit architecture handling, disciplined output, and analyzer behavior that is tested against exact machine code instead of wishful abstractions, this repository is built for that workflow.
| Back | FazBrowse Home | New Git URL |