Search in sources :

Example 1 with Addition

use of com.google.security.zynamics.reil.algorithms.mono.valuetracking.elements.Addition in project binnavi by google.

the class AddTransformerTest method testAddRegisterConstant.

@Test
public void testAddRegisterConstant() {
    final ReilInstruction instruction = ReilHelpers.createAdd(0x100, OperandSize.DWORD, "t0", OperandSize.DWORD, "4", OperandSize.QWORD, "t1");
    final ValueTrackerElement state = new ValueTrackerElement();
    final ValueTrackerElement result = AddTransformer.transform(instruction, state);
    assertTrue(result.getState("t1") instanceof Addition);
    assertTrue(((Addition) result.getState("t1")).getLhs() instanceof Symbol);
    assertTrue(((Addition) result.getState("t1")).getRhs() instanceof Literal);
}
Also used : ReilInstruction(com.google.security.zynamics.reil.ReilInstruction) Addition(com.google.security.zynamics.reil.algorithms.mono.valuetracking.elements.Addition) Symbol(com.google.security.zynamics.reil.algorithms.mono.valuetracking.elements.Symbol) Literal(com.google.security.zynamics.reil.algorithms.mono.valuetracking.elements.Literal) ValueTrackerElement(com.google.security.zynamics.reil.algorithms.mono.valuetracking.ValueTrackerElement) Test(org.junit.Test)

Aggregations

ReilInstruction (com.google.security.zynamics.reil.ReilInstruction)1 ValueTrackerElement (com.google.security.zynamics.reil.algorithms.mono.valuetracking.ValueTrackerElement)1 Addition (com.google.security.zynamics.reil.algorithms.mono.valuetracking.elements.Addition)1 Literal (com.google.security.zynamics.reil.algorithms.mono.valuetracking.elements.Literal)1 Symbol (com.google.security.zynamics.reil.algorithms.mono.valuetracking.elements.Symbol)1 Test (org.junit.Test)1