mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-22 10:02:49 +08:00
Correct wrong GCC/VS compiler detection
The GCC's offset to code may not necessarily be 0x1000.
This commit is contained in:
@@ -1054,14 +1054,7 @@ public class PeLoader extends AbstractPeDebugLoader {
|
||||
// return compilerType;
|
||||
// }
|
||||
|
||||
// Now look for offset to code (0x1000 for gcc) and PointerToSymbols
|
||||
// (0 for VS, non-zero for gcc)
|
||||
int addrCode = br.readInt(dh.e_lfanew() + 40);
|
||||
if (addrCode != 0x1000) {
|
||||
compilerType = CompilerEnum.VisualStudio;
|
||||
return compilerType;
|
||||
}
|
||||
|
||||
// Now look for PointerToSymbols (0 for VS, non-zero for gcc)
|
||||
int ptrSymTable = br.readInt(dh.e_lfanew() + 12);
|
||||
if (ptrSymTable != 0) {
|
||||
compilerType = CompilerEnum.GCC;
|
||||
|
||||
Reference in New Issue
Block a user