mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-25 05:32:14 +00:00
GP-2045 Coff header changes for harvard architecture and non microsoft
COFF files
This commit is contained in:
parent
49a426eb3f
commit
42f28fd67b
@ -400,6 +400,10 @@ public class CoffSectionHeader implements StructConverter {
|
||||
public static Address getAddress(Language language, long offset, CoffSectionHeader section) {
|
||||
boolean isData = section == null || section.isData();
|
||||
AddressSpace space = isData ? language.getDefaultDataSpace() : language.getDefaultSpace();
|
||||
if (offset > space.getMaxAddress().getAddressableWordOffset()) {
|
||||
// offset too big to fit, try the opposite space, so at least the blocks will load
|
||||
space = !isData ? language.getDefaultDataSpace() : language.getDefaultSpace();
|
||||
}
|
||||
return space.getAddress(offset * getOffsetUnitSize(language, section));
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,7 @@ public class CoffLoader extends AbstractLibrarySupportLoader {
|
||||
List<QueryResult> results =
|
||||
QueryOpinionService.query(getName(), header.getMachineName(), secondary);
|
||||
for (QueryResult result : results) {
|
||||
loadSpecs.add(new LoadSpec(this, header.getImageBase(true), result));
|
||||
loadSpecs.add(new LoadSpec(this, header.getImageBase(isMicrosoftFormat()), result));
|
||||
}
|
||||
if (loadSpecs.isEmpty()) {
|
||||
loadSpecs.add(new LoadSpec(this, header.getImageBase(false), true));
|
||||
|
Loading…
Reference in New Issue
Block a user