Skip to content

Commit

Permalink
Handle LZMA_COMPRESSED_HP Guid-Defined sections (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeggor authored Sep 13, 2022
1 parent 963ce5c commit 502f1ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions uefi_firmware/structs/uefi_structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

FIRMWARE_GUIDED_GUIDS = {
"LZMA_COMPRESSED": "ee4e5898-3914-4259-9d6e-dc7bd79403cf",
"LZMA_COMPRESSED_HP": "0ed85e23-f253-413f-a03c-901987b04397",
"TIANO_COMPRESSED": "a31280ad-481e-41b6-95e8-127f4c984779",
"FIRMWARE_VOLUME": "24400798-3807-4a42-b413-a1ecee205dd8",
#"VOLUME_SECTION": "367ae684-335d-4671-a16d-899dbfea6b88",
Expand Down
4 changes: 2 additions & 2 deletions uefi_firmware/uefi.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ def decompress_guid(alg):
return self.process_subsections()

status = True
if sguid(self.guid) == FIRMWARE_GUIDED_GUIDS["LZMA_COMPRESSED"]:
if sguid(self.guid) in [FIRMWARE_GUIDED_GUIDS["LZMA_COMPRESSED"], FIRMWARE_GUIDED_GUIDS["LZMA_COMPRESSED_HP"]]:
status = decompress_guid(efi_compressor.LzmaDecompress)
if sguid(self.guid) == FIRMWARE_GUIDED_GUIDS["TIANO_COMPRESSED"]:
status = decompress_guid(efi_compressor.TianoDecompress)
Expand Down Expand Up @@ -660,7 +660,7 @@ def decompress_guid(alg):
def build(self, generate_checksum=False, debug=False):
data = self._build_subsections(generate_checksum)

if sguid(self.guid) == FIRMWARE_GUIDED_GUIDS["LZMA_COMPRESSED"]:
if sguid(self.guid) in [FIRMWARE_GUIDED_GUIDS["LZMA_COMPRESSED"], FIRMWARE_GUIDED_GUIDS["LZMA_COMPRESSED_HP"]]:
data = str(efi_compressor.LzmaCompress(data, len(data)))
pass

Expand Down

0 comments on commit 502f1ba

Please sign in to comment.