use of com.google.security.zynamics.reil.interpreter.ReilInterpreter in project binnavi by google.
the class InterpreterTest method testAdd2.
@Test
public void testAdd2() throws InterpreterException {
final ReilInterpreter interpreter = new ReilInterpreter(Endianness.LITTLE_ENDIAN, new CpuPolicyX86(), new EmptyInterpreterPolicy());
final HashMap<BigInteger, List<ReilInstruction>> instructions = new HashMap<BigInteger, List<ReilInstruction>>();
instructions.put(BigInteger.ZERO, Lists.newArrayList(ReilHelpers.createAdd(0, OperandSize.DWORD, "2147483648", OperandSize.DWORD, "4294967295", OperandSize.QWORD, "t0")));
interpreter.interpret(instructions, BigInteger.ZERO);
assertEquals(BigInteger.valueOf(0x17FFFFFFFL), interpreter.getVariableValue("t0"));
}
use of com.google.security.zynamics.reil.interpreter.ReilInterpreter in project binnavi by google.
the class InterpreterTest method testAdd.
@Test
public void testAdd() throws InterpreterException {
final ReilInterpreter interpreter = new ReilInterpreter(Endianness.LITTLE_ENDIAN, new CpuPolicyX86(), new EmptyInterpreterPolicy());
final HashMap<BigInteger, List<ReilInstruction>> instructions = new HashMap<BigInteger, List<ReilInstruction>>();
instructions.put(BigInteger.ZERO, Lists.newArrayList(ReilHelpers.createAdd(0, OperandSize.DWORD, "2147483647", OperandSize.DWORD, "1", OperandSize.QWORD, "t0")));
interpreter.interpret(instructions, BigInteger.ZERO);
assertEquals(BigInteger.valueOf(0x80000000L), interpreter.getVariableValue("t0"));
}
Aggregations