From fa19294d058262cbabb79a649ae59ff3adefae2a Mon Sep 17 00:00:00 2001 From: Ondrej Jirman Date: Tue, 31 Aug 2021 14:29:50 +0200 Subject: [PATCH] Dump option ROM when reading flash over USB --- usb-flasher.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usb-flasher.c b/usb-flasher.c index d6a9550..efa96d2 100644 --- a/usb-flasher.c +++ b/usb-flasher.c @@ -693,15 +693,16 @@ int main(int ac, char* av[]) for (int i = optind; i < ac; i++) { if (!strcmp(av[i], "read")) { - uint8_t rom[0x8000]; + uint8_t rom[0x8100]; memset(rom, 0xff, sizeof rom); printf("Reading code ROM\n"); cmd_read_rom(rom, 0, 0x8000); + cmd_read_option(rom + 0x8000); int fd = open(rom_out, O_WRONLY | O_CREAT | O_TRUNC, 0666); if (fd >= 0) { - ssize_t wr = write(fd, rom, 0x8000); + ssize_t wr = write(fd, rom, 0x8100); syscall_error(wr < 0, "write failed"); close(fd); }