Supported file formats: ELF, Mach-O, Windows PE/COFF, Wasm, and Unix archive.
+## Example for unified read API
+```rust
+use object::{Object, ObjectSection};
+use std::error::Error;
+use std::fs;
+
+/// Reads a file and displays the content of the ".boot" section.
+fn main() -> Result<(), Box<dyn Error>> {
+ let bin_data = fs::read("./multiboot2-binary.elf")?;
+ let obj_file = object::File::parse(&*bin_data)?;
+ if let Some(section) = obj_file.section_by_name(".boot") {
+ println!("{:#x?}", section.data()?);
+ } else {
+ eprintln!("section not available");
+ }
+ Ok(())
+}
+```
+
## License
Licensed under either of