use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate in project binnavi by google.
the class ProjectFactory method get.
public static Project get() {
final MockSqlProvider provider = new MockSqlProvider();
final Date creationDate = new Date();
final Date modificationDate = new Date();
final CProject internalProject = new CProject(123, "Name", "Comment", creationDate, modificationDate, 55, new FilledList<DebuggerTemplate>(), provider);
final TagManager nodeTagManager = new TagManager(new CTagManager(new Tree<CTag>(new TreeNode<CTag>(new CTag(0, "", "", TagType.NODE_TAG, provider))), TagType.NODE_TAG, provider));
final TagManager viewTagManager = new TagManager(new CTagManager(new Tree<CTag>(new TreeNode<CTag>(new CTag(0, "", "", TagType.VIEW_TAG, provider))), TagType.VIEW_TAG, provider));
final Database db = new Database(new MockDatabase());
return new Project(db, internalProject, nodeTagManager, viewTagManager);
}
use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate in project binnavi by google.
the class InstructionTest method testConstructor.
@Test
public void testConstructor() throws CouldntLoadDataException, LoadCancelledException {
final SQLProvider provider = new MockSqlProvider();
final CModule internalModule = new CModule(123, "Name", "Comment", new Date(), new Date(), "12345678123456781234567812345678", "1234567812345678123456781234567812345678", 55, 66, new CAddress(0x555), new CAddress(0x666), new DebuggerTemplate(1, "Mock Debugger", "localhaus", 88, provider), null, Integer.MAX_VALUE, false, provider);
internalModule.load();
final COperandTreeNode rootNode1 = new COperandTreeNode(1, IOperandTree.NODE_TYPE_REGISTER_ID, "eax", null, new ArrayList<IReference>(), provider, internalModule.getTypeManager(), internalModule.getContent().getTypeInstanceContainer());
final COperandTreeNode rootNode2 = new COperandTreeNode(1, IOperandTree.NODE_TYPE_REGISTER_ID, "ebx", null, new ArrayList<IReference>(), provider, internalModule.getTypeManager(), internalModule.getContent().getTypeInstanceContainer());
final COperandTree operand1 = new COperandTree(rootNode1, provider, internalModule.getTypeManager(), internalModule.getContent().getTypeInstanceContainer());
final COperandTree operand2 = new COperandTree(rootNode2, provider, internalModule.getTypeManager(), internalModule.getContent().getTypeInstanceContainer());
final List<COperandTree> operands = Lists.newArrayList(operand1, operand2);
final CInstruction internalInstruction = new CInstruction(false, internalModule, new CAddress(0x123), "mov", operands, new byte[] { 1, 2, 3 }, "x86-32", provider);
final Instruction instruction = new Instruction(internalInstruction);
assertEquals(0x123, instruction.getAddress().toLong());
assertEquals(null, instruction.getComment());
assertArrayEquals(new byte[] { 1, 2, 3 }, instruction.getData());
assertEquals("mov", instruction.getMnemonic());
assertEquals(2, instruction.getOperands().size());
assertEquals("eax", instruction.getOperands().get(0).getRootNode().getChildren().get(0).getValue());
assertEquals("ebx", instruction.getOperands().get(1).getRootNode().getChildren().get(0).getValue());
assertEquals("123 mov eax, ebx", instruction.toString());
assertEquals("x86-32", instruction.getArchitecture());
}
use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate in project binnavi by google.
the class PostgreSQLProviderTestTeardown method testDeleteDebugger2.
@Test
public void testDeleteDebugger2() throws CouldntDeleteException, CouldntLoadDataException {
final DebuggerTemplate debuggerTemplate = getProvider().loadDebuggers().getDebugger(0);
getProvider().deleteDebugger(debuggerTemplate);
}
use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate in project binnavi by google.
the class PostgreSQLProviderTest method testSetNameDebugge3.
@Test(expected = NullPointerException.class)
public void testSetNameDebugge3() throws CouldntSaveDataException, CouldntLoadDataException {
final DebuggerTemplate debuggerTemplate = getProvider().loadDebuggers().getDebugger(0);
getProvider().setName(debuggerTemplate, null);
}
use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate in project binnavi by google.
the class CDebuggerChooserPanel method updateDebuggerLabel.
/**
* Updates the debugger label in case the module is local to an address space.
*/
private void updateDebuggerLabel() {
final DebuggerTemplate debugger = m_addressSpace.getConfiguration().getDebuggerTemplate();
m_debuggerName.setText(debugger == null ? "-" : debugger.getName());
}
Aggregations