From a2bcc7a3d20c832267de5ed86389a36020ed7fa2 Mon Sep 17 00:00:00 2001 From: Wiz <95232096+GameCubeGBA@users.noreply.github.com> Date: Mon, 20 Dec 2021 12:51:47 -0500 Subject: [PATCH] Fix array backwards access when obtaining an assembly pattern block from longs Removed the code anyway, since it is dead. --- .../sleigh/sem/AssemblyPatternBlock.java | 39 ------------------- 1 file changed, 39 deletions(-) diff --git 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 index 50006cb542..5b9fb2938e 100644 --- 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 @@ -98,45 +98,6 @@ public class AssemblyPatternBlock implements Comparable { return res; } - /** - * Convert the given long to a pattern block (having offset 0 and a full mask) - * NOTE: 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) - * NOTE: 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)