Search in sources :

Example 21 with ProcessManager

use of com.google.security.zynamics.binnavi.debug.models.processmanager.ProcessManager 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)

Aggregations

ProcessManager (com.google.security.zynamics.binnavi.debug.models.processmanager.ProcessManager)21 TargetProcessThread (com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread)12 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)7 MaybeNullException (com.google.security.zynamics.binnavi.Exceptions.MaybeNullException)6 Test (org.junit.Test)6 RelocatedAddress (com.google.security.zynamics.binnavi.disassembly.RelocatedAddress)5 MemoryModule (com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryModule)4 BreakpointManager (com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointManager)3 DebuggerException (com.google.security.zynamics.binnavi.debug.models.targetinformation.DebuggerException)3 RegisterValue (com.google.security.zynamics.binnavi.debug.models.targetinformation.RegisterValue)3 ThreadRegisters (com.google.security.zynamics.binnavi.debug.models.targetinformation.ThreadRegisters)3 FilledList (com.google.security.zynamics.zylib.types.lists.FilledList)3 DebugExceptionWrapper (com.google.security.zynamics.binnavi.debug.debugger.DebugExceptionWrapper)2 IDebugger (com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)2 MemoryMap (com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryMap)2 DebuggerOptions (com.google.security.zynamics.binnavi.debug.models.targetinformation.DebuggerOptions)2 RegisterValues (com.google.security.zynamics.binnavi.debug.models.targetinformation.RegisterValues)2 ArrayList (java.util.ArrayList)2 Breakpoint (com.google.security.zynamics.binnavi.debug.models.breakpoints.Breakpoint)1 MemorySection (com.google.security.zynamics.binnavi.debug.models.processmanager.MemorySection)1