From 4d40d72ec3bf94e0efaafeec4d007cfbc3c6ad77 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 8 Apr 2022 21:49:08 -0300 Subject: [PATCH] Fix Acer 1988 Award with weird sign-on location --- biostools/analyzers.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/biostools/analyzers.py b/biostools/analyzers.py index 0a9c111..42936cf 100644 --- a/biostools/analyzers.py +++ b/biostools/analyzers.py @@ -798,8 +798,7 @@ class AwardAnalyzer(Analyzer): self._early_modular_prefix_pattern = re.compile('''(.+) Modular BIOS ''') self._gigabyte_bif_pattern = re.compile(b'''\$BIF[\\x00-\\xFF]{5}([\\x20-\\x7E]+)\\x00.([\\x20-\\x7E]+)\\x00''') self._gigabyte_eval_pattern = re.compile('''\([a-zA-Z0-9]{1,8}\) EVALUATION ROM - NOT FOR SALE$''') - # "Hyosung Computer" (Samtron 88S) - self._id_block_pattern = re.compile(b'''(?:(?:Award | Award|Phoeni)[\\x00-\\xFF]{8}IBM COMPATIBLE |IBM COMPATIBLE 88 BIOS COPYRIGHT Award Software Inc\\.)''') + self._id_block_pattern = re.compile(b'''(?:Award | Award|Phoeni)[\\x00-\\xFF]{8}IBM COMPATIBLE |(?:[0-9]{2}/[0-9]{2}/[0-9]{4} {4})IBM COMPATIBLE [0-9]+ BIOS COPYRIGHT Award Software Inc\\.''') self._ignore_pattern = re.compile(b'search=f000,0,ffff,S,"|VGA BIOS Version (?:[^\r]+)\r\n(?:Copyright \(c\) (?:[^\r]+)\r\n)?Copyright \(c\) (?:NCR \& )?Award', re.M) self._romby_date_pattern = re.compile(b'''N((?:[0-9]{2})/(?:[0-9]{2})/)([0-9]{2})([0-9]{2})(\\1\\3)''') self._string_date_pattern = re.compile('''(?:[0-9]{2})/(?:[0-9]{2})/([0-9]{2,4})-''') @@ -842,22 +841,18 @@ class AwardAnalyzer(Analyzer): self.version += ' (Workstation)' # Extract sign-on. - # Vertical tab characters may be employed (??? reported by BurnedPinguin) - self.signon += util.read_string(file_data[id_block_index + 0xc1:id_block_index + 0x10f]).replace('\r', '').replace('\v', '\n') + signon = util.read_string(file_data[id_block_index + 0xc1:id_block_index + 0x10f]) + if ' BUSINESS MACHINES CORP.' in signon: # alternative location (Acer 01/01/1988) + signon = util.read_string(file_data[id_block_index + 0x71a:id_block_index + 0x81a]) # Split sign-on lines. - self.signon = '\n'.join(x.strip() for x in self.signon.split('\n') if x.strip()).strip('\n') + # Vertical tab characters may be employed. (??? reported by BurnedPinguin) + self.signon = '\n'.join(x.strip() for x in signon.replace('\r', '\n').replace('\v', '\n').split('\n') if x.strip()).strip('\n') # Extract string, unless the version is known to be too old to have a string. if self.version[:3] not in ('v2.', 'v3.'): self.string = util.read_string(file_data[id_block_index + 0xc71:id_block_index + 0xce0]) - # Move on to the next block if the string is too short. - # (PC Partner 440BX with remains of 1992 BIOS in Y segment) - if len(self.string) <= 11 and self.string[-1:] == '-': - self.signon = '' - continue - # Check if no string was inserted where it should # have been. (Gateway/Swan Anigma Award v4.28/4.32) if ' Award Software Inc. ' in self.string: @@ -878,6 +873,12 @@ class AwardAnalyzer(Analyzer): date = date.decode('cp437', 'ignore') self.string = date + self.string[len(date):] + # Move on to the next block if the string is too short. + # (PC Partner 440BX with remains of 1992 BIOS in Y segment) + if len(self.string) <= 11 and self.string[-1:] == '-': + self.signon = '' + continue + if self.version == 'v6.00PG' and self._gigabyte_eval_pattern.match(self.signon): # Reconstruct actual sign-on of a Gigabyte fork BIOS through # the data in the $BIF area (presumably BIOS update data).