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

Class ThreadContainer

source code


Encapsulates the capability to contain Thread objects.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__initialize_snapshot(self)
Private method to automatically initialize the snapshot when you try to use it without calling any of the scan_* methods first.
source code
bool
__contains__(self, anObject)
Returns: True if the snapshot contains a Thread object with the same ID.
source code
dictionary-valueiterator
__iter__(self)
Returns: Iterator of Thread objects in this snapshot.
source code
int
__len__(self)
Returns: Count of Thread objects in this snapshot.
source code
 
__add_thread(self, aThread) source code
 
__del_thread(self, dwThreadId) source code
 
__add_created_thread(self, event) source code

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

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

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

__initialize_snapshot(self)

source code 

Private method to automatically initialize the snapshot when you try to use it without calling any of the scan_* methods first. You don't need to call this yourself.

__contains__(self, anObject)
(In operator)

source code 
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)

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

See Also: iter_threads

__len__(self)
(Length operator)

source code 
Returns: int
Count of Thread objects in this snapshot.

See Also: get_thread_count

has_thread(self, dwThreadId)

source code 
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)

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

iter_thread_ids(self)

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

See Also: iter_threads

iter_threads(self)

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

See Also: iter_thread_ids

get_thread_ids(self)

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

get_thread_count(self)

source code 
Returns: int
Count of Thread objects in this snapshot.

find_threads_by_name(self, name, bExactMatch=True)

source code 

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)

source code 

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)

source code 

Notify the creation of the main thread of this process.

This is done automatically by the Debug class, you shouldn't need to call it yourself.

Parameters:

notify_create_thread(self, event)

source code 

Notify the creation of a new thread in this process.

This is done automatically by the Debug class, you shouldn't need to call it yourself.

Parameters:

notify_exit_thread(self, event)

source code 

Notify the termination of a thread.

This is done automatically by the Debug class, you shouldn't need to call it yourself.

Parameters: