Search in sources :

Example 46 with INaviModule

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

the class PostgreSQLProviderTest method testCModuleFunctionsgetViewsWithAddresses4.

@Test(expected = NullPointerException.class)
public void testCModuleFunctionsgetViewsWithAddresses4() throws CouldntLoadDataException {
    final INaviModule module = getProvider().loadModules().get(0);
    PostgreSQLModuleFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), module, null, true);
}
Also used : INaviModule(com.google.security.zynamics.binnavi.disassembly.INaviModule) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 47 with INaviModule

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

the class PostgreSQLProviderTest method testTraceFunctionsSave1.

@Test
public void testTraceFunctionsSave1() throws CouldntLoadDataException, LoadCancelledException, CouldntSaveDataException {
    final INaviProject project = getProvider().createProject("SOME_PROJECT");
    getProvider().createTrace(project, "SOME_TRACE", "SOME_TRACE_DESCRIPTION");
    project.load();
    final TraceList trace = project.getContent().getTraces().get(0);
    final INaviModule module = getProvider().loadModules().get(0);
    module.load();
    final long tid = 0x1L;
    final UnrelocatedAddress address2 = new UnrelocatedAddress(new CAddress(0x1234));
    final BreakpointAddress address = new BreakpointAddress(module, address2);
    final TraceEventType type = TraceEventType.ECHO_BREAKPOINT;
    final List<TraceRegister> values = new ArrayList<>();
    final ITraceEvent event = new TraceEvent(tid, address, type, values);
    trace.addEvent(event);
    trace.setDescription("burzelbarf");
    PostgreSQLTraceFunctions.save((AbstractSQLProvider) getProvider(), trace);
    project.close();
    INaviProject project2 = null;
    for (final INaviProject cProject : getProvider().loadProjects()) {
        if (cProject.getConfiguration().getId() == project.getConfiguration().getId()) {
            project2 = cProject;
        }
    }
    getProvider().createTrace(project2, "SOME_TRACE_2", "SOME_TRACE_DESCRIPTION_2");
    project2.load();
    final TraceList trace2 = project2.getContent().getTraces().get(0);
    assertEquals("burzelbarf", trace2.getDescription());
}
Also used : TraceEventType(com.google.security.zynamics.binnavi.debug.models.trace.TraceEventType) ArrayList(java.util.ArrayList) CAddress(com.google.security.zynamics.zylib.disassembly.CAddress) INaviProject(com.google.security.zynamics.binnavi.disassembly.INaviProject) INaviModule(com.google.security.zynamics.binnavi.disassembly.INaviModule) UnrelocatedAddress(com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress) TraceRegister(com.google.security.zynamics.binnavi.debug.models.trace.TraceRegister) TraceList(com.google.security.zynamics.binnavi.debug.models.trace.TraceList) BreakpointAddress(com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress) ITraceEvent(com.google.security.zynamics.binnavi.debug.models.trace.interfaces.ITraceEvent) ITraceEvent(com.google.security.zynamics.binnavi.debug.models.trace.interfaces.ITraceEvent) TraceEvent(com.google.security.zynamics.binnavi.debug.models.trace.TraceEvent) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 48 with INaviModule

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

the class PostgreSQLProviderTest method testCTagFunctionsSetName.

@Test
public void testCTagFunctionsSetName() throws CouldntLoadDataException, CouldntSaveDataException, LoadCancelledException {
    final CTagManager tagManager = getProvider().loadTagManager(TagType.VIEW_TAG);
    tagManager.addTag(tagManager.getRootTag(), "Node Tag I");
    tagManager.addTag(tagManager.getRootTag(), "Node Tag II");
    tagManager.addTag(tagManager.getRootTag().getChildren().get(0), "Node Tag III");
    final ITreeNode<CTag> tag1 = tagManager.getRootTag().getChildren().get(0);
    final INaviModule module = getProvider().loadModules().get(0);
    module.load();
    PostgreSQLTagFunctions.setName((AbstractSQLProvider) getProvider(), tag1.getObject(), "foobar");
    module.close();
    final INaviModule module2 = getProvider().loadModules().get(0);
    module2.load();
    final CTagManager tagManager1 = getProvider().loadTagManager(TagType.VIEW_TAG);
    assertEquals("foobar", tagManager1.getRootTag().getChildren().get(0).getObject().getName());
}
Also used : INaviModule(com.google.security.zynamics.binnavi.disassembly.INaviModule) CTag(com.google.security.zynamics.binnavi.Tagging.CTag) CTagManager(com.google.security.zynamics.binnavi.Tagging.CTagManager) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 49 with INaviModule

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

the class PostgreSQLProviderTest method testCViewFunctionsUntagView2.

@Test(expected = NullPointerException.class)
public void testCViewFunctionsUntagView2() throws CouldntSaveDataException, CouldntLoadDataException {
    final INaviModule module = getProvider().loadModules().get(0);
    final CView view = (CView) module.getContent().getViewContainer().getViews().get(224);
    getProvider().removeTag(view, null);
}
Also used : CView(com.google.security.zynamics.binnavi.disassembly.views.CView) INaviModule(com.google.security.zynamics.binnavi.disassembly.INaviModule) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 50 with INaviModule

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

the class PostgreSQLProviderTest method testCDataFunctions1.

@Test
public void testCDataFunctions1() throws CouldntLoadDataException, LoadCancelledException {
    final INaviModule module = getProvider().loadModules().get(0);
    module.load();
    PostgreSQLDataFunctions.loadData((AbstractSQLProvider) getProvider(), (CModule) module);
}
Also used : INaviModule(com.google.security.zynamics.binnavi.disassembly.INaviModule) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Aggregations

INaviModule (com.google.security.zynamics.binnavi.disassembly.INaviModule)180 Test (org.junit.Test)105 ExpensiveBaseTest (com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest)69 INaviFunction (com.google.security.zynamics.binnavi.disassembly.INaviFunction)39 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)39 INaviView (com.google.security.zynamics.binnavi.disassembly.views.INaviView)29 UnrelocatedAddress (com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress)28 IAddress (com.google.security.zynamics.zylib.disassembly.IAddress)28 MockModule (com.google.security.zynamics.binnavi.disassembly.Modules.MockModule)24 BreakpointAddress (com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress)22 ArrayList (java.util.ArrayList)19 INaviInstruction (com.google.security.zynamics.binnavi.disassembly.INaviInstruction)18 CView (com.google.security.zynamics.binnavi.disassembly.views.CView)13 BigInteger (java.math.BigInteger)13 CTag (com.google.security.zynamics.binnavi.Tagging.CTag)12 CouldntSaveDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException)11 CTagManager (com.google.security.zynamics.binnavi.Tagging.CTagManager)11 CouldntLoadDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntLoadDataException)9 CAddressSpace (com.google.security.zynamics.binnavi.disassembly.AddressSpaces.CAddressSpace)9 COperandTree (com.google.security.zynamics.binnavi.disassembly.COperandTree)9