Skip to content

Ghidra is a software reverse engineering (SRE) framework

Disable SLEIGH endian check for mixed endian architectures

caheckman797fb6900501
diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/processors/sleigh/SleighLanguage.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/processors/sleigh/SleighLanguage.java
index c900152a38..f45f183e38 100644
--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/processors/sleigh/SleighLanguage.java
+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/processors/sleigh/SleighLanguage.java
@@ -888,11 +888,13 @@ public class SleighLanguage implements Language {
throw new SleighException(".sla file for " + getLanguageID() + " has the wrong format");
}
boolean isBigEndian = SpecXmlUtils.decodeBoolean(el.getAttribute("bigendian"));
- // check the instruction endianess, not the program data endianess
if (isBigEndian ^ description.getEndian().isBigEndian()) {
- throw new SleighException(
- ".ldefs says " + getLanguageID() + " is " + description.getEndian() +
- " but .sla says " + el.getAttribute("bigendian"));
+ if (description.getInstructionEndian().isBigEndian() == description.getEndian()
+ .isBigEndian()) {
+ throw new SleighException(
+ ".ldefs says " + getLanguageID() + " is " + description.getEndian() +
+ " but .sla says " + el.getAttribute("bigendian"));
+ }
}
uniqueBase = SpecXmlUtils.decodeLong(el.getAttribute("uniqbase"));
alignment = SpecXmlUtils.decodeInt(el.getAttribute("align"));