Search in sources :

Example 36 with NaviNode

use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.

the class CSelectionHistoryChooser method insertSnapshot.

/**
   * Adds a new selection state to the history chooser.
   * 
   * @param snapshot Provides information about the selection state to add.
   */
private void insertSnapshot(final CSelectionSnapshot snapshot) {
    // New Group node
    final CSelectionHistoryTreeNode selection = new CSelectionHistoryTreeNode(snapshot, m_stateIndex);
    // Add the selected node addresses to the group node
    for (final NaviNode node : snapshot.getSelection()) {
        selection.add(new CNodeNode(node));
    }
    m_stateIndex++;
    // Add the new group node to the
    m_model.insertNodeInto(selection, (CSelectionHistoryTreeNode) m_model.getRoot(), 0);
}
Also used : NaviNode(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode)

Example 37 with NaviNode

use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.

the class CSelectionHistoryNodeWrapper method toString.

@Override
public String toString() {
    int visible = 0;
    int invisible = 0;
    int selected = 0;
    int all = 0;
    final List<NaviNode> selection = m_operation.getSelection();
    for (final NaviNode graphnode : selection) {
        all++;
        if (graphnode.getRawNode().isVisible()) {
            if (graphnode.getRawNode().isSelected()) {
                selected++;
            }
            visible++;
        } else {
            invisible++;
        }
    }
    return String.format("%d-%s (%d/%d/%d/%d)", m_stateIndex, m_operation.getDescription(), selected, visible, invisible, all);
}
Also used : NaviNode(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode)

Example 38 with NaviNode

use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.

the class CTaggedGraphNodeNodeTest method test2getGraphNode.

@Test
public void test2getGraphNode() throws FileReadException, CouldntLoadDataException, LoadCancelledException, CouldntSaveDataException {
    final ZyGraph graph = ZyGraphFactory.generateTestGraph();
    final CCodeNode node = graph.getRawView().getBasicBlocks().get(0);
    final NaviNode naviNode = graph.getNode(node);
    final CTaggedGraphNodeNode taggedNode = new CTaggedGraphNodeNode(graph, naviNode);
    assertEquals(naviNode, taggedNode.getGraphNode());
}
Also used : ZyGraph(com.google.security.zynamics.binnavi.yfileswrap.zygraph.ZyGraph) CCodeNode(com.google.security.zynamics.binnavi.disassembly.CCodeNode) NaviNode(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode) Test(org.junit.Test)

Example 39 with NaviNode

use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.

the class CBreakpointTableTest method testAddedDebugger.

/**
   * This test is making sure that listeners are correctly attached to new debuggers.
   *
   * @throws CouldntSaveDataException
   * @throws FileReadException
   */
@Test
public void testAddedDebugger() throws CouldntSaveDataException, FileReadException {
    ConfigManager.instance().read();
    final INaviModule mockModule = new MockModule();
    final DebugTargetSettings target = new ModuleTargetSettings(mockModule);
    final DebuggerProvider debuggerProvider = new DebuggerProvider(target);
    final ZyGraphViewSettings settings = new ZyGraphViewSettings(new FlowGraphSettingsConfigItem());
    settings.getLayoutSettings().setDefaultGraphLayout(LayoutStyle.CIRCULAR);
    final ZyGraph graph = new ZyGraph(new MockView(), new LinkedHashMap<Node, NaviNode>(), new LinkedHashMap<Edge, NaviEdge>(), settings, new ZyGraph2DView());
    final IViewContainer viewContainer = new MockViewContainer();
    final CBreakpointTable table = new CBreakpointTable(debuggerProvider, graph, viewContainer);
    final MockDebugger debugger = new MockDebugger(new ModuleTargetSettings(mockModule));
    final MockModule module = new MockModule();
    debugger.getBreakpointManager().addBreakpoints(BreakpointType.REGULAR, Sets.newHashSet(new BreakpointAddress(module, new UnrelocatedAddress(new CAddress(0)))));
    debuggerProvider.addDebugger(debugger);
    table.dispose();
}
Also used : FlowGraphSettingsConfigItem(com.google.security.zynamics.binnavi.config.FlowGraphSettingsConfigItem) IViewContainer(com.google.security.zynamics.binnavi.disassembly.views.IViewContainer) MockViewContainer(com.google.security.zynamics.binnavi.disassembly.MockViewContainer) ZyGraphViewSettings(com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings) MockView(com.google.security.zynamics.binnavi.disassembly.MockView) ZyGraph(com.google.security.zynamics.binnavi.yfileswrap.zygraph.ZyGraph) Node(y.base.Node) NaviNode(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode) NaviNode(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode) DebugTargetSettings(com.google.security.zynamics.binnavi.debug.debugger.DebugTargetSettings) ModuleTargetSettings(com.google.security.zynamics.binnavi.debug.debugger.ModuleTargetSettings) CAddress(com.google.security.zynamics.zylib.disassembly.CAddress) MockDebugger(com.google.security.zynamics.binnavi.Debug.Debugger.MockDebugger) INaviModule(com.google.security.zynamics.binnavi.disassembly.INaviModule) MockModule(com.google.security.zynamics.binnavi.disassembly.Modules.MockModule) DebuggerProvider(com.google.security.zynamics.binnavi.debug.debugger.DebuggerProvider) UnrelocatedAddress(com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress) ZyGraph2DView(com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.ZyGraph2DView) BreakpointAddress(com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress) NaviEdge(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviEdge) Edge(y.base.Edge) NaviEdge(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviEdge) Test(org.junit.Test)

Example 40 with NaviNode

use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.

the class CVisibilityEvaluatorTest method testComplete.

@Test
public void testComplete() {
    final NaviNode node = CNaviNodeFactory.get();
    assertTrue(CVisibilityEvaluator.evaluate(node, VisibilityState.VISIBLE));
    assertFalse(CVisibilityEvaluator.evaluate(node, VisibilityState.UNVISIBLE));
}
Also used : NaviNode(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode) Test(org.junit.Test)

Aggregations

NaviNode (com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode)60 Test (org.junit.Test)29 NaviEdge (com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviEdge)19 ZyNormalNodeRealizer (com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.realizers.ZyNormalNodeRealizer)11 GraphSearcher (com.google.security.zynamics.binnavi.yfileswrap.Gui.GraphWindows.Searchers.Text.Model.GraphSearcher)9 ZyGraph (com.google.security.zynamics.binnavi.yfileswrap.zygraph.ZyGraph)9 ZyLineContent (com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLineContent)8 CCodeNode (com.google.security.zynamics.binnavi.disassembly.CCodeNode)7 INaviCodeNode (com.google.security.zynamics.binnavi.disassembly.INaviCodeNode)6 INaviInstruction (com.google.security.zynamics.binnavi.disassembly.INaviInstruction)6 ZyLabelContent (com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLabelContent)6 SearchResult (com.google.security.zynamics.binnavi.Gui.GraphWindows.Searchers.Text.Model.SearchResult)5 INaviViewNode (com.google.security.zynamics.binnavi.disassembly.INaviViewNode)5 ArrayList (java.util.ArrayList)5 Node (y.base.Node)5 MockSqlProvider (com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider)4 ZyGraphViewSettings (com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings)4 CTextNode (com.google.security.zynamics.binnavi.disassembly.CTextNode)4 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)4 Edge (y.base.Edge)4