Package: file Version: 1:5.25-2 Severity: wishlist Tags: newcomer There are four variations of this format determined by combination of header and contents. Firstly the imaging tools may use a 128 byte header or 512 byte header placing the start of the actual ROM image (and its magic number) at either offset 0x80 or offset 0x200. The header is dos formated text beginning with the characters 'PCjr' and padded to length (probably with either 0x1a or 0x00). The actual ROM will in most cases begin with 0x55aa, have a valid checksum and in all other ways be a standard expansion ROM meeting IBM's published specifications. There are two exceptions to this, one of witch was was planned. Firstly BIOS replacement ROMs have no signature. I recommend not attempting to identify such images unless someone has a way to recognize such images. The other is abuse of spec. These ROM images either do not comply with the spec and are just used to store code and data for another program and omit the magic number so that they will be ignored by the BIOS. There are also ROMs that consist of parts that comply with the bios requirements (including checksum and magic number) only for part of their size, the remaining being the aforementioned blob rom. In most cases these will have the magic number at the start of the ROM but it may be at any 2k offset. I recommend only checking for the first offset.
In summary I recommend checking for the following patterns: 1) A) file size is 128 + 2^n B) offset 0x00 four bytes PCjr C) offset 0x80 two bytes 0x55aa 2) A) file size is 512 + 2^n B) offset 0x00 four bytes PCjr C) offset 0x200 two bytes 0x55aa -- System Information: Debian Release: stretch/sid APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'testing'), (500, 'stable') Architecture: i386 (i686) Kernel: Linux 4.2.0-1-686-pae (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: sysvinit (via /sbin/init) Versions of packages file depends on: ii libc6 2.21-6 ii libmagic1 1:5.25-2 ii zlib1g 1:1.2.8.dfsg-2+b1 file recommends no packages. file suggests no packages.