GP-2045 Coff header changes for harvard architecture and non microsoft

COFF files
This commit is contained in:
emteere 2022-05-18 12:46:58 +00:00
parent 49a426eb3f
commit 42f28fd67b
2 changed files with 5 additions and 1 deletions

View File

@ -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));
}

View File

@ -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));