Skip to content

Commit

Permalink
parse correct ldef file for Apple Silicon binaries (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
Enkelmann authored Sep 1, 2023
1 parent 08b72f6 commit f82ebc5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ghidra/p_code_extractor/internal/ParseCspecContent.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ public void warning(SAXParseException exception) throws SAXException {
*/
public static ResourceFile getLdefFile() {
String processorDef = String.format("%s.ldefs", program.getLanguage().getLanguageDescription().getProcessor().toString());
String languageId = program.getLanguageID().toString();

if (processorDef.startsWith("AARCH64") && languageId.endsWith("AppleSilicon")) {
processorDef = "AppleSilicon.ldef";
}
if(processorDef.startsWith("MIPS") || processorDef.startsWith("AVR")) {
processorDef = processorDef.toLowerCase();
}
Expand Down

0 comments on commit f82ebc5

Please sign in to comment.