Skip to content

Ghidra is a software reverse engineering (SRE) framework

Merge branch 'GP-0_ryanmkurtz_PR-3784_GameCubeGBA_outOfBounds'

Ryan Kurtz0d2fb286806e
diff --cc Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/sem/AssemblyPatternBlock.java
index afd36e2c67,5b9fb2938e..7a4e82bf1f
--- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/sem/AssemblyPatternBlock.java
+++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/sem/AssemblyPatternBlock.java
@@@ -103,56 -98,9 +103,11 @@@ public class AssemblyPatternBlock imple
return res;
}
- /**
- * Convert the given long to a pattern block (having offset 0 and a full mask)
- *
- * <p>
- * <b>NOTE:</b> The result will be 8 bytes in length
- *
- * @param value the value to convert
- * @return the pattern block containing the big-endian representation of the value
- */
- public static AssemblyPatternBlock fromLong(long value) {
- byte[] mask = new byte[8];
- byte[] vals = new byte[8];
- for (int i = vals.length; i >= 0; i--) {
- mask[i] = -1;
- vals[i] = (byte) (value & 0xff);
- value >>= 8;
- }
- AssemblyPatternBlock res = new AssemblyPatternBlock(0, mask, vals);
- return res;
- }
-
- /**
- * Convert the given masked long to a pattern block (having offset 0)
- *
- * <p>
- * <b>NOTE:</b> The result will be 8 bytes in length
- *
- * @param ml the masked long, whose values and mask to convert
- * @return the pattern block containing the big-endian representation of the value
- */
- public static AssemblyPatternBlock fromMaskedLong(MaskedLong ml) {
- byte[] mask = new byte[8];
- byte[] vals = new byte[8];
- long lmask = ml.getMask();
- long value = ml.longValue();
- for (int i = vals.length; i >= 0; i--) {
- mask[i] = (byte) (lmask & 0xff);
- vals[i] = (byte) (value & 0xff);
- lmask >>= 8;
- value >>= 8;
- }
- AssemblyPatternBlock res = new AssemblyPatternBlock(0, mask, vals);
- return res;
- }
-
/**
* Convert a string representation to a pattern block
- * @see NumericUtilities#convertHexStringToMaskedValue(AtomicLong, AtomicLong, String, int, int, String)
+ *
+ * @see NumericUtilities#convertHexStringToMaskedValue(AtomicLong, AtomicLong, String, int, int,
+ * String)
* @param str the string to convert
* @return the resulting pattern block
*/