use of com.google.security.zynamics.binnavi.disassembly.INaviModule in project binnavi by google.
the class PostgreSQLProviderTest method testInstructionFunctionsAddReference6.
@Test(expected = CouldntSaveDataException.class)
public void testInstructionFunctionsAddReference6() throws CouldntSaveDataException, CouldntLoadDataException, LoadCancelledException {
final INaviModule module = getProvider().loadModules().get(1);
module.load();
final INaviFunction function = module.getContent().getFunctionContainer().getFunctions().get(1800);
function.load();
final IBlockNode basicBlock = function.getBasicBlocks().get(0);
final INaviInstruction instruction = Iterables.get(basicBlock.getInstructions(), 1);
final COperandTree tree = instruction.getOperands().get(0);
final INaviOperandTreeNode node = tree.getRootNode();
final IAddress address = instruction.getAddress();
final ReferenceType type = ReferenceType.DATA;
PostgreSQLInstructionFunctions.addReference(getProvider(), node, address, type);
}
use of com.google.security.zynamics.binnavi.disassembly.INaviModule in project binnavi by google.
the class PostgreSQLProviderTest method testInstructionFunctionsCreateInstruction1.
@Test
public void testInstructionFunctionsCreateInstruction1() throws SQLException, CouldntLoadDataException, LoadCancelledException {
final INaviModule module = getProvider().loadModules().get(0);
module.load();
final String mnemonic = "burzel";
final IAddress iAddress = new CAddress(0x1234);
final COperandTreeNode rootNode = module.createOperandExpression("eax", ExpressionType.REGISTER);
final COperandTree tree = new COperandTree(rootNode, getProvider(), module.getTypeManager(), module.getContent().getTypeInstanceContainer());
final List<COperandTree> operands = new ArrayList<COperandTree>();
operands.add(tree);
final byte[] data = { 0xF };
final String architecture = "x86-32";
final INaviInstruction instruction = module.createInstruction(iAddress, mnemonic, operands, data, architecture);
PostgreSQLInstructionFunctions.createInstructions(getProvider(), Lists.newArrayList(instruction));
}
use of com.google.security.zynamics.binnavi.disassembly.INaviModule in project binnavi by google.
the class PostgreSQLProviderTest method testCViewLoaderLoadView5.
@Test(expected = NullPointerException.class)
public void testCViewLoaderLoadView5() throws CouldntLoadDataException, LoadCancelledException, CPartialLoadException {
final INaviModule module = getProvider().loadModules().get(0);
final List<INaviModule> modules = new ArrayList<INaviModule>();
module.load();
final CView view = (CView) module.getContent().getViewContainer().getViews().get(224);
modules.add(module);
PostgreSQLViewLoader.loadView((AbstractSQLProvider) getProvider(), view, modules, null);
}
use of com.google.security.zynamics.binnavi.disassembly.INaviModule in project binnavi by google.
the class PostgreSQLProviderTest method testGetViewsWithAddressFail2.
@Test(expected = NullPointerException.class)
public void testGetViewsWithAddressFail2() throws CouldntLoadDataException {
final INaviModule module = getProvider().loadModules().get(0);
getProvider().getViewsWithAddresses(module, null, true);
}
use of com.google.security.zynamics.binnavi.disassembly.INaviModule 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