Search in sources :

Example 56 with IDebugger

use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.

the class CToolbarPanelSynchronizer method dispose.

/**
   * Frees allocated resources.
   */
public void dispose() {
    m_debugPerspectiveModel.removeListener(m_debugListener);
    final IDebugger activeDebugger = m_debugPerspectiveModel.getCurrentSelectedDebugger();
    synchronizeDebugger(activeDebugger, null);
}
Also used : IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)

Example 57 with IDebugger

use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.

the class CRefreshAction method actionPerformed.

@Override
public void actionPerformed(final ActionEvent event) {
    final IDebugger debugger = m_debugPerspectiveModel.getCurrentSelectedDebugger();
    if (debugger != null) {
        CMemorySelectionFunctions.refreshMemory(m_parent, debugger, m_rangeProvider.getAddress(), m_rangeProvider.getSize());
        final IAddress stackAddress = m_stackRangeProvider.getAddress();
        final int size = m_stackRangeProvider.getSize();
        if (stackAddress != null && size != 0) {
            CMemorySelectionFunctions.refreshMemory(m_parent, debugger, stackAddress, size);
        }
    }
}
Also used : IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger) IAddress(com.google.security.zynamics.zylib.disassembly.IAddress)

Example 58 with IDebugger

use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.

the class CMemorySelectionFunctions method askMemoryRange.

/**
   * Asks the user for a memory range and displays it afterwards.
   *
   * @param dlg Dialog where the user can select a range.
   * @param debugPerspectiveModel Describes the debug GUI perspective where the refresh action takes
   *        place.
   */
public static void askMemoryRange(final CMemoryRangeDialog dlg, final CDebugPerspectiveModel debugPerspectiveModel) {
    final IDebugger debugger = debugPerspectiveModel.getCurrentSelectedDebugger();
    if (debugger == null) {
        return;
    }
    dlg.setVisible(true);
    final IAddress start = dlg.getStart();
    final IAddress numberOfBytes = dlg.getBytes();
    if (start != null && numberOfBytes != null) {
        debugPerspectiveModel.setActiveMemoryAddress(start, true);
        final ProcessManager pmanager = debugger.getProcessManager();
        pmanager.setMemoryMap(new MemoryMap(new FilledList<MemorySection>()));
        pmanager.getMemory().clear();
        final ArrayList<MemorySection> sections = new ArrayList<MemorySection>();
        sections.add(new MemorySection(start, new CAddress(start.toBigInteger().add(numberOfBytes.toBigInteger()).subtract(BigInteger.ONE))));
        final MemoryMap map = new MemoryMap(sections);
        pmanager.setMemoryMap(map);
    }
}
Also used : MemoryMap(com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryMap) MemorySection(com.google.security.zynamics.binnavi.debug.models.processmanager.MemorySection) FilledList(com.google.security.zynamics.zylib.types.lists.FilledList) ArrayList(java.util.ArrayList) IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger) IAddress(com.google.security.zynamics.zylib.disassembly.IAddress) ProcessManager(com.google.security.zynamics.binnavi.debug.models.processmanager.ProcessManager) CAddress(com.google.security.zynamics.zylib.disassembly.CAddress)

Example 59 with IDebugger

use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.

the class CMemorySectionPanelSynchronizer method dispose.

/**
   * Frees allocated resources.
   */
public void dispose() {
    memorySectionBox.removeItemListener(memoryBoxListener);
    debugPerspectiveModel.removeListener(debugListener);
    final IDebugger activeDebugger = debugPerspectiveModel.getCurrentSelectedDebugger();
    if (activeDebugger != null) {
        synchronizeThreads(activeDebugger.getProcessManager().getActiveThread(), null);
    }
    synchronizeDebugger(debugPerspectiveModel.getCurrentSelectedDebugger(), null);
}
Also used : IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)

Example 60 with IDebugger

use of com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger in project binnavi by google.

the class CModulesPanelFunctions method gotoModule.

/**
   * Displays the beginning of a module in the memory viewer.
   * 
   * @param parent Parent window used for dialogs.
   * @param debugPerspectiveModel Debug perspective model that provides the active debugger.
   * @param module The module to show in the memory viewer.
   */
public static void gotoModule(final Window parent, final CDebugPerspectiveModel debugPerspectiveModel, final MemoryModule module) {
    Preconditions.checkNotNull(parent, "IE01462: Parent argument can not be null");
    Preconditions.checkNotNull(debugPerspectiveModel, "IE01463: Debug perspective model argument can not be null");
    Preconditions.checkNotNull(module, "IE01464: Module argument can not be null");
    final IDebugger debugger = debugPerspectiveModel.getCurrentSelectedDebugger();
    if (debugger == null) {
        return;
    }
    final MemoryMap memoryMap = debugger.getProcessManager().getMemoryMap();
    final MemorySection section = ProcessHelpers.getSectionWith(memoryMap, module.getBaseAddress().getAddress());
    if (section == null) {
        final String message = String.format("E00046: " + "Could not display module '%s' in the memory view", module.getName());
        final String description = String.format("The module '%s' could not be displayed in the memory view because " + "the offset %s is not currently known to BinNavi. " + "Try refreshing the memory map to fix this issue.", module.getName(), module.getBaseAddress());
        NaviErrorDialog.show(parent, message, description);
    } else {
        CMemoryFunctions.gotoOffset(debugPerspectiveModel, module.getBaseAddress().getAddress(), true);
    }
}
Also used : MemoryMap(com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryMap) MemorySection(com.google.security.zynamics.binnavi.debug.models.processmanager.MemorySection) IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)

Aggregations

IDebugger (com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)62 BreakpointManager (com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager)16 TargetProcessThread (com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread)16 MockDebugger (com.google.security.zynamics.binnavi.Debug.Debugger.MockDebugger)6 ModuleTargetSettings (com.google.security.zynamics.binnavi.debug.debugger.ModuleTargetSettings)6 Breakpoint (com.google.security.zynamics.binnavi.debug.models.breakpoints.Breakpoint)6 BreakpointAddress (com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress)6 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)6 Test (org.junit.Test)6 MemorySection (com.google.security.zynamics.binnavi.debug.models.processmanager.MemorySection)5 INaviModule (com.google.security.zynamics.binnavi.disassembly.INaviModule)5 UnrelocatedAddress (com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress)5 CDebugPerspectiveModel (com.google.security.zynamics.binnavi.Gui.GraphWindows.Panels.CDebugPerspectiveModel)4 INaviFunction (com.google.security.zynamics.binnavi.disassembly.INaviFunction)4 INaviInstruction (com.google.security.zynamics.binnavi.disassembly.INaviInstruction)4 BookmarkManager (com.google.security.zynamics.binnavi.models.Bookmarks.memory.BookmarkManager)4 IAddress (com.google.security.zynamics.zylib.disassembly.IAddress)4 Pair (com.google.security.zynamics.zylib.general.Pair)4 ArrayList (java.util.ArrayList)4 IGraphModel (com.google.security.zynamics.binnavi.Gui.GraphWindows.IGraphModel)3