Package: amideco
Version: 0.31e-3
Severity: normal
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Some of the newer BIOS files I have seem to use a compression flag value
unknown to amideco for some of their parts.  amideco will attempt to 
decompress these parts using its built-in lzh decompression.  This fails
with the message "Bad Table [2]" and the program exits immediately,
thereby failing to write any parts.

The attached patch "fixes" this by ignoring the unknown flag and
printing a warning.  I have not been able to find any description of
the file format, but my experiments so far indicates that treating the 
"IsComprs" byte as a bitmap instead of a two-value byte is correct.

The only value I have observed in addition to 0x00 and 0x80 is 0x90. 
It is commonly used for values of class 11 (P6 Microcode), 15 (Memory
Sizing) and 30 (Font Database).

I assume the 0x10 bit has some significance, so I believe it is
appropriate to issue a warning when handling these parts.


Bjørn


- -- System Information:
Debian Release: lenny/sid
  APT prefers stable
  APT policy: (700, 'stable'), (650, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages amideco depends on:
ii  libc6                         2.7-10     GNU C Library: Shared libraries

amideco recommends no packages.

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIVCBT10rqkowbIskRAiHrAJ94rrbUiPHWvjgVkEndTHBNRDGq9wCdGFV/
4qbcR6qua0xCJ0FnTvXXNsE=
=ViCE
-----END PGP SIGNATURE-----
--- amideco-0.31e/src/amifunc.c.old     2008-06-14 20:59:45.000000000 +0200
+++ amideco-0.31e/src/amifunc.c 2008-06-14 21:16:44.000000000 +0200
@@ -339,11 +339,11 @@
                 part.PartID,
                 PartTotal,
                 GetModuleName(part.PartID),
-                (part.IsComprs!=0x80)?(part.ROMSize):(part.CSize),
-                (part.IsComprs!=0x80)?(part.ROMSize):(part.CSize),
-                (part.IsComprs!=0x80)?(part.ExpSize):(part.CSize),
-                (part.IsComprs!=0x80)?(part.ExpSize):(part.CSize),
-                (part.IsComprs!=0x80)?(IDSign):(" "),
+                ((part.IsComprs&0x80)==0)?(part.ROMSize):(part.CSize),
+               ((part.IsComprs&0x80)==0)?(part.ROMSize):(part.CSize),
+               ((part.IsComprs&0x80)==0)?(part.ExpSize):(part.CSize),
+               ((part.IsComprs&0x80)==0)?(part.ExpSize):(part.CSize),
+               ((part.IsComprs&0x80)==0)?(IDSign):(" "),
 
                 Offset-ConstOff
                 );
@@ -376,7 +376,7 @@
                 interface.dicbit = 13;
                 interface.method = 5;
 
-                if(part.IsComprs!=0x80)
+                if((part.IsComprs&0x80)==0)
                 decode(interface);
                         else
                         {
@@ -385,6 +385,9 @@
                                 fread(&Buf[0],1,1,ptx);
                                 fwrite(&Buf[0],1,1,pto);
                                 };
+                               if(part.IsComprs!=0x80)
+                                       printf("WARNING: Ignoring unknown 
compression flag (0x%02x) for part id %02X\n", 
+                                              part.IsComprs, part.PartID);
                         }
                 fclose(pto);
                         break;

Reply via email to