use of com.google.security.zynamics.binnavi.disassembly.views.INaviView in project binnavi by google.
the class CCodeNodeMenu method addRenameFunctionMenu.
private void addRenameFunctionMenu(final INaviCodeNode codeNode, final CGraphModel model) {
try {
final INaviFunction function = codeNode.getParentFunction();
final INaviView view = function.getModule().getContent().getViewContainer().getView(function);
add(new CChangeFunctionNameAction(model.getParent(), view));
} catch (final MaybeNullException e) {
// no parent function no menu entry we are ok with this.
}
}
use of com.google.security.zynamics.binnavi.disassembly.views.INaviView in project binnavi by google.
the class PostgreSQLTypeInstanceFunctionsTests method createTypeInstanceReference5.
@Test
public void createTypeInstanceReference5() throws CouldntSaveDataException, CouldntLoadDataException, LoadCancelledException, CPartialLoadException {
module.load();
final TypeInstance typeInstance = module.getContent().getTypeInstanceContainer().getTypeInstances().get(0);
final TypeInstanceAddress address1 = typeInstance.getAddress();
final INaviFunction function = module.getContent().getFunctionContainer().getFunction(new CAddress("1001929", 16));
final INaviView view = module.getContent().getViewContainer().getView(function);
view.load();
final INaviInstruction instruction = view.getBasicBlocks().get(1).getInstructions().iterator().next();
Assert.assertNotNull(typeInstance);
provider.createTypeInstanceReference(typeInstance.getModule().getConfiguration().getId(), instruction.getAddress().toLong(), instruction.getOperandPosition(instruction.getOperands().get(0)), instruction.getOperands().get(0).getNodes().get(0).getId(), typeInstance.getId());
view.close();
module.close();
module.load();
view.load();
final TypeInstance typeInstance2 = module.getContent().getTypeInstanceContainer().getTypeInstance(typeInstance.getAddress());
Assert.assertEquals(address1, typeInstance2.getAddress());
final List<TypeInstanceReference> references = module.getContent().getTypeInstanceContainer().getReferences(typeInstance2);
Assert.assertTrue(!references.isEmpty());
Assert.assertEquals(instruction.getAddress(), references.get(0).getAddress());
Assert.assertEquals(instruction.getOperandPosition(instruction.getOperands().get(0)), references.get(0).getPosition());
Assert.assertEquals(instruction.getOperands().get(0).getNodes().get(0).getId(), references.get(0).getTreeNode().get().getId());
Assert.assertEquals(typeInstance.getId(), references.get(0).getTypeInstance().getId());
}
use of com.google.security.zynamics.binnavi.disassembly.views.INaviView in project binnavi by google.
the class PostgreSQLProviderTest method testCViewFunctionsGetDerivedViews1.
@Test
public void testCViewFunctionsGetDerivedViews1() throws CouldntLoadDataException, LoadCancelledException, CPartialLoadException {
final INaviModule module = getProvider().loadModules().get(0);
module.load();
final List<INaviView> views = module.getContent().getViewContainer().getViews();
final INaviView view = views.get(264);
view.load();
PostgreSQLViewFunctions.getDerivedViews((AbstractSQLProvider) getProvider(), view);
}
use of com.google.security.zynamics.binnavi.disassembly.views.INaviView in project binnavi by google.
the class PostgreSQLProviderTest method testCviewSaverSave1.
@Test
public void testCviewSaverSave1() throws CouldntLoadDataException, LoadCancelledException, CouldntSaveDataException, CPartialLoadException {
final INaviModule module = getProvider().loadModules().get(0);
module.load();
final INaviView view = module.getContent().getViewContainer().getViews().get(0);
PostgreSQLViewFunctions.setName((AbstractSQLProvider) getProvider(), view, "furzel");
view.load();
PostgreSQLViewSaver.save((AbstractSQLProvider) getProvider(), (CView) view);
module.close();
final INaviModule module2 = getProvider().loadModules().get(0);
module2.load();
final INaviView view2 = module2.getContent().getViewContainer().getViews().get(0);
assertEquals("furzel", view2.getName());
}
use of com.google.security.zynamics.binnavi.disassembly.views.INaviView in project binnavi by google.
the class PostgreSQLProviderTest method testCViewFunctionsStarView.
@Test
public void testCViewFunctionsStarView() throws CouldntLoadDataException, CPartialLoadException, LoadCancelledException, CouldntSaveDataException {
final INaviModule module = getProvider().loadModules().get(0);
module.load();
final List<INaviView> views = module.getContent().getViewContainer().getViews();
final INaviView view = views.get(264);
view.load();
PostgreSQLViewFunctions.starView((AbstractSQLProvider) getProvider(), (CView) view, true);
view.close();
module.close();
final INaviModule module2 = getProvider().loadModules().get(0);
module2.load();
final List<INaviView> views2 = module2.getContent().getViewContainer().getViews();
final INaviView view2 = views2.get(264);
view2.load();
assertTrue(view2.isStared());
PostgreSQLViewFunctions.starView((AbstractSQLProvider) getProvider(), (CView) view2, false);
view2.close();
module2.close();
final INaviModule module3 = getProvider().loadModules().get(0);
module3.load();
final List<INaviView> views3 = module3.getContent().getViewContainer().getViews();
final INaviView view3 = views3.get(264);
view3.load();
assertFalse(view3.isStared());
}
Aggregations