use of com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryModule in project binnavi by google.
the class CModulesTableRenderer method getTableCellRendererComponent.
@Override
public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
final MemoryModule module = ((CModulesTable) table).getTreeTableModel().getModules().get(table.convertRowIndexToModel(row));
final Color color = m_colorGenerator.getColor(module);
setBackground(color == null ? Color.WHITE : color);
return this;
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryModule in project binnavi by google.
the class ModuleUnloadedSynchronizer method handleSuccess.
@Override
protected void handleSuccess(final ModuleUnloadedReply reply) {
final ProcessManager processManager = getDebugger().getProcessManager();
final MemoryModule replyModule = reply.getModule();
final MemoryModule existingModule = processManager.getModule(replyModule.getBaseAddress());
if (existingModule == null) {
processManager.removeNonExistingModule(replyModule);
} else {
processManager.removeModule(existingModule);
CBreakpointModuleSynchronizer.disableEchoBreakpoints(getDebugger(), existingModule);
CBreakpointModuleSynchronizer.disableRegularBreakpoints(getDebugger(), existingModule);
}
if (needsResume()) {
try {
getDebugger().resume();
} catch (final DebugExceptionWrapper e) {
NaviLogger.severe("Error: Could not resume the debugger. Exception: %s", e);
}
}
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryModule in project binnavi by google.
the class ProcessStartSynchronizer method handleSuccess.
@Override
protected void handleSuccess(final ProcessStartReply reply) {
final TargetProcessThread thread = reply.getProcessStart().getThread();
final MemoryModule module = reply.getProcessStart().getModule();
getDebugger().getProcessManager().addThread(thread);
getDebugger().getProcessManager().setActiveThread(thread);
refreshRegisters();
CRelocationNotifier.relocateModule(getDebugger(), module);
getDebugger().getProcessManager().addModule(module);
CBreakpointModuleSynchronizer.enableRegularBreakpoints(getDebugger(), module);
try {
getDebugger().resume();
} catch (final DebugExceptionWrapper e) {
NaviLogger.severe("Error: Could not resume debugger. Exception: %s", e);
}
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryModule in project binnavi by google.
the class ReplySynchronizer method resetTargetProcess.
/**
* Resets information about the target process.
*/
protected void resetTargetProcess() {
final BreakpointManager manager = debugger.getBreakpointManager();
final ProcessManager processManager = debugger.getProcessManager();
debugger.setTerminated();
manager.clearBreakpointsPassive(BreakpointType.ECHO);
manager.clearBreakpointsPassive(BreakpointType.STEP);
deactivateBreakpoints();
processManager.getMemory().clear();
processManager.setMemoryMap(new MemoryMap(new ArrayList<MemorySection>()));
final Collection<TargetProcessThread> threads = processManager.getThreads();
for (final TargetProcessThread thread : threads) {
processManager.removeThread(thread);
}
for (final MemoryModule module : processManager.getModules()) {
processManager.removeModule(module);
}
processManager.setAttached(false);
processManager.setActiveThread(null);
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryModule in project binnavi by google.
the class ProcessTest method testModules.
@Test
public void testModules() {
final MockProcessListener listener = new MockProcessListener();
final ProcessManager manager = new ProcessManager();
manager.addModule(new MemoryModule("Hannes", "C:\\Hannes.dll", new RelocatedAddress(new CAddress(0x100)), 0x100));
final Process process = new Process(manager);
assertEquals(1, process.getModules().size());
process.addListener(listener);
final MemoryModule dll = new MemoryModule("Foobert.dll", "C:\\Foobert.dll", new RelocatedAddress(new CAddress(0x100)), 0x100);
manager.addModule(dll);
assertEquals("addedModule/Foobert.dll;", listener.events);
assertEquals(2, process.getModules().size());
manager.removeModule(dll);
assertEquals("addedModule/Foobert.dll;removedModule/Foobert.dll;", listener.events);
assertEquals(1, process.getModules().size());
process.removeListener(listener);
}
Aggregations