use of com.google.security.zynamics.binnavi.disassembly.CProject in project binnavi by google.
the class PostgreSQLProvider method createProject.
@Override
public CProject createProject(final String name) throws CouldntSaveDataException {
final CProject project = PostgreSQLProjectCreator.createProject(this, name);
projects.add(project);
return project;
}
use of com.google.security.zynamics.binnavi.disassembly.CProject in project binnavi by google.
the class PostgreSQLTypeInstanceFunctionsTests method setUp.
@Before
public void setUp() throws IOException, CouldntLoadDriverException, CouldntConnectException, IllegalStateException, CouldntLoadDataException, InvalidDatabaseException, CouldntInitializeDatabaseException, CouldntSaveDataException, InvalidExporterDatabaseFormatException, InvalidDatabaseVersionException, LoadCancelledException, FileReadException {
final String[] parts = CConfigLoader.loadPostgreSQL();
database = new CDatabase("None", CJdbcDriverNames.jdbcPostgreSQLDriverName, parts[0], "test_disassembly", parts[1], parts[2], parts[3], false, false);
database.connect();
database.load();
try {
final Field privateProviderField = CDatabase.class.getDeclaredField("provider");
privateProviderField.setAccessible(true);
provider = (SQLProvider) privateProviderField.get(database);
} catch (final Exception exception) {
throw new RuntimeException(exception);
}
provider.createDebuggerTemplate("Test Debugger", "localhost", 2222);
final CProject project = provider.createProject("Test Project");
provider.createAddressSpace(project, "Test Address Space");
ConfigManager.instance().read();
module = database.getContent().getModules().get(0);
}
use of com.google.security.zynamics.binnavi.disassembly.CProject in project binnavi by google.
the class PostgreSQLProviderTest method testSetImageBase1.
@Test
public void testSetImageBase1() throws CouldntSaveDataException, CouldntLoadDataException {
final CProject project = getProvider().createProject("SOME_TEST_PROJECT");
getProvider().createAddressSpace(project, "SOME_ADDRESS_SPACE");
final CAddressSpace addressSpace = getProvider().loadAddressSpaces(project).get(0);
final INaviModule module = getProvider().loadModules().get(0);
getProvider().setImageBase(addressSpace, module, new CAddress(BigInteger.valueOf(0)));
}
use of com.google.security.zynamics.binnavi.disassembly.CProject in project binnavi by google.
the class PostgreSQLProviderTest method testAddModule1.
@Test
public void testAddModule1() throws CouldntSaveDataException, CouldntLoadDataException, CouldntDeleteException {
final INaviModule module = getProvider().loadModules().get(0);
final CProject project = getProvider().createProject("FOOBAR_PROJECT");
getProvider().createAddressSpace(project, "FOOBAR_ADDRESS_SPACE");
final CAddressSpace as = getProvider().loadAddressSpaces(project).get(0);
getProvider().addModule(as, module);
try {
getProvider().addModule(as, module);
fail();
} catch (final CouldntSaveDataException exception) {
getProvider().removeModule(as, module);
}
}
use of com.google.security.zynamics.binnavi.disassembly.CProject in project binnavi by google.
the class PostgreSQLProviderTest method testCProjectCreatorCreateProject1.
@Test
public void testCProjectCreatorCreateProject1() throws CouldntSaveDataException, CouldntLoadDataException, LoadCancelledException {
final INaviModule module = getProvider().loadModules().get(0);
module.load();
final CProject project = PostgreSQLProjectCreator.createProject((AbstractSQLProvider) getProvider(), "new project 010");
project.load();
assertNotNull(project.getConfiguration().getId());
module.close();
project.close();
}
Aggregations