Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion uefi_firmware/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, data, search=True):
data = data[self.offset:]
self.data = data

header = data[:100]
header = data[:200]
for tester in checker.TESTERS:
if tester().match(header):
self.data_type = tester().name
Expand Down
17 changes: 9 additions & 8 deletions uefi_firmware/uefi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1377,14 +1377,15 @@ def __init__(self, data, name="0"):
print_error("Error invalid FV header data (%s)." % str(e))
return

try:
exthdr = self._data[self.exthdroff:self.exthdroff + self._EXT_HEADER_SIZE]
self.fvname, self.exthdrsize = struct.unpack("<16sI", exthdr)
assert self.exthdrsize == self._EXT_HEADER_SIZE
except Exception as e:
dlog(self, name, "Exception in __init__: %s" % (str(e)))
print_error("Error invalid FV header data (%s)." % str(e))
# not fatal
if self.exthdroff != 0:
try:
exthdr = self._data[self.exthdroff:self.exthdroff + self._EXT_HEADER_SIZE]
self.fvname, self.exthdrsize = struct.unpack("<16sI", exthdr)
assert self.exthdrsize == self._EXT_HEADER_SIZE
except Exception as e:
dlog(self, name, "Exception in __init__: %s" % (str(e)))
print_error("Error invalid FV header data (%s)." % str(e))
# not fatal

self.valid_header = True
pass
Expand Down
Loading