diff options
Diffstat (limited to 'resources/bios_extract/patches/0003-dell_inspiron_1100_unpacker-Add-module-type-0x52.patch')
-rw-r--r-- | resources/bios_extract/patches/0003-dell_inspiron_1100_unpacker-Add-module-type-0x52.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/resources/bios_extract/patches/0003-dell_inspiron_1100_unpacker-Add-module-type-0x52.patch b/resources/bios_extract/patches/0003-dell_inspiron_1100_unpacker-Add-module-type-0x52.patch new file mode 100644 index 00000000..6de392be --- /dev/null +++ b/resources/bios_extract/patches/0003-dell_inspiron_1100_unpacker-Add-module-type-0x52.patch @@ -0,0 +1,50 @@ +From b3868ed71a390f925eb22b926b9c735f7b84b383 Mon Sep 17 00:00:00 2001 +From: Nicholas Chin <nic.c3.14@gmail.com> +Date: Sat, 6 May 2023 11:14:45 -0600 +Subject: [PATCH 3/3] dell_inspiron_1100_unpacker: Add module type 0x52 + +The module with type 0x52 in the Latitude E6400 BIOS is the EC firmware, +and is not compressed. The current behavior tries to decompress this +module leading to an index out of bounds error at runtime, so add a new +condition to avoid decompressing it. This assumes type 0x52 is always +used for EC firmware. + +The current behavior also assumes all the data before the first module +is EC firmware, which was probably true for the Inspiron 1100, but for +the E6400 the EC firmware is in module 0x52. However, for simplicity an +exception is not made for this behavior, so the extracted EC.bin should +just be treated as spurious data for the E6400. + +TEST: Inspiron 1100 BIOS is still unpacked correctly, Latitude E6400 +BIOS unpacks without runtime errors. + +Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com> +Change-Id: I3152150b7dea4d79840c61683692c65b1311cce2 +--- + dell_inspiron_1100_unpacker.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/dell_inspiron_1100_unpacker.py b/dell_inspiron_1100_unpacker.py +index 5e43813..3589550 100755 +--- a/dell_inspiron_1100_unpacker.py ++++ b/dell_inspiron_1100_unpacker.py +@@ -66,6 +66,7 @@ def dell_unpack(indata): + mod_types = { + 0x01: "Main ROM", + 0x0C: "Microcode update", ++ 0x52: "EC firmware" + } + + print("Dell/Phoenix ROM BIOS PLUS unpacker") +@@ -107,7 +108,7 @@ while True: + break + data = f[offs:offs+leng] + offs += leng +- if type_id != 0xC: ++ if type_id != 0xC and type_id != 0x52: + odata = dell_unpack(data) + else: + odata = data +-- +2.40.1 + |