Package winappdbg :: Module system :: Class ThreadContainer
[hide private]
[frames] | no frames]

Class ThreadContainer


Encapsulates the capability to contain Thread objects.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
bool
__contains__(self, anObject)
Returns: True if the snapshot contains a Thread object with the same ID.
dictionary-valueiterator
__iter__(self)
Returns: Iterator of Thread objects in this snapshot.
int
__len__(self)
Returns: Count of Thread objects in this snapshot.
 
__add_thread(self, aThread)
 
__del_thread(self, dwThreadId)
 
__add_created_thread(self, event)

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

    Instrumentation
 
start_thread(self, lpStartAddress, lpParameter=0, bSuspended=False)
Remotely creates a new thread in the process.
    Threads snapshot
bool
has_thread(self, dwThreadId)
Returns: True if the snapshot contains a Thread object with the given global ID.
Thread
get_thread(self, dwThreadId)
Returns: Thread object with the given global ID.
dictionary-keyiterator
iter_thread_ids(self)
Returns: Iterator of global thread IDs in this snapshot.
dictionary-valueiterator
iter_threads(self)
Returns: Iterator of Thread objects in this snapshot.
list( int )
get_thread_ids(self)
Returns: List of global thread IDs in this snapshot.
int
get_thread_count(self)
Returns: Count of Thread objects in this snapshot.
list( Thread )
find_threads_by_name(self, name, bExactMatch=True)
Find threads by name, using different search methods.
 
scan_threads(self)
Populates the snapshot with running threads.
 
clear_dead_threads(self)
Remove Thread objects from the snapshot referring to threads no longer running.
 
clear_threads(self)
Clears the threads snapshot.
 
close_thread_handles(self)
Closes all open handles to threads in the snapshot.
    Event notifications (private)
 
notify_create_process(self, event)
Notify the creation of the main thread of this process.
 
notify_create_thread(self, event)
Notify the creation of a new thread in this process.
 
notify_exit_thread(self, event)
Notify the termination of a thread.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__contains__(self, anObject)
(In operator)

 
Parameters:
  • anObject (Thread, int) -
    • int: Global ID of the thread to look for.
    • Thread: Thread object to look for.
Returns: bool
True if the snapshot contains a Thread object with the same ID.

__iter__(self)

 
Returns: dictionary-valueiterator
Iterator of Thread objects in this snapshot.

See Also: iter_threads

__len__(self)
(Length operator)

 
Returns: int
Count of Thread objects in this snapshot.

See Also: get_thread_count

has_thread(self, dwThreadId)

 
Parameters:
  • dwThreadId (int) - Global ID of the thread to look for.
Returns: bool
True if the snapshot contains a Thread object with the given global ID.

get_thread(self, dwThreadId)

 
Parameters:
  • dwThreadId (int) - Global ID of the thread to look for.
Returns: Thread
Thread object with the given global ID.

iter_thread_ids(self)

 
Returns: dictionary-keyiterator
Iterator of global thread IDs in this snapshot.

See Also: iter_threads

iter_threads(self)

 
Returns: dictionary-valueiterator
Iterator of Thread objects in this snapshot.

See Also: iter_thread_ids

get_thread_ids(self)

 
Returns: list( int )
List of global thread IDs in this snapshot.

get_thread_count(self)

 
Returns: int
Count of Thread objects in this snapshot.

find_threads_by_name(self, name, bExactMatch=True)

 

Find threads by name, using different search methods.

Parameters:
  • name (str, None) - Name to look for. Use None to find nameless threads.
  • bExactMatch (bool) - True if the name must be exactly as given, False if the name can be loosely matched.

    This parameter is ignored when name is None.

Returns: list( Thread )
All threads matching the given name.

start_thread(self, lpStartAddress, lpParameter=0, bSuspended=False)

 

Remotely creates a new thread in the process.

Parameters:
  • lpStartAddress (int) - Start address for the new thread.
  • lpParameter (int) - Optional argument for the new thread.
  • bSuspended (bool) - True if the new thread should be suspended. In that case use Thread.resume to start execution.

notify_create_process(self, event)

 

Notify the creation of the main thread of this process.

Parameters:

notify_create_thread(self, event)

 

Notify the creation of a new thread in this process.

Parameters:

notify_exit_thread(self, event)

 

Notify the termination of a thread.

Parameters: