diff --git a/src/hd_ai.rs b/src/hd_ai.rs deleted file mode 100644 index 7a0b3ac..0000000 --- a/src/hd_ai.rs +++ /dev/null @@ -1,36 +0,0 @@ -use std::env; -use std::fs::File; -use std::io::{self, Read}; - -fn main() -> io::Result<()> { - // Get the file name from command line arguments - let args: Vec = env::args().collect(); - if args.len() < 2 { - eprintln!("Usage: {} ", args[0]); - return Ok(()); - } - let filename = &args[1]; - - // Open the file - let mut file = File::open(filename)?; - let mut buffer = Vec::new(); - - // Read the file into the buffer - file.read_to_end(&mut buffer)?; - - // Print the hex dump - for (i, byte) in buffer.iter().enumerate() { - // Print the address - if i % 16 == 0 { - if i != 0 { - println!(); // New line after every 16 bytes - } - print!("{:08x} ", i); - } - // Print the byte in hex format - print!("{:02x} ", byte); - } - println!(); // Final new line - - Ok(()) -}