Commit Graph

91 Commits

Author SHA1 Message Date
Hamish Coleman
0b9f59014a Add partial support for p15g2 2022-05-28 20:42:07 +02:00
Hamish Coleman
1b1ff90d06 Add extractor for p15, and some misc docs 2022-05-28 20:30:48 +02:00
Hamish Coleman
3e25aaf1c6 Dont try to read zero byte patch files 2022-05-28 17:22:25 +02:00
leecher1337
260830bbf6 Adding support for Thinkpad E330 2022-02-10 19:19:47 +00:00
Hamish Coleman
6d92dc2b08 Allow inserting images found via the PFH - all the older prefix_ff images turned out to also have a PFH, so the lack of updating the checksum is clearly not fatal 2020-04-08 18:34:47 +01:00
Hamish Coleman
084a8f94f4 Add support for extracting firmware from l440 firmware files (Using an FL1 EFI capsule and some magic) 2020-04-08 18:08:07 +01:00
Hamish Coleman
ab7efa33a5 Fix parser description 2020-04-08 17:49:33 +01:00
Hamish Coleman
54580e05fc Detect capsule headers and parse them 2020-04-08 17:46:27 +01:00
Hamish Coleman
b0ac2c3e76 Record the parsed PFH directory entries as we see them 2020-04-08 17:43:14 +01:00
Hamish Coleman
dedf794e99 Improve documentation for the FL2 extractor magic numbers 2020-04-08 16:39:30 +01:00
Hamish Coleman
c7f0eeec99 Gate invalid PFH data by version number 2020-04-07 11:35:43 +01:00
Hamish Coleman
408b3af824 Add filesize for l440 firmware 2020-04-07 11:35:25 +01:00
Hamish Coleman
21264858f7 Allow PFH header to be found at an 8byte aligned address instead of just 16byte aligned 2020-04-07 11:34:54 +01:00
Hamish Coleman
c46715c332 Convert logger to use printf format string 2020-04-07 11:30:04 +01:00
Hamish Coleman
e9a967e848 Add logging to all failed signature/header checks 2020-04-07 11:04:01 +01:00
Hamish Coleman
b03489352a Add a simple log to help debug why a FL2 file contents are not recognised 2020-04-07 10:39:44 +01:00
Hamish Coleman
efc0249958 Add ability to have multiple offset/size pairs for prefix 0xff style images (currently unused) 2019-11-29 09:56:21 +08:00
Hamish Coleman
850767750f Add extractor debugging output to show all header fields 2019-09-02 07:37:42 +08:00
Hamish Coleman
944c63b013 Add _EC field definitions gleaned from https://www.blackhat.com/us-19/briefings/schedule/#breaking-through-another-side-bypassing-firmware-security-boundaries-from-embedded-controller-15902 2019-09-02 07:37:13 +08:00
Hamish Coleman
55e0f0d0a3 Ensure that hexpatch emits an error if we are configured to use a patch and dont have it 2019-08-23 23:14:11 +02:00
Hamish Coleman
50c66dd878 Ensure that config changes cause the output to be rebuilt 2019-08-06 16:32:38 +01:00
Hamish Coleman
c5ceb033c3 Simplify the way target dependancies are generated 2019-08-06 16:26:36 +01:00
Hamish Coleman
7dff574346 Cover some more rm on exit cases in the hexpatch script 2019-08-06 16:20:38 +01:00
Hamish Coleman
7f9800d203 Add a rudimentary config file - this (finally) removes the need to ever build in a dirty checkout, which makes the build strings and debuging clearer 2019-08-06 16:20:26 +01:00
Hamish Coleman
1f2ce9a1aa Clarify output message to look less scary 2019-08-06 15:15:43 +01:00
Hamish Coleman
f89f7578af Re-arrange the order of checks in the FL2_copyIMG to prioritise those checks with good signatures or checksums 2019-03-11 19:22:06 +08:00
Hamish Coleman
046597de6f Make the build process somewhat quieter - there is still room for improvements here though 2019-03-11 19:17:23 +08:00
Hamish Coleman
ea767e935d Add support to the FL2_copyIMG script to search for the NAPI header, thus allowing x61 FL2 images to be supported 2019-03-11 19:14:46 +08:00
Hamish Coleman
d417ce260a Attempt to fix bad bootsectors
Some (recent) ISO images have started having a zero byte as the first
byte of the MBR boot code embedded in the hard disk image.

