Search in sources :

Example 11 with ZyGraphViewSettings

use of com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings 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 12 with ZyGraphViewSettings

use of com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings in project binnavi by google.

the class CSettingsDialogFunctions method showCallgraphSettingsDialog.

/**
   * Shows the initial call graph settings dialog.
   * 
   * @param parent Parent window used for dialogs.
   */
public static void showCallgraphSettingsDialog(final JFrame parent) {
    final ZyGraphViewSettings settings = ConfigManager.instance().getDefaultCallGraphSettings();
    final CGraphSettingsDialog dlg = new CGraphSettingsDialog(parent, "Initial Call graph Settings", settings, true, true);
    dlg.setVisible(true);
    ConfigManager.instance().updateCallgraphSettings(settings);
    ConfigManager.instance().saveSettings(parent);
}
Also used : ZyGraphViewSettings(com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings) CGraphSettingsDialog(com.google.security.zynamics.binnavi.Gui.GraphSettings.CGraphSettingsDialog)

Example 13 with ZyGraphViewSettings

use of com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings in project binnavi by google.

the class CGraphBuilder method loadNativeSettings.

/**
   * Generates the default graph settings for a native view.
   *
   * @param view The view whose graph settings are generated.
   *
   * @return The generated graph settings.
   */
private static Pair<Map<String, String>, ZyGraphViewSettings> loadNativeSettings(final INaviView view) {
    final ConfigManager configFile = ConfigManager.instance();
    // Native views receive the default settings when they are loaded.
    final ZyGraphViewSettings graphSettings = view.getGraphType() == GraphType.CALLGRAPH ? configFile.getDefaultCallGraphSettings() : configFile.getDefaultFlowGraphSettings();
    graphSettings.getProximitySettings().setProximityBrowsing(view.getGraph().nodeCount() >= graphSettings.getProximitySettings().getProximityBrowsingActivationThreshold());
    return new Pair<Map<String, String>, ZyGraphViewSettings>(new HashMap<String, String>(), graphSettings);
}
Also used : ZyGraphViewSettings(com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings) ConfigManager(com.google.security.zynamics.binnavi.config.ConfigManager) Pair(com.google.security.zynamics.zylib.general.Pair)

Aggregations

ZyGraphViewSettings (com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings)13 NaviNode (com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode)4 ZyGraph (com.google.security.zynamics.binnavi.yfileswrap.zygraph.ZyGraph)3 ZyGraph2DView (com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.ZyGraph2DView)3 MockSqlProvider (com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider)2 CGraphSettingsDialog (com.google.security.zynamics.binnavi.Gui.GraphSettings.CGraphSettingsDialog)2 CDefaultModifier (com.google.security.zynamics.binnavi.ZyGraph.Builders.Modifiers.CDefaultModifier)2 CallGraphSettingsConfigItem (com.google.security.zynamics.binnavi.config.CallGraphSettingsConfigItem)2 DebuggerProvider (com.google.security.zynamics.binnavi.debug.debugger.DebuggerProvider)2 ModuleTargetSettings (com.google.security.zynamics.binnavi.debug.debugger.ModuleTargetSettings)2 NaviEdge (com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviEdge)2 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)2 Pair (com.google.security.zynamics.zylib.general.Pair)2 Edge (y.base.Edge)2 Node (y.base.Node)2 CDatabase (com.google.security.zynamics.binnavi.Database.CDatabase)1 MockDatabase (com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase)1 MockDebugger (com.google.security.zynamics.binnavi.Debug.Debugger.MockDebugger)1 CComment (com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.CComment)1 INodeModifier (com.google.security.zynamics.binnavi.ZyGraph.Builders.Modifiers.INodeModifier)1