Search in sources :

Example 41 with INaviView

use of com.google.security.zynamics.binnavi.disassembly.views.INaviView in project binnavi by google.

the class PostgreSQLProviderTest method testCNodeFunctionsUnTagNode1.

@Test
public void testCNodeFunctionsUnTagNode1() throws CouldntSaveDataException, CouldntLoadDataException, LoadCancelledException, CPartialLoadException {
    final INaviModule module = getProvider().loadModules().get(0);
    module.load();
    final INaviView view = module.getContent().getViewContainer().getViews().get(0);
    view.load();
    PostgreSQLNodeFunctions.untagNode(getProvider(), view.getGraph().getNodes().get(0), 1);
}
Also used : INaviView(com.google.security.zynamics.binnavi.disassembly.views.INaviView) INaviModule(com.google.security.zynamics.binnavi.disassembly.INaviModule) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 42 with INaviView

use of com.google.security.zynamics.binnavi.disassembly.views.INaviView in project binnavi by google.

the class PostgreSQLProviderTestSetup method testCreateViewModule4.

@Test
public void testCreateViewModule4() throws CouldntLoadDataException, CouldntSaveDataException, CPartialLoadException, LoadCancelledException {
    final INaviModule module = getProvider().loadModules().get(0);
    module.load();
    final INaviView view = module.getContent().getViewContainer().getViews().get(223);
    view.load();
    final CView newView = getProvider().createView(module, view, "Module View Name", "Module View Description");
    assertEquals("Module View Name", newView.getName());
    assertEquals("Module View Description", newView.getConfiguration().getDescription());
}
Also used : CView(com.google.security.zynamics.binnavi.disassembly.views.CView) INaviView(com.google.security.zynamics.binnavi.disassembly.views.INaviView) INaviModule(com.google.security.zynamics.binnavi.disassembly.INaviModule) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 43 with INaviView

use of com.google.security.zynamics.binnavi.disassembly.views.INaviView in project binnavi by google.

the class PostgreSQLProviderTestSetup method testCreateViewProject4.

@Test(expected = CouldntSaveDataException.class)
public void testCreateViewProject4() throws CouldntSaveDataException, CouldntLoadDataException, LoadCancelledException, CPartialLoadException {
    final INaviView view = getKernel32Module().getContent().getViewContainer().getViews().get(223);
    view.load();
    getProvider().createView(new MockProject(), view, "View Name", null);
}
Also used : MockProject(com.google.security.zynamics.binnavi.disassembly.MockProject) INaviView(com.google.security.zynamics.binnavi.disassembly.views.INaviView) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 44 with INaviView

use of com.google.security.zynamics.binnavi.disassembly.views.INaviView in project binnavi by google.

the class ViewGenerator method createView.

/**
   * Creates a new REIL view from a list of REIL instructions.
   *
   * @param module The module where the view is created.
   * @param instructions The instructions which are put into the view.
   *
   * @return The new view.
   */
public static View createView(final Module module, final List<ReilInstruction> instructions) {
    Preconditions.checkNotNull(module, "Error: Module argument can not be null");
    Preconditions.checkNotNull(instructions, "Error: Instructions argument can not be null");
    final INaviView view = CReilViewCreator.create(module.getNative(), convert(instructions));
    return ObjectFinders.getObject(view, module.getViews());
}
Also used : INaviView(com.google.security.zynamics.binnavi.disassembly.views.INaviView)

Example 45 with INaviView

use of com.google.security.zynamics.binnavi.disassembly.views.INaviView in project binnavi by google.

the class Project method convertData.

/**
   * Converts the internal project data to API project data.
   */
private void convertData() {
    m_debuggerTemplates = new FilledList<DebuggerTemplate>();
    final List<DebuggerTemplate> apiTemplates = m_database.getDebuggerTemplateManager().getDebuggerTemplates();
    for (final com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate debuggerTemplate : m_project.getConfiguration().getDebuggers()) {
        m_debuggerTemplates.add(ObjectFinders.getObject(debuggerTemplate, apiTemplates));
    }
    m_traces = new FilledList<Trace>();
    for (final TraceList trace : m_project.getContent().getTraces()) {
        m_traces.add(new Trace(trace));
    }
    m_addressSpaces = new FilledList<AddressSpace>();
    for (final INaviAddressSpace addressSpace : m_project.getContent().getAddressSpaces()) {
        m_addressSpaces.add(new AddressSpace(m_database, this, addressSpace));
    }
    m_views = new FilledList<View>();
    for (final INaviView view : m_project.getContent().getViews()) {
        m_views.add(new View(this, view, m_nodeTagManager, m_viewTagManager));
    }
}
Also used : INaviView(com.google.security.zynamics.binnavi.disassembly.views.INaviView) INaviAddressSpace(com.google.security.zynamics.binnavi.disassembly.INaviAddressSpace) CAddressSpace(com.google.security.zynamics.binnavi.disassembly.AddressSpaces.CAddressSpace) INaviView(com.google.security.zynamics.binnavi.disassembly.views.INaviView) TraceList(com.google.security.zynamics.binnavi.debug.models.trace.TraceList) INaviAddressSpace(com.google.security.zynamics.binnavi.disassembly.INaviAddressSpace)

Aggregations

INaviView (com.google.security.zynamics.binnavi.disassembly.views.INaviView)121 Test (org.junit.Test)54 INaviModule (com.google.security.zynamics.binnavi.disassembly.INaviModule)29 INaviFunction (com.google.security.zynamics.binnavi.disassembly.INaviFunction)26 ExpensiveBaseTest (com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest)18 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)14 INaviViewNode (com.google.security.zynamics.binnavi.disassembly.INaviViewNode)13 CTag (com.google.security.zynamics.binnavi.Tagging.CTag)11 INaviInstruction (com.google.security.zynamics.binnavi.disassembly.INaviInstruction)10 CView (com.google.security.zynamics.binnavi.disassembly.views.CView)10 ArrayList (java.util.ArrayList)10 CouldntLoadDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntLoadDataException)9 CouldntSaveDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException)8 HashMap (java.util.HashMap)8 MockSqlProvider (com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider)7 IComment (com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.Interfaces.IComment)7 CProjectContainer (com.google.security.zynamics.binnavi.disassembly.CProjectContainer)7 IAddress (com.google.security.zynamics.zylib.disassembly.IAddress)7 FilledList (com.google.security.zynamics.zylib.types.lists.FilledList)7 MockTagManager (com.google.security.zynamics.binnavi.Tagging.MockTagManager)6