mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-02-16 15:40:14 +00:00
GP-4260: The MzLoader can now load binaries whose file size is less than
the size that is reported in its header
This commit is contained in:
parent
ad7694a7a9
commit
2dc7a8fe15
@ -188,6 +188,11 @@ public class MzLoader extends AbstractLibrarySupportLoader {
|
||||
}
|
||||
// Allocate an initialized memory block for each segment we know about
|
||||
int endOffset = pagesToBytes(header.e_cp() - 1) + header.e_cblp();
|
||||
if (endOffset > reader.length()) {
|
||||
log.appendMsg(
|
||||
"File is 0x%x bytes but header reports 0x%x".formatted(reader.length(), endOffset));
|
||||
endOffset = (int) reader.length();
|
||||
}
|
||||
MemoryBlock lastBlock = null;
|
||||
List<SegmentedAddress> orderedSegments = new ArrayList<>(knownSegments);
|
||||
for (int i = 0; i < orderedSegments.size(); i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user