Fix corner case with PhoenixNet archives

This commit is contained in:
RichardG867
2022-03-24 13:29:27 -03:00
parent a36d9dc38d
commit acdf8e8537

View File

@@ -244,9 +244,12 @@ class BIOSExtractor(Extractor):
pos = in_f.tell()
data = in_f.read(65536 + 32)
match = self._phoenixnet_workaround_pattern.search(data)
file_size = match.start(0) - 17
in_f.seek(pos + file_size)
data = data[:file_size]
if match:
file_size = match.start(0) - 17
in_f.seek(pos + file_size)
data = data[:file_size]
else:
in_f.seek(0, 2)
else:
data = in_f.read(file_size)