awilliam / rom-parser

153 stars 45 forks source link

Error, ran off the end #3

Closed wlraider70 closed 6 years ago

wlraider70 commented 6 years ago

Im on a SAPPHIRE DUAL-X Radeon R9 280X which has a physical switch to enable UEFI boot. rom-parser works on the legacy side, but I get "Error, ran off the end" when I'm the UEFI part.

awilliam commented 6 years ago

Can you put the misbehaving ROM somewhere or are there existing ROMs on techpowerup with this issue? 50/50 chance whether it's the parsing or the ROM itself that's broken with such an issue.

wlraider70 commented 6 years ago

Dropbox link I hope drop can link here. This is rom as off my video card. I've never manipulated a rom before. side note, any VM i send this card too can't boot so I'm thinking its a uefi issue.

edit: sorry I did not mean to close this.

awilliam commented 6 years ago

I think your ROM is truncated, the parser output is accurate. ROMs images begin on 512 byte boundaries and start with the signature 0xaa55 (55aa little endian). The only such occurrence in your image is at the beginning of the file. The PCIR structure does not set the last image indicator, so we search for another, but there is none found before we hit the end of the file. The ROM you provided is 64K, however I note that other ROMs on techpowerup for this card are 128K. This ROM in particular:

https://www.techpowerup.com/vgabios/162007/sapphire-r9280x-3072-140727

is 128K and includes the UEFI ROM starting at offset 64K. I suspect your image would be the same if we had the remaining half of it. If the card is the primary graphics on your system and the ROM was dumped from Linux, this might explain it as Linux will provide the shadow copy of the ROM in that situation and could truncate it to 64K. Suggest getting a full 128K ROM image dump or trying the techpowerup ROM above if it's compatible.

wlraider70 commented 6 years ago

Thanks for clearing that up. I'm going to flash the vbios that you listed.