use of com.google.security.zynamics.binnavi.disassembly.INaviModule in project binnavi by google.
the class CView method save.
@Override
public void save() throws CouldntSaveDataException {
Preconditions.checkArgument(getType() == ViewType.NonNative, "IE00314: Native views can not be saved");
Preconditions.checkState(isLoaded(), "IE00315: View must be loaded before it can be saved");
if (m_configuration.isStored()) {
m_provider.save(this);
} else {
CView newView;
final INaviModule naviModule = m_configuration.getModule();
if (naviModule == null) {
newView = m_provider.createView(m_configuration.getProject(), this, getName(), m_configuration.getDescription());
} else {
newView = m_provider.createView(naviModule, this, getName(), m_configuration.getDescription());
}
m_configuration.setId(newView.getConfiguration().getId());
}
final IDirectedGraph<INaviViewNode, INaviEdge> graph = m_content.getGraph();
m_bbcount = graph.nodeCount();
m_edgecount = graph.edgeCount();
for (final INaviViewListener listener : m_listeners) {
listener.savedView(this);
}
m_configuration.updateModificationDate();
m_content.save();
m_lastGraphType = m_content.getGraphType();
// Update caches.
NodeCache.get(m_provider).addNodes(graph.getNodes());
EdgeCache.get(m_provider).addEdges(graph.getEdges());
}
use of com.google.security.zynamics.binnavi.disassembly.INaviModule in project binnavi by google.
the class BreakpointableNodeCounter method next.
@Override
public IterationMode next(final NaviNode node) {
final INaviViewNode viewNode = node.getRawNode();
if (viewNode instanceof INaviCodeNode) {
final INaviCodeNode codeNode = (INaviCodeNode) viewNode;
final INaviInstruction instruction = Iterables.getFirst(codeNode.getInstructions(), null);
final INaviModule module = instruction.getModule();
final BreakpointAddress address = new BreakpointAddress(module, new UnrelocatedAddress(instruction.getAddress()));
if (EchoBreakpointCollector.isBlocked(breakpointManager, address)) {
return IterationMode.CONTINUE;
}
++breakpointAbleNodeCount;
} else if (viewNode instanceof INaviFunctionNode) {
final INaviFunctionNode functionNode = (INaviFunctionNode) viewNode;
final INaviModule module = functionNode.getFunction().getModule();
final BreakpointAddress address = new BreakpointAddress(module, new UnrelocatedAddress(functionNode.getFunction().getAddress()));
if (EchoBreakpointCollector.isBlocked(breakpointManager, address)) {
return IterationMode.CONTINUE;
}
++breakpointAbleNodeCount;
}
return IterationMode.CONTINUE;
}
use of com.google.security.zynamics.binnavi.disassembly.INaviModule in project binnavi by google.
the class EchoBreakpointCollector method next.
@Override
public IterationMode next(final NaviNode node) {
final INaviViewNode viewNode = node.getRawNode();
if (viewNode instanceof INaviCodeNode) {
final INaviCodeNode codeNode = (INaviCodeNode) viewNode;
final INaviInstruction instruction = Iterables.getFirst(codeNode.getInstructions(), null);
final INaviModule module = instruction.getModule();
final BreakpointAddress address = new BreakpointAddress(module, new UnrelocatedAddress(instruction.getAddress()));
if (isBlocked(manager, address)) {
return IterationMode.CONTINUE;
}
NaviLogger.info("Adding Echo breakpoint %s to the active list", address.getAddress().getAddress().toHexString());
// Add the echo breakpoint to the list of active echo breakpoints
echoBreakpointAbleAddresses.add(address);
} else if (viewNode instanceof INaviFunctionNode) {
final INaviFunctionNode functionNode = (INaviFunctionNode) viewNode;
final INaviModule module = functionNode.getFunction().getModule();
final BreakpointAddress address = new BreakpointAddress(module, new UnrelocatedAddress(functionNode.getFunction().getAddress()));
if (isBlocked(manager, address)) {
return IterationMode.CONTINUE;
}
NaviLogger.info("Adding Echo breakpoint %s to the active list", address.getAddress().getAddress().toHexString());
// Add the echo breakpoint to the list of active echo breakpoints
echoBreakpointAbleAddresses.add(address);
}
return IterationMode.CONTINUE;
}
use of com.google.security.zynamics.binnavi.disassembly.INaviModule in project binnavi by google.
the class DebuggerTest method testRelocation5.
@Test(expected = NullPointerException.class)
public void testRelocation5() {
final INaviModule nativeModule = new MockModule();
final Module module = ModuleFactory.get(nativeModule);
debugger.toFilebase(module, null);
fail();
}
use of com.google.security.zynamics.binnavi.disassembly.INaviModule in project binnavi by google.
the class DebuggerTest method testRelocation3.
@Test(expected = NullPointerException.class)
public void testRelocation3() {
final INaviModule nativeModule = new MockModule();
final Module module = ModuleFactory.get(nativeModule);
debugger.toImagebase(module, null);
}
Aggregations