Skip to content

Ghidra is a software reverse engineering (SRE) framework

Merge remote-tracking branch 'origin/patch'

Ryan Kurtz30bbca7d3f04
diff --cc Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/MachoLoader.java
index cc0923a054,1ca4ad0332..716df7bf46
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/MachoLoader.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/MachoLoader.java
@@@ -537,13 -535,21 +537,18 @@@ public class MachoLoader extends Abstra
* @throws IOException if an IO-related error occurred
*/
private String detectCompilerName(MachHeader machHeader) throws IOException {
- List<String> sectionNames = machHeader.parseSegments()
- .stream()
- .flatMap(seg -> seg.getSections().stream())
- .map(section -> section.getSectionName())
- .toList();
- if (GoRttiMapper.hasGolangSections(sectionNames)) {
- return GoConstants.GOLANG_CSPEC_NAME;
+ try {
+ List<String> sectionNames = machHeader.parseSegments()
+ .stream()
+ .flatMap(seg -> seg.getSections().stream())
+ .map(section -> section.getSectionName())
+ .toList();
- if (SwiftUtils.isSwift(sectionNames)) {
- return SwiftUtils.SWIFT_COMPILER;
- }
+ if (GoRttiMapper.hasGolangSections(sectionNames)) {
+ return GoConstants.GOLANG_CSPEC_NAME;
+ }
+ }
+ catch (MachException e) {
+ // fall thru
}
return null;
}