use of com.google.security.zynamics.binnavi.debug.models.processmanager.ProcessManager in project binnavi by google.
the class TargetInformationSynchronizer method handleSuccess.
@Override
protected void handleSuccess(final TargetInformationReply reply) {
final IDebugger debugger = getDebugger();
final ProcessManager processManager = getDebugger().getProcessManager();
final TargetInformation info = reply.getTargetInformation();
processManager.setTargetInformation(info);
if (info.getDebuggerOptions().canMemmap()) {
try {
// As soon as we are attached to the target process, we
// try to find out the memory structure of the target
// process.
debugger.getMemoryMap();
} catch (final DebugExceptionWrapper e) {
NaviLogger.severe("Error: Debugger could not get memory map. Exception %s", e);
issueDebugException(e);
}
}
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.ProcessManager in project binnavi by google.
the class ProcessTest method testGetMemory.
@Test
public void testGetMemory() {
final MockProcessListener listener = new MockProcessListener();
final ProcessManager manager = new ProcessManager();
final Process process = new Process(manager);
process.addListener(listener);
final Memory m1 = process.getMemory();
final Memory m2 = process.getMemory();
assertEquals(m1, m2);
process.removeListener(listener);
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.ProcessManager 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);
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.ProcessManager in project binnavi by google.
the class ProcessTest method testThreads.
@Test
public void testThreads() {
final MockProcessListener listener = new MockProcessListener();
final ProcessManager manager = new ProcessManager();
manager.addThread(new TargetProcessThread(0, ThreadState.RUNNING));
final Process process = new Process(manager);
process.addListener(listener);
final Thread thread1 = process.getThreads().get(0);
assertEquals(0, thread1.getThreadId());
final TargetProcessThread thread = new TargetProcessThread(1, ThreadState.RUNNING);
manager.addThread(thread);
assertEquals("addedThread/1;", listener.events);
assertEquals(2, process.getThreads().size());
manager.removeThread(thread);
assertEquals("addedThread/1;removedThread/1;", listener.events);
assertEquals(1, process.getThreads().size());
process.removeListener(listener);
}
use of com.google.security.zynamics.binnavi.debug.models.processmanager.ProcessManager in project binnavi by google.
the class ProcessTest method testGetTargetInformation.
@Test
public void testGetTargetInformation() {
final MockProcessListener listener = new MockProcessListener();
final ProcessManager manager = new ProcessManager();
final Process process = new Process(manager);
process.addListener(listener);
assertNull(process.getTargetInformation());
manager.setTargetInformation(new com.google.security.zynamics.binnavi.debug.models.targetinformation.TargetInformation(5, new FilledList<RegisterDescription>(), new DebuggerOptions(false, false, false, false, false, false, false, false, false, false, 12, 0, new ArrayList<DebuggerException>(), false, false, false)));
final TargetInformation t1 = process.getTargetInformation();
final TargetInformation t2 = process.getTargetInformation();
assertNotNull(t1);
assertEquals(t1, t2);
assertEquals("changedTargetInformation;", listener.events);
assertEquals(5, process.getTargetInformation().getAddressSize());
assertEquals(false, process.getTargetInformation().canTerminate());
process.removeListener(listener);
}
Aggregations