Skip to content

Commit 12b3955

Browse files
committed
capsule: Fix reading BIOS platform and version
Can't believe it has never been correct... ``` > framework_tool --ho2-capsule Framework_Laptop_13_12th_Gen_Intel_Core_capsule_signed_allsku_3.09.cap File Size: 36130244 B Size: 35283 KB BIOS Platform: HFW30 BIOS Version: 03.09 [...] > framework_tool --ho2-capsule Framework_Laptop_13_Ryzen7040_capsule_signed_allsku_3.08.cap File Size: 36129956 B Size: 35283 KB BIOS Platform: JFP30 BIOS Version: 03.08 [...] ``` Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 95cbdc3 commit 12b3955

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

framework_lib/src/capsule_content.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ pub fn find_bios_version(data: &[u8]) -> Option<BiosCapsule> {
2929
let needle = b"$BVDT";
3030
let found = util::find_sequence(data, needle)?;
3131

32+
// One of: GFW30, HFW3T, HFW30, IFR30, KFM30, JFP30, LFK30, IFGA3, IFGP6, LFR20, LFSP0
3233
let platform_offset = found + 0xA + needle.len() - 1;
33-
let platform = std::str::from_utf8(&data[platform_offset..platform_offset + 4])
34+
let platform = std::str::from_utf8(&data[platform_offset..platform_offset + 5])
3435
.map(|x| x.to_string())
3536
.ok()?;
3637

37-
let ver_offset = found + 0xE + needle.len() - 1;
38-
let version = std::str::from_utf8(&data[ver_offset..ver_offset + 4])
38+
let ver_offset = found + 0x10 + needle.len() - 1;
39+
let version = std::str::from_utf8(&data[ver_offset..ver_offset + 5])
3940
.map(|x| x.to_string())
4041
.ok()?;
4142

0 commit comments

Comments
 (0)