use of com.google.security.zynamics.binnavi.debug.models.targetinformation.DebuggerOptions in project binnavi by google.
the class DebuggerTest method writeRegister3.
@Test
public void writeRegister3() throws DebugException {
debugger.connect();
debugger.getNative().getProcessManager().setTargetInformation(new TargetInformation(5, Lists.newArrayList(new RegisterDescription("eax", 4, true), new RegisterDescription("ebx", 4, false)), new DebuggerOptions(false, false, false, false, false, false, false, false, false, false, 12, 0, new ArrayList<DebuggerException>(), false, false, false)));
debugger.writeRegister(0, "eax", 0);
}
use of com.google.security.zynamics.binnavi.debug.models.targetinformation.DebuggerOptions 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);
}
use of com.google.security.zynamics.binnavi.debug.models.targetinformation.DebuggerOptions in project binnavi by google.
the class CMemorySectionPanelSynchronizerTest method testReceiveTargetInformation.
@Test
public void testReceiveTargetInformation() throws DebugExceptionWrapper {
final MockDebugger debugger = new MockDebugger(new ModuleTargetSettings(CommonTestObjects.MODULE));
final TargetProcessThread thread = new TargetProcessThread(1, ThreadState.SUSPENDED);
debugger.getProcessManager().addThread(thread);
debugger.getProcessManager().setActiveThread(thread);
final MemorySection section1 = new MemorySection(new CAddress(0x100), new CAddress(0x1FF));
final MemorySection section2 = new MemorySection(new CAddress(0x300), new CAddress(0x3FF));
final MemoryMap memoryMap = new MemoryMap(Lists.newArrayList(section1, section2));
debugger.connection.m_synchronizer.receivedEvent(new MemoryMapReply(0, 0, memoryMap));
debugger.connect();
m_model.setActiveDebugger(debugger);
debugger.getProcessManager().setTargetInformation(new TargetInformation(32, new FilledList<RegisterDescription>(), new DebuggerOptions(false, false, false, true, false, false, false, false, false, false, 1, 0, new ArrayList<DebuggerException>(), false, false, false)));
assertTrue(m_sectionBox.isEnabled());
debugger.getProcessManager().setTargetInformation(new TargetInformation(32, new FilledList<RegisterDescription>(), new DebuggerOptions(false, false, false, false, false, false, false, false, false, false, 1, 0, new ArrayList<DebuggerException>(), false, false, false)));
assertFalse(m_sectionBox.isEnabled());
m_synchronizer.dispose();
debugger.close();
}
use of com.google.security.zynamics.binnavi.debug.models.targetinformation.DebuggerOptions in project binnavi by google.
the class CMemorySectionPanelSynchronizerTest method testThreads.
@Test
public void testThreads() throws DebugExceptionWrapper {
final MockDebugger debugger = new MockDebugger(new ModuleTargetSettings(CommonTestObjects.MODULE));
debugger.connect();
debugger.getProcessManager().setAttached(true);
debugger.connection.m_synchronizer.receivedEvent(new TargetInformationReply(0, 0, new TargetInformation(32, new FilledList<RegisterDescription>(), new DebuggerOptions(false, false, false, true, false, false, false, false, false, false, 1, 0, new ArrayList<DebuggerException>(), false, false, false))));
final MemorySection section1 = new MemorySection(new CAddress(0x100), new CAddress(0x1FF));
final MemorySection section2 = new MemorySection(new CAddress(0x300), new CAddress(0x3FF));
final MemoryMap memoryMap = new MemoryMap(Lists.newArrayList(section1, section2));
debugger.connection.m_synchronizer.receivedEvent(new MemoryMapReply(0, 0, memoryMap));
final TargetProcessThread thread = new TargetProcessThread(1, ThreadState.RUNNING);
m_model.setActiveDebugger(debugger);
debugger.getProcessManager().setActiveThread(null);
assertFalse(m_sectionBox.isEnabled());
debugger.getProcessManager().addThread(thread);
assertFalse(m_sectionBox.isEnabled());
debugger.getProcessManager().setActiveThread(thread);
assertTrue(m_sectionBox.isEnabled());
debugger.getProcessManager().setActiveThread(null);
assertFalse(m_sectionBox.isEnabled());
debugger.getProcessManager().removeThread(thread);
assertFalse(m_sectionBox.isEnabled());
debugger.getProcessManager().setAttached(false);
m_synchronizer.dispose();
debugger.close();
}
use of com.google.security.zynamics.binnavi.debug.models.targetinformation.DebuggerOptions in project binnavi by google.
the class CModulesTableModelSynchronizerTest method testDetach.
@Test
public void testDetach() throws DebugExceptionWrapper {
final MockDebugger debugger = new MockDebugger(new ModuleTargetSettings(CommonTestObjects.MODULE));
debugger.connect();
debugger.getProcessManager().addModule(new MemoryModule("Hannes", "C:\\Hannes.dll", new RelocatedAddress(new CAddress(0x200)), 0x100));
m_model.setActiveDebugger(debugger);
debugger.connection.m_synchronizer.receivedEvent(new TargetInformationReply(0, 0, new TargetInformation(32, new FilledList<RegisterDescription>(), new DebuggerOptions(false, false, false, true, false, false, false, false, false, false, 1, 0, new ArrayList<DebuggerException>(), false, false, false))));
final MemorySection section1 = new MemorySection(new CAddress(0x100), new CAddress(0x1FF));
final MemorySection section2 = new MemorySection(new CAddress(0x300), new CAddress(0x3FF));
final MemoryMap memoryMap = new MemoryMap(Lists.newArrayList(section1, section2));
debugger.connection.m_synchronizer.receivedEvent(new MemoryMapReply(0, 0, memoryMap));
debugger.connection.m_synchronizer.receivedEvent(new DetachReply(0, 0));
m_synchronizer.dispose();
debugger.close();
}
Aggregations