feat: parse and display XEX2 main header (M1)

Implement XEX2 main header parsing with module flag decoding.
Add error handling, big-endian read utilities, CLI entry point,
and comprehensive unit + integration tests against a sample file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
MechaCat02
2026-03-28 18:52:15 +01:00
parent abbd264e4c
commit b5f2abe09a
9 changed files with 572 additions and 1 deletions

View File

@@ -1,3 +1,29 @@
use std::process;
fn main() {
println!("Hello, world!");
let path = match std::env::args().nth(1) {
Some(p) => p,
None => {
eprintln!("Usage: xex2tractor <file.xex>");
process::exit(1);
}
};
let data = match std::fs::read(&path) {
Ok(d) => d,
Err(e) => {
eprintln!("Error reading {path}: {e}");
process::exit(1);
}
};
let xex = match xex2tractor::parse(&data) {
Ok(x) => x,
Err(e) => {
eprintln!("Error parsing XEX2: {e}");
process::exit(1);
}
};
xex2tractor::display::display_header(&xex.header);
}