diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | ami.c | 11 | ||||
-rw-r--r-- | bios_extract.c | 4 |
3 files changed, 13 insertions, 4 deletions
@@ -1,5 +1,5 @@ MAKE = make -CFLAGS = -g -fpack-struct -Wall +CFLAGS = -g -fpack-struct -Wall -O0 CC = gcc all: bios_extract bcpvpd @@ -191,7 +191,10 @@ AMI95Extract(unsigned char *BIOSImage, int BIOSLength, int BIOSOffset, } /* now dump the individual modules */ - Offset = (le16toh(abc->BeginHi) << 4) + le16toh(abc->BeginLo); + if (BIOSLength > 0x100000) + Offset = (le16toh(abc->BeginHi) << 16) + le16toh(abc->BeginLo); + else + Offset = (le16toh(abc->BeginHi) << 4) + le16toh(abc->BeginLo); for (i = 0; i < 0x80; i++) { char filename[64], *ModuleName; @@ -259,7 +262,11 @@ AMI95Extract(unsigned char *BIOSImage, int BIOSLength, int BIOSOffset, if ((le16toh(part->PrePartHi) == 0xFFFF) || (le16toh(part->PrePartLo) == 0xFFFF)) break; - Offset = (le16toh(part->PrePartHi) << 4) + le16toh(part->PrePartLo); + + if (BIOSLength > 0x100000) + Offset = (le16toh(part->PrePartHi) << 16) + le16toh(part->PrePartLo); + else + Offset = (le16toh(part->PrePartHi) << 4) + le16toh(part->PrePartLo); } return TRUE; diff --git a/bios_extract.c b/bios_extract.c index bd90bd4..32b5aab 100644 --- a/bios_extract.c +++ b/bios_extract.c @@ -87,6 +87,7 @@ static struct { } BIOSIdentification[] = { {"AMIBOOT ROM", "AMIBIOSC", AMI95Extract}, {"$ASUSAMI$", "AMIBIOSC", AMI95Extract}, + {"AMIEBBLK", "AMIBIOSC", AMI95Extract}, {"Award BootBlock", "= Award Decompression Bios =", AwardExtract}, {"Phoenix FirstBIOS", "BCPSEGMENT", PhoenixExtract}, {"PhoenixBIOS 4.0", "BCPSEGMENT", PhoenixExtract}, @@ -126,7 +127,8 @@ main(int argc, char *argv[]) argv[1], strerror(errno)); return 1; } - BIOSOffset = 0x100000 - FileLength; + + BIOSOffset = (0x100000 - FileLength) & 0xFFFFF; BIOSImage = mmap(NULL, FileLength, PROT_READ, MAP_PRIVATE, fd, 0); if (BIOSImage < 0) { |