mirror of
https://github.com/86Box/bios-tools.git
synced 2026-02-25 04:45:32 -07:00
bios_extract: Save Phoenix BCPSEGMENT data, as at least one 4.0x doesn't include it in the extracted payload
This commit is contained in:
@@ -1251,5 +1251,22 @@ PhoenixExtract(unsigned char *BIOSImage, int BIOSLength, int BIOSOffset,
|
||||
write(fd, BIOSImage + Offset, Length);
|
||||
close(fd);
|
||||
|
||||
/* Extract BCPSEGMENT data */
|
||||
Offset = BCPSegmentOffset;
|
||||
Length = ((unsigned char *)ID) - (BIOSImage + Offset);
|
||||
if ((Offset + Length) > BIOSLength)
|
||||
Length = BIOSLength - Offset;
|
||||
fd = open("bcpsegment.rom", O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "Error: unable to open bcpsegment.rom: %s\n\n",
|
||||
strerror(errno));
|
||||
return FALSE;
|
||||
}
|
||||
printf("0x%05X (%6d bytes) -> bcpsegment.rom\n",
|
||||
Offset, Length);
|
||||
write(fd, BIOSImage + Offset, Length);
|
||||
close(fd);
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user