Package winappdbg :: Module event :: Class EventDispatcher
[hide private]
[frames] | no frames]

Class EventDispatcher

source code


Implements debug event dispatching capabilities.

Instance Methods [hide private]
 
__init__(self, eventHandler=None)
Event dispatcher.
source code
 
dispatch(self, event)
Sends event notifications to the Debug object and the EventHandler object provided by the user.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

    Debugging events
EventHandler
get_event_handler(self)
Get the event handler.
source code
EventHandler
set_event_handler(self, eventHandler)
Set the event handler.
source code
Static Methods [hide private]
    Debugging events
callable
get_handler_method(eventHandler, event, fallback=None)
Retrieves the appropriate callback method from an EventHandler instance for the given Event object.
Class Variables [hide private]
  __preEventNotifyCallbackName = {2: '_notify_create_thread', 3:...
  __postEventNotifyCallbackName = {4: '_notify_exit_thread', 5: ...
  __preExceptionNotifyCallbackName = {1073741855: '_notify_break...
  __postExceptionNotifyCallbackName = {}
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, eventHandler=None)
(Constructor)

source code 

Event dispatcher.

Parameters:
  • eventHandler (EventHandler) - (Optional) User-defined event handler.
Raises:
  • TypeError - The event handler is of an incorrect type.
Overrides: object.__init__

Note: The eventHandler parameter may be any callable Python object (for example a function, or an instance method). However you'll probably find it more convenient to use an instance of a subclass of EventHandler here.

get_event_handler(self)

source code 

Get the event handler.

Returns: EventHandler
Current event handler object, or None.

See Also: set_event_handler

set_event_handler(self, eventHandler)

source code 

Set the event handler.

Parameters:
  • eventHandler (EventHandler) - New event handler object, or None.
Returns: EventHandler
Previous event handler object, or None.
Raises:
  • TypeError - The event handler is of an incorrect type.

Warning: This is normally not needed. Use with care!

Note: The eventHandler parameter may be any callable Python object (for example a function, or an instance method). However you'll probably find it more convenient to use an instance of a subclass of EventHandler here.

get_handler_method(eventHandler, event, fallback=None)
Static Method

 

Retrieves the appropriate callback method from an EventHandler instance for the given Event object.

Parameters:
  • eventHandler (EventHandler) - Event handler object whose methods we are examining.
  • event (Event) - Debugging event to be handled.
  • fallback (callable) - (Optional) If no suitable method is found in the EventHandler instance, return this value.
Returns: callable
Bound method that will handle the debugging event. Returns None if no such method is defined.

dispatch(self, event)

source code 

Sends event notifications to the Debug object and the EventHandler object provided by the user.

The Debug object will forward the notifications to it's contained snapshot objects (System, Process, Thread and Module) when appropriate.

Parameters:
Raises:
  • WindowsError - Raises an exception on error.

Warning: This method is called automatically from Debug.dispatch.

See Also: Debug.cont, Debug.loop, Debug.wait


Class Variable Details [hide private]

__preEventNotifyCallbackName

Value:
{2: '_notify_create_thread',
 3: '_notify_create_process',
 6: '_notify_load_dll'}

__postEventNotifyCallbackName

Value:
{4: '_notify_exit_thread',
 5: '_notify_exit_process',
 7: '_notify_unload_dll',
 9: '_notify_rip'}

__preExceptionNotifyCallbackName

Value:
{1073741855: '_notify_breakpoint',
 1073807365: '_notify_debug_control_c',
 1080890248: '_notify_ms_vc_exception',
 2147483649: '_notify_guard_page',
 2147483651: '_notify_breakpoint',
 2147483652: '_notify_single_step'}