Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
兼容新版固件标准
  • Loading branch information
suyulin committed Aug 2, 2023
1 parent 342f716 commit 8097565
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ fn unpack_rkfw(buf: &[u8], dst_path: &str) -> Result<()> {
buf[8],
(buf[7] as u16) << 8 + buf[6] as u16
);
println!(
"date: {}-{:02}-{:02} {:02}:{:02}:{:02}",
(buf[0x0f] as u16) << 8 + buf[0x0e] as u16,
buf[0x10],
buf[0x11],
buf[0x12],
buf[0x13],
buf[0x14]
);
// println!(
// "date: {}-{:02}-{:02} {:02}:{:02}:{:02}",
// (buf[0x0f] as u16) << 8 + buf[0x0e] as u16,
// buf[0x10],
// buf[0x11],
// buf[0x12],
// buf[0x13],
// buf[0x14]
// );

match buf[0x15] {
0x50 => chip = Some("rk29xx"),
Expand All @@ -147,9 +147,9 @@ fn unpack_rkfw(buf: &[u8], dst_path: &str) -> Result<()> {
let ioff = get_u32_le(&buf[0x19..]);
let isize: u32 = get_u32_le(&buf[0x1d..]);

if &buf[ioff as usize..ioff as usize + 4] != b"BOOT" {
panic!("cannot find BOOT signature");
}
// if &buf[ioff as usize..ioff as usize + 4] != b"BOOT" {
// panic!("cannot find BOOT signature");
// }

println!(
"{:08x}-{:08x} {:26} (size: {})",
Expand Down

0 comments on commit 8097565

Please sign in to comment.