use of com.google.security.zynamics.binnavi.debug.models.processmanager.ProcessManager in project binnavi by google.
the class CDebugEventNotifier method stop.
/**
* Stops the event notifier.
*/
public void stop() {
m_debugger.removeListener(m_debuglistener);
final ProcessManager processManager = m_debugger.getProcessManager();
processManager.removeListener(m_processListener);
for (final TargetProcessThread thread : processManager.getThreads()) {
thread.removeListener(m_threadEventListener);
}
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.ProcessManager in project binnavi by google.
the class CDebugEventNotifier method start.
/**
* Starts the event notifier.
*/
public void start() {
m_debugger.addListener(m_debuglistener);
final ProcessManager processManager = m_debugger.getProcessManager();
processManager.addListener(m_processListener);
for (final TargetProcessThread thread : processManager.getThreads()) {
thread.addListener(m_threadEventListener);
}
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.ProcessManager in project binnavi by google.
the class HaltSynchronizer method handleSuccess.
@Override
protected void handleSuccess(final HaltReply reply) {
final ProcessManager processManager = getDebugger().getProcessManager();
try {
final TargetProcessThread thread = processManager.getThread(reply.getTid());
processManager.setActiveThread(thread);
} catch (final MaybeNullException e) {
NaviLogger.severe("Error: Process manager could not set active threads. Exception %s", e);
// Apparently there is no thread with the specified TID.
// This is not necessarily an error because the thread might have
// been closed while this handler was active.
// Nevertheless this should be logged.
}
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.ProcessManager 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.ProcessManager 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);
}
Aggregations