mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-02-13 15:22:42 +08:00
Skip empty relocation entries while rebase PE & TE files (last relocation entry in block is for padding).
This commit is contained in:
parent
3ffdae1123
commit
5332242c47
@ -4316,6 +4316,13 @@ UINT8 FfsEngine::rebase(QByteArray &executable, const UINT32 base)
|
|||||||
|
|
||||||
// Run this relocation record
|
// Run this relocation record
|
||||||
while (Reloc < RelocEnd) {
|
while (Reloc < RelocEnd) {
|
||||||
|
|
||||||
|
if (!*Reloc) {
|
||||||
|
//skip last emtpy reloc entry (for padding)
|
||||||
|
++Reloc;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
UINT32 RelocLocation = RelocBase->VirtualAddress - teFixup + (*Reloc & 0x0FFF);
|
UINT32 RelocLocation = RelocBase->VirtualAddress - teFixup + (*Reloc & 0x0FFF);
|
||||||
if ((UINT32)file.size() < RelocLocation)
|
if ((UINT32)file.size() < RelocLocation)
|
||||||
return ERR_BAD_RELOCATION_ENTRY;
|
return ERR_BAD_RELOCATION_ENTRY;
|
||||||
|
Loading…
Reference in New Issue
Block a user