Pure MoonBit binary format parsing and x86-64 disassembly


$ moonbin info notepad.exe
format PE
machine 34404
entry 0x19a0
base 0x140000000
sections 7 symbols 0 imports 315 exports 0
$ moonbin entropy kernel32.dll
entropy 6.3952274 / 8.0moon check --deny-warn # 0 errors, 0 warnings
moon test # 181 tests
moon build --target native --release cmd/main
bin=_build/native/release/build/cmd/main/main.exe
$bin info <file>
$bin sections <file>
$bin symbols <file>
$bin imports <file>
$bin exports <file>
$bin disasm <file> [--count N]
$bin cfg <file> # basic blocks + successors
$bin callgraph <file> # direct call edges
$bin dwarf <file> # DWARF source lines + subprogram ranges
$bin strings <file> # ASCII runs >= 4
$bin entropy <file> # Shannon entropy 0..8
# add --json to any command
# reference-tool cross-checks (objdump / readelf / lief / capstone)
bash test/pe_crosscheck.sh
bash test/elf_crosscheck.sh
python -I test/macho_crosscheck.py
python -I test/disasm_crosscheck.py verify
python -I test/analysis_crosscheck.py
node test/web_e2e.mjs # wasm RE workbench smoke (+ DOM leg when Chrome present)
# browser playground
bash web/build.sh && (cd web && python -m http.server 8080)| package | role |
|---|---|
| src/core | bounds-checked Reader + format-agnostic Region/Symbol/Import/Export |
| src/pe | PE32/PE32+ : headers, sections, import/export/symbols, relocs/delay/TLS/resources |
| src/elf | ELF32/64 both endians: headers, segments, symtab/dynsym, dynamic, rela imports |
| src/macho | Mach-O 32/64 both endians: segments/sections, symtab, dylibs, entry |
| src/disasm | x86-64: prefixes/REX/ModR/M/SIB, integer+SSE+x87+VEX/AVX subset |
| src/analysis | basic-block CFG + direct call graph over the decoded stream |
| src/dwarf | DWARF v4/v5 line table + subprogram source mapping |
| src/inspect | strings / Shannon entropy |
| src/format | magic-based container detection |
| src/web + web/ | single-file wasm playground |
| cmd/main | CLI: info/sections/symbols/imports/exports/disasm/strings/entropy, --json |
Install
Download zipPure MoonBit binary format parsing and x86-64 disassembly