Search in sources :

Example 1 with TargetProcessThread

use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread 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);
    }
}
Also used : TargetProcessThread(com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread) ProcessManager(com.google.security.zynamics.binnavi.debug.models.processmanager.ProcessManager)

Example 2 with TargetProcessThread

use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread 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);
    }
}
Also used : TargetProcessThread(com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread) ProcessManager(com.google.security.zynamics.binnavi.debug.models.processmanager.ProcessManager)

Example 3 with TargetProcessThread

use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.

the class CMemoryViewerSynchronizer method synchronizeDebugger.

/**
   * Makes sure that the synchronizer is listening on the active debugger.
   *
   * @param oldDebugger The previously active debugger (or null).
   * @param newDebugger The currently active debugger (or null).
   */
private void synchronizeDebugger(final IDebugger oldDebugger, final IDebugger newDebugger) {
    if (oldDebugger != null) {
        oldDebugger.getProcessManager().removeListener(m_debuggerListener);
        final TargetProcessThread activeThread = oldDebugger.getProcessManager().getActiveThread();
        if (activeThread != null) {
            synchronizeThreads(activeThread, null);
        }
    }
    if (newDebugger != null) {
        newDebugger.getProcessManager().addListener(m_debuggerListener);
        m_provider.setDebugger(newDebugger);
        final TargetProcessThread activeThread = newDebugger.getProcessManager().getActiveThread();
        if (activeThread != null) {
            synchronizeThreads(null, activeThread);
        }
    }
    updateGui();
}
Also used : TargetProcessThread(com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread)

Example 4 with TargetProcessThread

use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.

the class CMemoryFunctions method gotoOffset.

/**
   * Shows the Goto Offset dialog and sets the caret of a hex control to the entered offset.
   *
   * @param parent Parent window used for dialogs.
   * @param view Hex view to focus after the Goto operation.
   * @param model Model that contains the memory viewer where the offset is changed.
   */
public static void gotoOffset(final JFrame parent, final CMemoryViewer view, final CDebugPerspectiveModel model) {
    final IDebugger debugger = model.getCurrentSelectedDebugger();
    if (debugger == null) {
        return;
    }
    final TargetProcessThread activeThread = debugger.getProcessManager().getActiveThread();
    final Memory memory = debugger.getProcessManager().getMemory();
    final CDefaultMemoryExpressionBinding binding = new CDefaultMemoryExpressionBinding(activeThread, memory);
    final CGotoDialog dlg = new CGotoDialog(parent, model.getCurrentSelectedDebugger().getProcessManager().getMemoryMap(), binding, model.getGotoAddress());
    dlg.setVisible(true);
    final IAddress value = dlg.getValue();
    if (value != null) {
        model.setGotoAddress(value);
        model.setActiveMemoryAddress(value, true);
        view.requestFocusInWindow();
    }
}
Also used : TargetProcessThread(com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread) Memory(com.google.security.zynamics.zylib.general.memmanager.Memory) IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger) CGotoDialog(com.google.security.zynamics.binnavi.Gui.Debug.Goto.CGotoDialog) IAddress(com.google.security.zynamics.zylib.disassembly.IAddress)

Example 5 with TargetProcessThread

use of com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread in project binnavi by google.

the class CMemoryRefreshButtonSynchronizer method updateGui.

/**
   * Updates the button according to the currently available information about the target process.
   */
private void updateGui() {
    final IDebugger debugger = m_debugPerspectiveModel.getCurrentSelectedDebugger();
    final TargetProcessThread thread = debugger == null ? null : debugger.getProcessManager().getActiveThread();
    final boolean connected = debugger != null && debugger.isConnected();
    final boolean suspended = connected && thread != null;
    m_refreshButton.setEnabled(suspended);
}
Also used : TargetProcessThread(com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread) IDebugger(com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)

Aggregations

TargetProcessThread (com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread)91 Test (org.junit.Test)50 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)27 RelocatedAddress (com.google.security.zynamics.binnavi.disassembly.RelocatedAddress)22 TargetInformation (com.google.security.zynamics.binnavi.debug.models.targetinformation.TargetInformation)21 MockDebugger (com.google.security.zynamics.binnavi.Debug.Debugger.MockDebugger)20 ModuleTargetSettings (com.google.security.zynamics.binnavi.debug.debugger.ModuleTargetSettings)20 DebuggerOptions (com.google.security.zynamics.binnavi.debug.models.targetinformation.DebuggerOptions)20 MemoryMap (com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryMap)19 MemorySection (com.google.security.zynamics.binnavi.debug.models.processmanager.MemorySection)18 RegisterDescription (com.google.security.zynamics.binnavi.debug.models.targetinformation.RegisterDescription)17 IDebugger (com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)16 TargetInformationReply (com.google.security.zynamics.binnavi.debug.connection.packets.replies.TargetInformationReply)15 ArrayList (java.util.ArrayList)15 MemoryMapReply (com.google.security.zynamics.binnavi.debug.connection.packets.replies.MemoryMapReply)14 RegisterValue (com.google.security.zynamics.binnavi.debug.models.targetinformation.RegisterValue)14 MemoryModule (com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryModule)12 ProcessManager (com.google.security.zynamics.binnavi.debug.models.processmanager.ProcessManager)12 MaybeNullException (com.google.security.zynamics.binnavi.Exceptions.MaybeNullException)10 ThreadRegisters (com.google.security.zynamics.binnavi.debug.models.targetinformation.ThreadRegisters)9