From 21baf18fd70d44b810e66c751d040e0b452eef8d Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 22 Nov 2024 19:48:47 -0300 Subject: [PATCH] FATExtractor: Add Unisys floppy image support --- biostools/extractors.py | 88 +++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/biostools/extractors.py b/biostools/extractors.py index 83028b8..e0efd80 100644 --- a/biostools/extractors.py +++ b/biostools/extractors.py @@ -1316,7 +1316,13 @@ class FATExtractor(ArchiveExtractor): # Stop if this doesn't appear to be a FAT filesystem. if not self._is_fat(file_header): - # Check for 4-byte AST filesystem followed by FAT filesystem. + # Check for 20-byte Unisys header followed by FAT filesystem. + # Only 4 samples (from the Aquanta line) were found, the header is identical across all of them. + if file_header[:20] == b'\x1a\x12\x34\x1a\x0e\x00\x00\x01\x01\x00\x04\x00\x02\x00\x12\x00\x02\x00\x50\x00' and self._is_fat(file_header[20:]): + self.debug_print('Unisys header found') + return self._extract_payload(file_path, dest_dir, 20, 'unisys.bin') + + # Check for 4-byte AST header followed by FAT filesystem. ast_size, unknown = struct.unpack('