| Crates.io | abootimg-oxide |
| lib.rs | abootimg-oxide |
| version | 0.2.2 |
| created_at | 2024-09-05 22:14:36.194901+00 |
| updated_at | 2025-07-30 02:48:57.079942+00 |
| description | Android boot image (boot.img) parser |
| homepage | |
| repository | https://github.com/axelkar/abootimg-oxide |
| max_upload_size | |
| id | 1365225 |
| size | 55,318 |
Android boot image (boot.img) parser written in Rust
unpack_bootimg has been fully reimplemented using this library. Try it by
running cargo run --package=unpack_bootimg -- --boot_img <path to boot.img>.
TODO: reimplement mkbootimg
use std::fs::File;
use abootimg_oxide::{BufReader, Header};
let mut r = BufReader::new(File::open("boot_a.img").unwrap());
let hdr = Header::parse(&mut r).unwrap();
println!("{hdr:#?}");
// Extract the kernel
use std::io::{self, BufWriter, Read, Seek, SeekFrom};
let mut w = BufWriter::new(File::create("boot_a_kernel").unwrap());
let r = r.get_mut();
r.seek(SeekFrom::Start(hdr.kernel_position() as u64))
.unwrap();
io::copy(&mut r.take(hdr.kernel_size().into()), w.get_mut()).unwrap();
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.