diff --git a/Descriptions.txt b/Descriptions.txt index 18019cc..2d33d29 100644 --- a/Descriptions.txt +++ b/Descriptions.txt @@ -186,6 +186,7 @@ h3uj79wd.iso sha1:f1404fd6724c0faa5b57aee0d81c60908b9917c6 e330 BIOS 1.16 (H3ET h6uja0wd.iso sha1:19a05355c793b3f776c3130caa5f10e371f530c0 T430u BIOS 2.18 (H6ETA0WW) EC 2.01 (H6HT54WW) h9et75ww.zip sha1:d81c145b371cf77abe6ae00d35d37491715feecd b590,b490 BIOS ?.? (H9ET75WW) EC 1.01 (H9EC08WW) h9et92ww.exe sha1:c1a3ba9282fe48a9e6f69e4dd32537c10a710e78 b590,b490 BIOS ?.? (H9ET92WW) EC 1.02 (H9EC09WW) +heuj19wd.iso sha1:0c060fa56828d09918ff51d61c26a5ec7f7bcff8 E431/E538 BIOS 1.33 (HEET52WW) EC 1.31 (HEHT50WW) n10ur10w.iso sha1:0e4c4ffb99146e50867dc1345ee2ef88c60ea192 x250 BIOS 1.21 (N10ET42W) EC 1.16 (N10HT17W) n14ur15w.iso sha1:e106b024b1d448234e5ea958b0e8e93bbda1a543 x1 Carbon (Type 20BS, 20BT) BIOS 1.16 (N14ET38W) EC 1.09 (N14HT36W) n1mur06w.iso sha1:e2bed755c065daf83cabc130b8d65c08e6a6a391 x1 Carbon (Type 20HQ, 20HR, 20K3, 20K4) BIOS 1.20 (N1MET35W) EC 1.14 (N1MHT25W) @@ -205,6 +206,7 @@ n24ur03w.iso sha1:FIXME t480 BIOS 1.11 (N24E n24ur04w.iso sha1:134b239e4ce4c9c2d1f5f8f645f279c162fc5f3e t480 BIOS 1.12 (N24ET37W) EC 1.08 (N24HT23W) n2jur16w.iso sha1:FIXME T490s, X390 BIOS 1.51 (N2JET73W) EC 1.12 (N2JHT28W) n2jur17w.iso sha1:be7598ac64e9c3f2aab60ca890175d0adac010b9 T490s, X390 BIOS 1.55 (N2JET77W) EC 1.13 (N2JHT29W) +n30ur13w.iso sha1:1b358b9485f3a42c226456ccb038a9e6f7cd6284 p15 r02uj46d.iso sha1:876a68add32d9c961cbdf80c74b88f92a66443cf x260 BIOS 1.19 (R02ET46W) EC 1.11 (R02HT29W) r0fuj15wd.iso sha1:bab0722d72375d1c9190b2c47ab7b4eb4c0dfde0 t470p BIOS 1.22 (R0FET42W) EC 1.04 (R0FHT16W) r0iuj09wd.iso sha1:21b3abf69b9ee7ecf12fe0880564312122b1ff75 x270 BIOS 1.16 (R0IET38W) EC 1.12 (R0IHT30W) @@ -238,6 +240,7 @@ l440.J4HT27WW.s0AJ4000.FL1 rule:FL2,dep:j4uj62wd.iso,param:0AJ4000.FL1 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 +p15.N30HT33W.s0AN3000.FL2 rule:FL2,dep:n30ur13w.iso,param:0AN3000.FL2 p15 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 @@ -294,6 +297,7 @@ e330.H3EC35WW.img rule:IMGnuvoton,dep:e330.H3EC35WW.s01H3000.FL1 e330 EC 1. l430.G3HT40WW.img rule:IMGnuvoton,dep:l430.G3HT40WW.s01D4000.FL1 l430 EC 1.14 (not encrypted) (CR16CPlus cpu) 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 +p15.N30HT33W.img rule:IMGnoenc,dep:p15.N30HT33W.s0AN3000.FL2 p15 EC 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) diff --git a/Makefile b/Makefile index c80eb69..cf64d92 100644 --- a/Makefile +++ b/Makefile @@ -112,7 +112,14 @@ export MTOOLS_SKIP_CHECK=1 export MTOOLS_LOWER_CASE=0 build-deps: - apt -y install git mtools libssl-dev build-essential xorriso unzip innoextract + apt -y install \ + git \ + mtools \ + libssl-dev \ + build-essential \ + xorriso \ + unzip \ + innoextract \ # # Radare didnt seem to let me specify the directory to store the project file, diff --git a/docs/firmware_download.txt b/docs/firmware_download.txt index 608391a..5d67f4b 100644 --- a/docs/firmware_download.txt +++ b/docs/firmware_download.txt @@ -7,9 +7,14 @@ latest versions. These pages provide the the description, checksum and binaries for the bootable BIOS update CD images for both the current and historical releases. +b580 FIXME +b590 FIXME e330 https://support.lenovo.com/hk/en/downloads/DS031908 +e531 FIXME l430 https://pcsupport.lenovo.com/us/en/downloads/DS029124 l440 https://pcsupport.lenovo.com/gb/en/downloads/DS037264 +p15 https://pcsupport.lenovo.com/us/en/downloads/ds546302 +p15g2 https://pcsupport.lenovo.com/us/en/downloads/ds551321 p51 https://pcsupport.lenovo.com/us/en/downloads/DS121296 t430 https://pcsupport.lenovo.com/gb/en/downloads/DS029252 t430s https://pcsupport.lenovo.com/gb/en/downloads/DS029724 diff --git a/scripts/FL2_copyIMG b/scripts/FL2_copyIMG index 95804b7..edba1bf 100755 --- a/scripts/FL2_copyIMG +++ b/scripts/FL2_copyIMG @@ -106,6 +106,7 @@ sub _check_copyright { my @offsets = ( 0x268, # ARCompact 32bit platforms 0x264, # older 16bit platforms + 0x1480, # _EC file with second header (p15) ); while (@offsets) { @@ -489,6 +490,7 @@ sub _check { # We also store the encryption flag in here my $known = { 196896 => 'yes', + 229728 => 'unk', # p15 262176 => 'no', 286752 => 'no', }; @@ -497,7 +499,7 @@ sub _check { my $header_size = 0x20; my $trailer_size = 0x100; - my $buf = $self->get_block($header_offset, $header_size); + my $buf = $self->get_block($header_offset, $header_size+0x20); if (!defined($buf)) { log::add("bad get_block"); @@ -507,8 +509,9 @@ sub _check { my @fields = qw( signature version filesize imgsize hash_algo sign_algo hash_crc16 header_crc16 unk1 + signature2 unk2 imgmax imgsize2 ); - my @values = unpack("a3CVVVVSSC",$$buf); + my @values = unpack("a3CVVVVSSa8a4a17VV",$$buf); map { $self->{header}{$fields[$_]} = $values[$_] } (0..scalar(@fields)-1); if ($self->{header}{signature} ne "_EC") { @@ -529,16 +532,27 @@ sub _check { return undef; } - if ($self->{header}{imgsize}+$header_size+$trailer_size == $self->{filesize}) { + my $imgsize = $self->{header}{imgsize}; + + if ($self->{header}{signature2} eq "^M;*") { + # a second header with a different imgsize value in it !? + log::add("found signature2"); + $header_size = 0x60; + $imgsize = $self->{header}{imgsize2}; + } + + if ($imgsize+$header_size+$trailer_size == $self->{filesize}) { # there is an additional block of 0x100 appended to the FL2, outside # of the header defined IMG file # - I expect this is the digital signature $self->{flag}{trailer}="external"; - } elsif ($self->{header}{imgsize}+$header_size == $self->{filesize}) { + log::add("trailer external"); + } elsif ($imgsize+$header_size == $self->{filesize}) { # the additional block still looks like it is there, but they have # changed the accounting to count it in the IMG - these files are also # significantly larger in size $self->{flag}{trailer}="internal"; + log::add("trailer internal"); } else { log::add("unexpected filesize/imgsize results"); return undef; @@ -549,7 +563,7 @@ sub _check { $self->{flag}{encrypted} = $known->{$self->{filesize}}; - $self->set_offset_size($header_size, $self->{header}{imgsize}); + $self->set_offset_size($header_size, $imgsize); return $self->_check_copyright(); }