Fix bogus Phoenix BCPSYS on a specific DEC BIOS

This commit is contained in:
RichardG867
2022-05-17 12:54:14 -03:00
parent b53db6181b
commit 715ac0ef53

View File

@@ -1831,6 +1831,7 @@ class PhoenixAnalyzer(Analyzer):
self._rombios_signon_pattern = re.compile(b'''\\x0D\\x0AAll Rights Reserved\\x0D\\x0A(?:\\x0A(?:\\x00(?:[\\x90\\xF4]\\x01)?)?|\\x0D\\x0A\\x0D\\x0A)''')
# No "All Rights Reserved" (Yangtech 2.27 / pxxt)
self._rombios_signon_alt_pattern = re.compile(b'''\\(R\\)eboot, other keys to continue\\x00\\xFF+''')
self._bcpsys_pattern = re.compile(b'''BCPSYS([\\x00-\\xFF]{8})''')
self._bcpsys_datetime_pattern = re.compile('''[0-9]{2}/[0-9]{2}/[0-9]{2} ''')
self._core_signon_pattern = re.compile(b'''\\x00FOR EVALUATION ONLY\\. NOT FOR RESALE\\.\\x00([\\x00-\\xFF]+?)\\x00Primary Master \\x00''')
self._intel_86_pattern = re.compile('''[0-9A-Z]{8}\\.86[0-9A-Z]\\.[0-9A-Z]{3,4}\\.[0-9A-Z]{1,4}\\.[0-9]{10}$''')
@@ -1879,8 +1880,12 @@ class PhoenixAnalyzer(Analyzer):
return False
# Read build code, date and time from BCPSYS on 4.0 and newer BIOSes.
offset = file_data.find(b'BCPSYS')
if offset > -1:
for match in self._bcpsys_pattern.finditer(file_data):
# Skip bogus BCPSYS in ACFG (DEC Venturis 466)
if match.group(1) == b'\x00\x00\x00\x00\x00\x00\x00\x00':
continue
offset = match.start(0)
# Extract the build code as a string.
build_code = self.string = util.read_string(file_data[offset + 55:offset + 63].replace(b'\x00', b'\x20')).strip()
if build_code:
@@ -1895,6 +1900,8 @@ class PhoenixAnalyzer(Analyzer):
self.string += '\n'
self.string += date_time
break
# Determine if this is a Dell BIOS (48-byte header).
offset = file_data.find(b'Dell System ')
if offset > -1: