use of com.google.security.zynamics.reil.algorithms.mono.InstructionGraph in project binnavi by google.
the class ValueTracker method track.
public static IStateVector<InstructionGraphNode, ValueTrackerElement> track(final ReilFunction function) {
Preconditions.checkNotNull(function, "Error: function argument can not be null");
// Translate the given graph to an instruction graph
final InstructionGraph instructionGraph = createInitialGraph(function);
final StateVector<InstructionGraphNode, ValueTrackerElement> stateVector = createInitialStateVector(instructionGraph);
final ValueTrackerSolver tracker = new ValueTrackerSolver(instructionGraph, stateVector);
return tracker.solve();
}
use of com.google.security.zynamics.reil.algorithms.mono.InstructionGraph in project binnavi by google.
the class InstructionGraphTest method testEmpty.
@Test
public void testEmpty() {
final ReilGraph rg = new ReilGraph(new ArrayList<ReilBlock>(), new ArrayList<ReilEdge>());
final InstructionGraph g = InstructionGraph.create(rg);
assertEquals(0, g.nodeCount());
assertEquals(0, g.edgeCount());
}
use of com.google.security.zynamics.reil.algorithms.mono.InstructionGraph in project binnavi by google.
the class InstructionGraphTest method testTwoNodes.
@Test
public void testTwoNodes() {
final ReilBlock block1 = new ReilBlock(Lists.newArrayList(ReilHelpers.createNop(0)));
final ReilBlock block2 = new ReilBlock(Lists.newArrayList(ReilHelpers.createUndef(1, OperandSize.DWORD, "eax")));
final ReilEdge edge1 = new ReilEdge(block1, block2, EdgeType.JUMP_CONDITIONAL_FALSE);
ReilBlock.link(block1, block2, edge1);
final List<ReilBlock> blocks = Lists.newArrayList(block1, block2);
final List<ReilEdge> edges = Lists.newArrayList(edge1);
final ReilGraph rg = new ReilGraph(blocks, edges);
final InstructionGraph g = InstructionGraph.create(rg);
assertEquals(2, g.nodeCount());
assertEquals(1, g.edgeCount());
assertEquals(0, g.getNodes().get(0).getInstruction().getAddress().toLong());
assertEquals(1, g.getNodes().get(1).getInstruction().getAddress().toLong());
}
use of com.google.security.zynamics.reil.algorithms.mono.InstructionGraph in project binnavi by google.
the class InstructionGraphTest method testOneNode.
@Test
public void testOneNode() {
final ReilBlock block1 = new ReilBlock(Lists.newArrayList(ReilHelpers.createNop(0), ReilHelpers.createNop(0), ReilHelpers.createNop(0), ReilHelpers.createNop(0), ReilHelpers.createNop(0)));
final List<ReilBlock> blocks = Lists.<ReilBlock>newArrayList(block1);
final ReilGraph rg = new ReilGraph(blocks, new ArrayList<ReilEdge>());
final InstructionGraph g = InstructionGraph.create(rg);
assertEquals(5, g.nodeCount());
assertEquals(4, g.edgeCount());
}
Aggregations