mtk_bdp: improve some header structs, update rsa crate

This commit is contained in:
theubusu
2026-02-04 14:29:10 +01:00
parent cf46b29e3d
commit 4b8c878ef1
3 changed files with 15 additions and 14 deletions
Generated
+4 -5
View File
@@ -575,11 +575,10 @@ dependencies = [
[[package]] [[package]]
name = "num-bigint-dig" name = "num-bigint-dig"
version = "0.8.4" version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" checksum = "e661dda6640fad38e827a6d4a310ff4763082116fe217f279885c97f511bb0b7"
dependencies = [ dependencies = [
"byteorder",
"lazy_static", "lazy_static",
"libm", "libm",
"num-integer", "num-integer",
@@ -773,9 +772,9 @@ dependencies = [
[[package]] [[package]]
name = "rsa" name = "rsa"
version = "0.9.9" version = "0.9.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40a0376c50d0358279d9d643e4bf7b7be212f1f4ff1da9070a7b54d22ef75c88" checksum = "b8573f03f5883dcaebdfcf4725caa1ecb9c15b2ef50c43a07b816e06799bb12d"
dependencies = [ dependencies = [
"const-oid", "const-oid",
"digest", "digest",
+1 -1
View File
@@ -12,7 +12,7 @@ cbc = "0.1.2"
md5 = "0.8" md5 = "0.8"
sha1 = "0.10.6" sha1 = "0.10.6"
flate2 = "1.1.5" flate2 = "1.1.5"
rsa = { version = "0.9.9", features = ["hazmat"] } rsa = { version = "0.9.10", features = ["hazmat"] }
hex = "0.4.3" hex = "0.4.3"
ecb = "0.1.2" ecb = "0.1.2"
tar = "0.4.44" tar = "0.4.44"
+10 -8
View File
@@ -17,7 +17,7 @@ struct PITITPITEntry {
nand_size: u32, nand_size: u32,
pit_offset: u32, pit_offset: u32,
pit_size: u32, pit_size: u32,
_private_data_2: u32, _table_id: u32,
} }
#[derive(BinRead)] #[derive(BinRead)]
@@ -31,10 +31,10 @@ struct PITITBITEntry {
#[derive(BinRead)] #[derive(BinRead)]
struct PITHeader { struct PITHeader {
#[br(count = 8)] pit_magic: Vec<u8>, #[br(count = 8)] pit_magic: Vec<u8>,
_unk: u32, _version: u32,
first_entry_offset: u32, first_entry_offset: u32, //"header len"
entry_size: u32, entry_size: u32, //"item lenght"
entry_count: u32, entry_count: u32, //"item num"
} }
static PIT_MAGIC: [u8; 8] = [0xDC, 0xEA, 0x30, 0x85, 0xDC, 0xEA, 0x30, 0x85]; static PIT_MAGIC: [u8; 8] = [0xDC, 0xEA, 0x30, 0x85, 0xDC, 0xEA, 0x30, 0x85];
@@ -43,10 +43,12 @@ static PIT_MAGIC: [u8; 8] = [0xDC, 0xEA, 0x30, 0x85, 0xDC, 0xEA, 0x30, 0x85];
struct PITEntry { struct PITEntry {
#[br(count = 16)] name_bytes: Vec<u8>, #[br(count = 16)] name_bytes: Vec<u8>,
partition_id: u32, partition_id: u32,
_unknown: u32, _part_info: u32,
offset_on_nand: u32, offset_on_nand: u32,
size_on_nand: u32, size_on_nand: u32,
#[br(count = 32)] _unused: Vec<u8>, _enc_size: u32,
_no_enc_size: u32,
#[br(count = 24)] _reserve: Vec<u8>,
} }
impl PITEntry { impl PITEntry {
fn name(&self) -> String { fn name(&self) -> String {
@@ -60,7 +62,7 @@ struct BITEntry {
offset: u32, offset: u32,
size: u32, size: u32,
offset_in_target_part: u32, offset_in_target_part: u32,
_unknown: u32, _bin_info: u32, //"Bin info"
} }
static BIT_MAGIC: [u8; 20] = [0xCD, 0xAB, 0x30, 0x85, 0xCD, 0xAB, 0x30, 0x85, 0xCD, 0xAB, 0x30, 0x85, 0xCD, 0xAB, 0x30, 0x85, 0xCD, 0xAB, 0x30, 0x85]; static BIT_MAGIC: [u8; 20] = [0xCD, 0xAB, 0x30, 0x85, 0xCD, 0xAB, 0x30, 0x85, 0xCD, 0xAB, 0x30, 0x85, 0xCD, 0xAB, 0x30, 0x85, 0xCD, 0xAB, 0x30, 0x85];