mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-29 02:45:31 +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;
|
// return compilerType;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// Now look for offset to code (0x1000 for gcc) and PointerToSymbols
|
// Now look for PointerToSymbols (0 for VS, non-zero for gcc)
|
||||||
// (0 for VS, non-zero for gcc)
|
|
||||||
int addrCode = br.readInt(dh.e_lfanew() + 40);
|
|
||||||
if (addrCode != 0x1000) {
|
|
||||||
compilerType = CompilerEnum.VisualStudio;
|
|
||||||
return compilerType;
|
|
||||||
}
|
|
||||||
|
|
||||||
int ptrSymTable = br.readInt(dh.e_lfanew() + 12);
|
int ptrSymTable = br.readInt(dh.e_lfanew() + 12);
|
||||||
if (ptrSymTable != 0) {
|
if (ptrSymTable != 0) {
|
||||||
compilerType = CompilerEnum.GCC;
|
compilerType = CompilerEnum.GCC;
|
||||||
|
|||||||
Reference in New Issue
Block a user