mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
GP-2099: Add Disassemble and Patch actions for polyglot traces.
This commit is contained in:
parent
78de8e6d49
commit
bec99cd71e
66 changed files with 2214 additions and 774 deletions
|
@ -702,6 +702,10 @@ public class AssemblyResolvedPatterns extends AssemblyResolution {
|
|||
* @return the iterable
|
||||
*/
|
||||
public Iterable<byte[]> possibleInsVals(AssemblyPatternBlock forCtx) {
|
||||
AssemblyPatternBlock ctxCompat = ctx.combine(forCtx);
|
||||
if (ctxCompat == null) {
|
||||
return List.of();
|
||||
}
|
||||
Predicate<byte[]> removeForbidden = (byte[] val) -> {
|
||||
for (AssemblyResolvedPatterns f : forbids) {
|
||||
// If the forbidden length is larger than us, we can ignore it
|
||||
|
|
|
@ -70,6 +70,11 @@ public class ARMAssemblyTest extends AbstractAssemblyTest {
|
|||
assertOneCompatRestExact("ands r0,r5", "28:40", THUMB, 0x00400000, "ands r0,r5");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAssemble_T_movs_r0_r0() {
|
||||
assertOneCompatRestExact("movs r0,r0", "00:00", THUMB, 0x00400000, "movs r0,r0");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAssemble_T_bl_0x00008000() {
|
||||
// What makes this different from the above test is that it jumps backward
|
||||
|
|
|
@ -200,9 +200,8 @@ public abstract class AbstractAssemblyTest extends AbstractGenericTest {
|
|||
*/
|
||||
protected void checkAllExact(AssemblyResolutionResults rr, Collection<String> disassembly,
|
||||
long addr, String ctxstr) {
|
||||
final AssemblyPatternBlock ctx =
|
||||
(ctxstr == null ? context.getDefault() : AssemblyPatternBlock.fromString(ctxstr))
|
||||
.fillMask();
|
||||
final AssemblyPatternBlock ctx = (ctxstr == null ? context.getDefault()
|
||||
: AssemblyPatternBlock.fromString(ctxstr)).fillMask();
|
||||
dbg.println("Checking each: " + disassembly + " ctx:" + ctx);
|
||||
boolean gotOne = false;
|
||||
boolean failedOne = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue