Skip to content

XRef Code v0.1.0

Choose a tag to compare

@github-actions github-actions released this 02 Nov 07:31
· 246 commits to main since this release

XRef Code v0.1.0

DOI

Zero-index x86-64 ELF cross-references, .eh_frame function discovery, backward program slicing, struct displacement recovery, and goto-free structured pseudo-C — written in pure safe Rust (#![forbid(unsafe_code)]).

Install

Homebrew (macOS Apple Silicon & Linux x86_64)

brew tap alex09x/apps
brew install xref

Cargo (rustc 1.88+)

cargo install --git https://github.com/alex09x/xref --tag v0.1.0 --locked

Prebuilt Binaries

Platform Archive SHA-256
Linux x86_64 (glibc >= 2.34) xref-v0.1.0-x86_64-unknown-linux-gnu.tar.gz 30a6ac3303bfe86e4f23de10b5382bd56fb65df605c3e4cbced495e15e9d77de
macOS Apple Silicon (arm64) xref-v0.1.0-aarch64-apple-darwin.tar.gz 9652793f0ee814c9dc212c54739b0e1b6bfc1f9ab30ef6c3fe4af65a805858b0

Citation

Highlights in v0.1.0

  • Zero-index .eh_frame discovery & parallel queries (stats, sym, func, refs, istr, imm, disp, callers, calls, args, find, path, tree, asm, error, variant, arm, src, where, files): maps x86-64 ELF images directly in memory, extracts function ranges from .eh_frame unwind records (with heuristic span fallback), and scans functions across CPU cores via rayon without upfront project database files. Recorded single-run wall-clock times from xref 0.0.5 on self-hosted xref.stripped (68aa57b, 1.96 MB, AMD Ryzen 9 9950X, warm page cache) are documented in README.md#recorded-performance.
  • Goto-free structured typed pseudo-C (c / decomp, --fields): lifts x86-64 machine code via SSA lifting, dead-code elimination, condition folding, 1-operand widening mul/imul/div/idiv, multi-precision adc/sbb, stripped Rust panic and (ptr, len) &str recognition, and structured if/else/while/do-while/switch regions (0 gotos across the 7 recorded workbench functions).
  • Static struct displacement & stride recovery (layout, disp --lea, --stride): aggregates non-stack memory displacements, access widths, read/write/lea counts, SIB array strides, and 1-hop callee pointer forwarding per argument register.
  • Backward program slicing, cross-build diffing & modular export (slice, match / diff, diff-c, dump): isolates balanced statements and control guards reaching a target call/address/string, matches shifted functions across stripped builds, diffs normalized pseudo-C, and exports modular .c files grouped by recovered Rust panic source paths.
  • Scope & Limitations: x86-64 ELF executables and shared objects only (PE, Mach-O, and AArch64 are out of scope; end-to-end tests in tests/fixture.rs and recorded runs in docs/recorded-data.js at v0.1.0 cover Rust binaries).