Search in sources :

Example 1 with ReilInstructionGraphEdge

use of com.google.security.zynamics.reil.algorithms.mono2.common.instructiongraph.ReilInstructionGraphEdge in project binnavi by google.

the class CReilInstructionGraph method createInstructionEdge.

/**
 * Creates an instruction graph edge between the source node and the destination node and returns
 * the resulting yfiles edge.
 *
 * @param sourceNode The source node of the edge to be created.
 * @param destinationNode The destination node of the edge to be created.
 * @param isTrueEdge Boolean parameter to determine if the edge is a conditional true edge.
 *
 * @return The yfiles edge which has been created and inserted in the graph.
 */
private Edge createInstructionEdge(final Node sourceNode, final Node destinationNode, final boolean isTrueEdge) {
    final ReilInstruction reilInstruction = m_nodesMap.get(destinationNode).getReilInstruction();
    boolean isExitEdge = false;
    if (reilInstruction != null) {
        final IAddress reilInstructionAddress = reilInstruction.getAddress();
        if ((reilInstructionAddress.toLong() & 0xFF) == 0) {
            isExitEdge = true;
        }
    }
    final Edge edge = m_internalGraph.createEdge(sourceNode, destinationNode);
    m_edgesMap.put(edge, new ReilInstructionGraphEdge(isTrueEdge, isExitEdge));
    return edge;
}
Also used : ReilInstruction(com.google.security.zynamics.reil.ReilInstruction) ReilInstructionGraphEdge(com.google.security.zynamics.reil.algorithms.mono2.common.instructiongraph.ReilInstructionGraphEdge) IInstructionGraphEdge(com.google.security.zynamics.reil.algorithms.mono2.common.instructiongraph.interfaces.IInstructionGraphEdge) Edge(y.base.Edge) ReilEdge(com.google.security.zynamics.reil.ReilEdge) ReilInstructionGraphEdge(com.google.security.zynamics.reil.algorithms.mono2.common.instructiongraph.ReilInstructionGraphEdge) IAddress(com.google.security.zynamics.zylib.disassembly.IAddress)

Aggregations

ReilEdge (com.google.security.zynamics.reil.ReilEdge)1 ReilInstruction (com.google.security.zynamics.reil.ReilInstruction)1 ReilInstructionGraphEdge (com.google.security.zynamics.reil.algorithms.mono2.common.instructiongraph.ReilInstructionGraphEdge)1 IInstructionGraphEdge (com.google.security.zynamics.reil.algorithms.mono2.common.instructiongraph.interfaces.IInstructionGraphEdge)1 IAddress (com.google.security.zynamics.zylib.disassembly.IAddress)1 Edge (y.base.Edge)1