When the original Lenovo ISO is booted, nobody has reported any issues,
however when a patched IMG file is created from that, it just hangs
- which does match with having bad bootcode data.

I was unable to reproduce the issue when running the images in qemu,
which is even more confusing.

Since every working image has the same first byte (a "CLI" instruction)
we attempt to repair things by simply changing it back to that byte.
2019-02-16 11:14:16 +08:00
Hamish Coleman
78e6203a7b Add a generic extractor for x60 era FL2 files 2019-02-15 09:35:48 +08:00
Hamish Coleman
ea4e9da2ac Rename the _EC header detector to be more specific 2019-02-15 09:03:02 +08:00
Hamish Coleman
875e43cfbc Add some details for X60 firmware - Just a Description entry and updates to the FL2_copyIMG script - this is a firmware update package that is not structured the way the rest of the process expects 2019-02-14 21:19:50 +08:00
Hamish Coleman
c7e7502201 Make the location of the known all 0xff block variable 2019-02-14 21:17:32 +08:00
Hamish Coleman
a6a46828d7 Throw the known data block around by reference, rather than looking it up on use 2019-02-14 21:14:07 +08:00
Hamish Coleman
ceb2aa01f0 Bail out immediately if we have no matching known signature 2019-02-14 21:08:01 +08:00
Hamish Coleman
9c6e3df503 Note where this signature came from 2019-02-14 21:06:22 +08:00
Hamish Coleman
ee69775ebc Update Copyright notices for a new year 2019-02-14 20:57:10 +08:00
Hamish Coleman
eb2ba3eb0b Notice that another year has gone past and update the copyright headers 2018-11-30 09:27:50 +08:00
Hamish Coleman
dfbd7e8127 Provide slightly more details when a patch fails 2018-11-30 09:22:38 +08:00
Hamish Coleman
d5e4cb161d Add some guesses to FL2_copyIMG for older X200 extraction.
The FL2_copyIMG tool uses some heuristics to work out how to extract the
EC firmware image from inside the FL2 container.  Many of these are simply
guesses, so there are checks to try to only match files that "look" right.

Add some matches for the 7XHT21WW and 7XHT22WW firmware (See #104)
2018-11-29 16:34:54 +08:00
Hamish Coleman
b9ae23d169 Consistantly call perl the same way each time 2018-10-25 16:32:20 +01:00
Hamish Coleman
23232fb0d6 Address shellcheck issues with script - ensuring it is plain shell with no extensions 2018-10-25 16:31:36 +01:00
Hamish Coleman
4cae4d7745 Address shellcheck issues and convert to standard shell 2018-10-25 16:23:16 +01:00
Hamish Coleman
f9029928ad Script doesnt need bash extensions, simply convert it 2018-10-25 16:22:55 +01:00
Hamish Coleman
8ddbbe7559 Address shellcheck issue with describe script 2018-10-25 16:18:40 +01:00
Hamish Coleman
0e4f08e6df Skip over deps lines with tagging errors - but warn about it 2018-08-07 22:48:38 +08:00
Hamish Coleman
b3a51d5b4e Actually return failure when scripts/FL2_copyIMG has failed 2018-07-12 08:24:18 +01:00
Hamish Coleman
09b2a27abb dont show the output of the mtools install test 2018-05-06 18:23:23 +08:00
Hamish Coleman
24d4072bd2 Add a sanity check to try and ensure that we have the right tools installed 2018-04-14 10:41:19 +08:00
Hamish Coleman
867d3860af Improve error outputs from FL2 extraction/guessing to remind me that there might be a whitelist change needed 2018-03-30 13:18:19 +08:00