From 8291bcdd8e4ba32b204b1bef61725fe590a5d539 Mon Sep 17 00:00:00 2001 From: Genny Date: Fri, 25 Nov 2022 01:40:21 -0600 Subject: gifprobe: more offsets --- gifprobe/src/main.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gifprobe/src/main.rs b/gifprobe/src/main.rs index 2f5c025..60bca13 100644 --- a/gifprobe/src/main.rs +++ b/gifprobe/src/main.rs @@ -68,7 +68,6 @@ fn main() { let dispose_string = if let Some(dispose) = gce.disposal_method() { dispose.to_string() } else { - String::from("Reserved Value!"); format!("Reserved: {:b}", gce.packed().disposal_method()) }; @@ -83,7 +82,10 @@ fn main() { } Block::LoopingExtension(_) => todo!(), Block::CommentExtension(cmt) => { - println!("Comment Extension\n\tLength {}", cmt.len().yellow()); + print!("Comment Extension"); + print_offset(offset); + + println!("\tLength {}", cmt.len().yellow()); match String::from_utf8(cmt) { Ok(cmt) => println!("\tString \"{}\"", cmt.yellow()), @@ -94,8 +96,11 @@ fn main() { let auth = app.authentication_code(); let app_ident = String::from_utf8_lossy(app.identifier()); + print!("Application Extension"); + print_offset(offset); + println!( - "Application Extension\n\tIdentifier {}\n\tAuthentication {:02X} {:02X} {:02X}", + "\tIdentifier {}\n\tAuthentication {:02X} {:02X} {:02X}", app_ident.yellow(), auth[0].yellow(), auth[1].yellow(), @@ -170,7 +175,7 @@ fn print_offset(offset: Range) { print_usize(offset.start); print!(" … "); print_usize(offset.end); - println!("]"); + println!("] "); } fn print_usize(offset: usize) { -- cgit 1.4.1-3-g733a5