From 8dd13545b1d1be0db8925025e18992ee993e97ae Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Wed, 22 Nov 2023 12:07:48 -0300 Subject: [PATCH] WhizproAnalyzer: Fix 256K image detection --- biostools/analyzers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/biostools/analyzers.py b/biostools/analyzers.py index cac3f0b..b730cf0 100644 --- a/biostools/analyzers.py +++ b/biostools/analyzers.py @@ -3617,9 +3617,10 @@ class WhizproAnalyzer(Analyzer): date_index = len(file_data) - 0x0b self.version = util.read_string(file_data[date_index:date_index + 8]) - # Determine location of the identification block. I've only ever - # seen 512K BIOSes; other sizes are assumed to work the same way. - id_block_index = len(file_data) - 0x20110 + # Determine location of the identification block. + # 256K BIOS = end - 0x10110 + # 512K BIOS = end - 0x20110 + id_block_index = len(file_data) - ((len(file_data) >> 2) + 0x110) # Extract string. self.string = util.read_string(file_data[id_block_index + 0xe0:id_block_index + 0x100])