Add support for extracting firmware from l440 firmware files (Using an FL1 EFI capsule and some magic)

pull/177/head
Hamish Coleman 4 years ago
parent ab7efa33a5
commit 084a8f94f4

@ -193,12 +193,20 @@ r0iuj21wd.iso sha1:3765d1715f001ddae982682f0189b49c2b04bf3a x270 BIOS 1.28 (R0IE
# no FL2 file (all in UEFI Capsule), FAT_OFFSET is 79872
h3uj04wd.iso sha1:3bbf65b61d1e2ed806ea6cf40b97d24c090c00dc e330 and v480s
j4uj62wd.iso sha1:4421bd4c21a1309f83c919bfffc1beaf67502334 L440, L540 BIOS 1.73 (J4ET73WW) EC 1.08 (J4EHT27WW)
j4uj64wd.iso sha1:4b2682bf11d31e0ff9e4cf4ec5e3372b715c7841 L440, L540 BIOS 1.78 (J4ET78WW) EC 1.09 (J4EHT28WW)
j4uj65wd.iso sha1:386353b39ec54f0feb5160cc6edc41b3def14dca L440, L540 BIOS 1.81 (J4ET81WW) EC 1.10 (J4EHT29WW, maybe J4HT29WW)
j4uj75wd.iso sha1:3ff5025a4a5f62f461467f7726e5b2c1fa119b5b L440, L540 BIOS 1.93 (J4ET93WW) EC 1.11 (J4EHT30WW, maybe J4HT30WW)
# TODO
# - update the tools to automatically determine the FAT_OFFSET
# The firmware files from inside the ISO images
l430.G3HT40WW.s01D4000.FL1 rule:FL2,dep:g3uj25us.iso,param:01D4000.FL1 l430 BIOS 2.68 Flash File
l440.J4HT27WW.s0AJ4000.FL1 rule:FL2,dep:j4uj62wd.iso,param:0AJ4000.FL1 l440 BIOS 1.73 Flash File
l440.J4HT28WW.s0AJ4000.FL1 rule:FL2,dep:j4uj64wd.iso,param:0AJ4000.FL1 l440 BIOS 1.78 Flash File
l440.J4HT29WW.s0AJ4000.FL1 rule:FL2,dep:j4uj65wd.iso,param:0AJ4000.FL1 l440 BIOS 1.81 Flash File
l440.J4HT30WW.s0AJ4000.FL1 rule:FL2,dep:j4uj75wd.iso,param:0AJ4000.FL1 l440 BIOS 1.93 Flash File
p51.N1UHT24W.s0AN1U00.FL2 rule:FL2,dep:n1uur12w.iso,param:0AN1U00.FL2 p51 EC 1.07 Flash File
t430.G1HT34WW.s01D2000.FL2 rule:FL2,dep:g1uj25us.iso,depi:g1uj25us.iso.bat,param:01D2000.FL2 t430 EC 1.12 Flash File
t430.G1HT35WW.s01D2000.FL2 rule:FL2,dep:g1uj48us.iso,depi:g1uj48us.iso.bat,param:01D2000.FL2 t430 EC 1.13 Flash File
@ -248,7 +256,9 @@ x61.7MHT25WW.s01B2000.FL2 rule:oldISO,dep:7nuj22uc.iso,param:01B2000.FL2
# The actual EC firmware extracted from the BIOS firmware file
l430.G3HT40WW.img rule:IMGnoenc,dep:l430.G3HT40WW.s01D4000.FL1 l430 EC 1.14 (may be wrong) (8052 cpu)
l430.G3HT40WW.img rule:IMGnoenc,dep:l430.G3HT40WW.s01D4000.FL1 l430 EC 1.14 (may be wrong)
l440.J4HT29WW.img rule:IMGnoenc,dep:l440.J4HT29WW.s0AJ4000.FL1 l440 EC 1.10
l440.J4HT30WW.img rule:IMGnoenc,dep:l440.J4HT30WW.s0AJ4000.FL1 l440 EC 1.11
p51.N1UHT24W.img rule:IMGnoenc,dep:p51.N1UHT24W.s0AN1U00.FL2 p51 EC 1.07
t430.G1HT34WW.img rule:IMG,dep:t430.G1HT34WW.s01D2000.FL2 t430 EC 1.12 (decrypted) (ARCompact cpu)
t430.G1HT35WW.img rule:IMG,dep:t430.G1HT35WW.s01D2000.FL2 t430 EC 1.13 (decrypted) (ARCompact cpu)

@ -9,6 +9,7 @@ bootable BIOS update CD images for both the current and historical releases.
e330 https://support.lenovo.com/hk/en/downloads/DS031908
l430 https://support.lenovo.com/hk/en/downloads/DS018887
l440 https://pcsupport.lenovo.com/gb/en/downloads/DS037264
p51 https://support.lenovo.com/hk/en/downloads/DS121297
t430 https://pcsupport.lenovo.com/gb/en/downloads/DS029252
t430s https://pcsupport.lenovo.com/gb/en/downloads/DS029724

@ -732,6 +732,65 @@ sub _check {
1;
package EFI::Capsule::UNK_header;
use warnings;
use strict;
#
# Some FL1 files appear to have an unknown header after the EFI headers
#
use base qw(FL2::base);
sub _check {
my $self = shift;
my $header3_offset
= $self->{header1}{HeaderSize} + $self->{header2}{HeaderLength};
my $header3_length = 0x30;
my $buf = $self->get_block($header3_offset, $header3_length);
if (!defined($buf)) {
log::add("bad get_block");
return undef;
}
# d95fe99c196ee7409a8febad7f78e0c5
my $maybe_uuid = "\xd9\x5f\xe9\x9c\x19\x6e\xe7\x40\x9a\x8f\xeb\xad\x7f\x78\xe0\xc5";
my @fields = qw(
all_ff
unk01
maybe_uuid
maybe_offset
unk02
);
my @values = unpack("a16a8a16VV",$$buf);
map { $self->{header3}{$fields[$_]} = $values[$_] } (0..scalar(@fields)-1);
if ($self->{header3}{maybe_uuid} ne $maybe_uuid) {
log::add("failed header3 maybe_uuid");
return undef;
}
# FIXME: This is just a guess
my $ec_size = 0x20000;
$self->set_offset_size(
$header3_offset + $header3_length + $self->{header3}{maybe_offset},
$ec_size
);
return $self;
}
sub extract {
return shift->_extract(shift);
}
# no insert() will work until we know how to generate the checksums
1;
package EFI::Capsule;
use warnings;
use strict;
@ -832,9 +891,12 @@ sub _check {
return $self->_check();
}
print(Data::Dumper::Dumper($self));
if ($self->{header2}{Revision} == 2) {
# l440 has this
log::add("not using unfinished checker ");
bless $self, 'EFI::Capsule::UNK_header';
return $self->_check();
}
return undef;
}

Loading…
Cancel
Save