use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.
the class CBookmarkTableModel method getBookmarkAddress.
/**
* Finds the bookmark address of the bookmark that is displayed in a given row of the table.
*
* @param row The table row where the bookmark is displayed.
*
* @return The bookmark address of the bookmark in the given row.
*/
private String getBookmarkAddress(final int row) {
final Triple<IDebugger, BookmarkManager, Integer> bookmarkTriple = CBookmarkTableHelpers.findBookmark(m_debuggerProvider, row);
final BookmarkManager manager = bookmarkTriple.second();
final int index = bookmarkTriple.third();
return manager.getBookmark(index).getAddress().toHexString();
}
use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.
the class CBookmarkTableModel method setBookmarkDescription.
/**
* Modifies the bookmark description of the bookmark displayed in the given row.
*
* @param row The row of the bookmark.
* @param description The new description of the bookmark.
*/
private void setBookmarkDescription(final int row, final String description) {
final Triple<IDebugger, BookmarkManager, Integer> bookmarkTriple = CBookmarkTableHelpers.findBookmark(m_debuggerProvider, row);
final BookmarkManager manager = bookmarkTriple.second();
final int index = bookmarkTriple.third();
manager.getBookmark(index).setDescription(description);
}
use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.
the class CBookmarkTableModel method getBookmarkDescription.
/**
* Finds the bookmark description of the bookmark that is displayed in a given row of the table.
*
* @param row The table row where the bookmark is displayed.
*
* @return The bookmark description of the bookmark in the given row.
*/
private String getBookmarkDescription(final int row) {
final Triple<IDebugger, BookmarkManager, Integer> bookmarkTriple = CBookmarkTableHelpers.findBookmark(m_debuggerProvider, row);
final BookmarkManager manager = bookmarkTriple.second();
final int index = bookmarkTriple.third();
return manager.getBookmark(index).getDescription();
}
use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.
the class CBookmarkFunctions method deleteBookmarks.
/**
* Deletes a list of bookmarks.
*
* @param provider Contains the debuggers where bookmarks can be set.
* @param rows The rows of the bookmarks to delete.
*/
public static void deleteBookmarks(final BackEndDebuggerProvider provider, final int[] rows) {
Preconditions.checkNotNull(provider, "IE01329: Provider argument can not be null");
Preconditions.checkNotNull(rows, "IE01330: Rows argument can not be null");
final ArrayList<Pair<BookmarkManager, CBookmark>> bookmarks = new ArrayList<Pair<BookmarkManager, CBookmark>>();
for (final int row : rows) {
final Triple<IDebugger, BookmarkManager, Integer> bookmarkTriple = CBookmarkTableHelpers.findBookmark(provider, row);
final BookmarkManager manager = bookmarkTriple.second();
final int index = bookmarkTriple.third();
bookmarks.add(Pair.make(manager, manager.getBookmark(index)));
}
for (final Pair<BookmarkManager, CBookmark> p : bookmarks) {
p.first().removeBookmark(p.second());
}
}
use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.
the class CCodeNodeUpdater method generateContent.
@Override
public void generateContent(final IZyNodeRealizer realizer, final ZyLabelContent content) {
ZyCodeNodeBuilder.buildContent(content, codeNode, graph.getSettings(), nodeModifier);
for (final INaviInstruction instruction : codeNode.getInstructions()) {
final INaviModule module = instruction.getModule();
if ((provider != null) && (provider.getDebugger(module) != null) && graph.getSettings().getDisplaySettings().getShowMemoryAddresses(provider.getDebugger(module))) {
final int line = CCodeNodeHelpers.instructionToLine(codeNode, instruction);
if (line != -1) {
final ZyLineContent lineContent = this.realizer.getNodeContent().getLineContent(line);
// TODO(timkornau) x64
lineContent.setTextColor(0, 8, Color.RED);
}
}
}
// Set highlighting for breakpoints and the instruction pointer.
final INaviInstruction instruction = codeNode.getInstructions().iterator().next();
if (instruction != null) {
final INaviModule module = instruction.getModule();
final IDebugger debugger = provider.getDebugger(module);
if (debugger == null) {
return;
}
final BreakpointManager manager = debugger.getBreakpointManager();
CBreakpointPainter.paintBreakpoints(manager, node, codeNode);
if (debugger.getProcessManager().getActiveThread() != null) {
final RelocatedAddress instructionPointer = debugger.getProcessManager().getActiveThread().getCurrentAddress();
final MemoryModule memoryModule = debugger.getProcessManager().getModule(instructionPointer);
final UnrelocatedAddress unrelocatedIP = new DefaultAddressConverter(memoryModule.getBaseAddress().getAddress(), module.getConfiguration().getFileBase()).memoryToFile(instructionPointer);
CDebuggerPainter.updateSingleNodeDebuggerHighlighting(graph, unrelocatedIP, node);
}
}
}
Aggregations