From dbb78f908aeaef682593dc982b0291f41d965af3 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sun, 30 Jan 2022 19:18:14 -0300 Subject: [PATCH] Optimize Phoenix detection and add "Phoenix Software Associates" --- biostools/analyzers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/biostools/analyzers.py b/biostools/analyzers.py index 1cd3efd..08df4ce 100644 --- a/biostools/analyzers.py +++ b/biostools/analyzers.py @@ -1618,6 +1618,8 @@ class PhoenixAnalyzer(Analyzer): def __init__(self, *args, **kwargs): super().__init__('Phoenix', *args, **kwargs) + # "Phoenix ROM BIOS" (Dell Latitude CP/CPI) + self._phoenix_pattern = re.compile(b'''Phoenix (?:Technologies Ltd|Software Associates|ROM BIOS)|PPhhooeenniixx TTeecchhnnoollooggiieess''') # "All Rights Reserved\r\n\n\x00\xF4\x01" (Ax86) # "All Rights Reserved\r\n\n\x00" (Commodore 386LT, Tandy 1000RSX) # "All Rights Reserved\r\n\n" (ROM BIOS) @@ -1663,8 +1665,7 @@ class PhoenixAnalyzer(Analyzer): self._found_signon_tandy = '' def can_handle(self, file_data, header_data): - # "Phoenix ROM BIOS" (Dell Latitude CP/CPI) - if b'Phoenix Technologies Ltd' not in file_data and b'Phoenix ROM BIOS' not in file_data and b'PPhhooeenniixx TTeecchhnnoollooggiieess' not in file_data: + if not self._phoenix_pattern.search(file_data): return False # Skip Windows 95 INF updates.