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);
}
}
Aggregations