mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-29 06:45:48 +08:00
Merge branch 'GP-0_ryanmkurtz_PR-3784_GameCubeGBA_outOfBounds'
Conflicts: Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/sem/AssemblyPatternBlock.java
This commit is contained in:
-45
@@ -103,51 +103,6 @@ public class AssemblyPatternBlock implements Comparable<AssemblyPatternBlock> {
|
|||||||
return res;
|
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
|
* Convert a string representation to a pattern block
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user