From ffd5f8684cf3871250ab2f0007b0324d74c134bb Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 6 Oct 2026 17:07:57 +0200 Subject: readrom: also print the raw bytes from the header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- crates/readrom/src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'crates/readrom/src') diff --git a/crates/readrom/src/main.rs b/crates/readrom/src/main.rs index 1b800fb..f7411e3 100644 --- a/crates/readrom/src/main.rs +++ b/crates/readrom/src/main.rs @@ -642,12 +642,12 @@ fn main() { die(e.to_string()); } - let buf = bytes.get(0..0x10).unwrap_or(&[]); + let buf = bytes.get(0..0x10).unwrap_or(&[]).to_vec(); if buf.is_empty() { die("malformed ROM file".to_string()); } - let header = match Header::try_from(buf) { + let header = match Header::try_from(buf.as_slice()) { Ok(h) => h, Err(e) => die(e.to_string()), }; @@ -677,6 +677,11 @@ fn main() { // Nope. Then let's just print information about it. First the header. print_header(&header); + print!(" Raw:\t\t\t\t["); + for c in buf { + print!(" {:02X}", c); + } + println!(" ]"); if args.header { std::process::exit(0); } -- cgit v1.2.3