mirror of
https://github.com/beerpiss/saekawa.git
synced 2024-11-14 18:47:41 +01:00
Fix ICF decoding bugs (again)
This commit is contained in:
parent
9cf8803035
commit
d2a276923c
@ -181,14 +181,15 @@ pub fn decode_icf(data: &mut [u8]) -> Result<Vec<IcfData>> {
|
|||||||
|
|
||||||
let data: IcfData = match container_type {
|
let data: IcfData = match container_type {
|
||||||
0x0000 | 0x0001 | 0x0002 => {
|
0x0000 | 0x0001 | 0x0002 => {
|
||||||
|
let (version, datetime, required_system_version) =
|
||||||
|
decode_icf_container_data(&mut rd)?;
|
||||||
|
|
||||||
for _ in 0..2 {
|
for _ in 0..2 {
|
||||||
if rd.read_u64()? != 0 {
|
if rd.read_u64()? != 0 {
|
||||||
return Err(anyhow!("Padding error. Expected 16 NULL bytes."));
|
return Err(anyhow!("Padding error. Expected 16 NULL bytes."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let (version, datetime, required_system_version) = decode_icf_container_data(&mut rd)?;
|
|
||||||
|
|
||||||
match container_type {
|
match container_type {
|
||||||
0x0000 => IcfData::System(IcfInnerData {
|
0x0000 => IcfData::System(IcfInnerData {
|
||||||
id: platform_id.clone(),
|
id: platform_id.clone(),
|
||||||
@ -224,7 +225,8 @@ pub fn decode_icf(data: &mut [u8]) -> Result<Vec<IcfData>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let (target_version, target_datetime, _) = decode_icf_container_data(&mut rd)?;
|
let (target_version, target_datetime, _) = decode_icf_container_data(&mut rd)?;
|
||||||
let (source_version, _, source_required_system_version) = decode_icf_container_data(&mut rd)?;
|
let (source_version, _, source_required_system_version) =
|
||||||
|
decode_icf_container_data(&mut rd)?;
|
||||||
|
|
||||||
IcfData::Patch(IcfPatchData {
|
IcfData::Patch(IcfPatchData {
|
||||||
id: app_id.clone(),
|
id: app_id.clone(),
|
||||||
|
Loading…
Reference in New Issue
Block a user