GP-2819: Don't parse PE symbol/string table when in SectionLayout.MEMORY

mode
This commit is contained in:
Ryan Kurtz
2022-11-10 03:49:21 -05:00
parent c65c83794f
commit 0491bcf5ef
@@ -367,6 +367,11 @@ public class FileHeader implements StructConverter {
}
void processSymbols() throws IOException {
if (ntHeader.isRVAResoltionSectionAligned()) {
// Symbols table offsets are only valid when parsing from file, not memory
return;
}
if (isLordPE()) {
return;
}
@@ -414,6 +419,10 @@ public class FileHeader implements StructConverter {
* @throws IOException if io error
*/
long getStringTableOffset() throws IOException {
if (ntHeader.isRVAResoltionSectionAligned()) {
// String table offsets are only valid when parsing from file, not memory
return -1;
}
if (pointerToSymbolTable <= 0 || numberOfSymbols < 0) {
return -1;
}