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

Class ModuleContainer

source code


Encapsulates the capability to contain Module 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 Module object with the same base address.
source code
dictionary-valueiterator
__iter__(self)
Returns: Iterator of Module objects in this snapshot.
source code
int
__len__(self)
Returns: Count of Module objects in this snapshot.
source code
 
__add_module(self, aModule) source code
 
__del_module(self, lpBaseOfDll) source code
 
__add_loaded_module(self, event) source code
 
notify_create_process(self, event)
Notify the load of the main module.
source code

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

    Modules snapshot
bool
has_module(self, lpBaseOfDll)
Returns: True if the snapshot contains a Module object with the given base address.
source code
Module
get_module(self, lpBaseOfDll)
Returns: Module object with the given base address.
source code
dictionary-keyiterator
iter_module_addresses(self)
Returns: Iterator of DLL base addresses in this snapshot.
source code
dictionary-valueiterator
iter_modules(self)
Returns: Iterator of Module objects in this snapshot.
source code
list( int... )
get_module_bases(self)
Returns: List of DLL base addresses in this snapshot.
source code
int
get_module_count(self)
Returns: Count of Module objects in this snapshot.
source code
Module
get_module_by_name(self, modName)
Returns: Module object that best matches the given name.
source code
Module
get_module_at_address(self, address)
Returns: Module object that best matches the given address.
source code
 
scan_modules(self)
Populates the snapshot with loaded modules.
source code
 
clear_modules(self)
Clears the modules snapshot.
source code
    Event notifications (private)
 
notify_load_dll(self, event)
Notify the load of a new module.
source code
 
notify_unload_dll(self, event)
Notify the release of a loaded module.
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 (Module, int) -
    • Module: Module object to look for.
    • int: Base address of the DLL to look for.
Returns: bool
True if the snapshot contains a Module object with the same base address.

__iter__(self)

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

See Also: iter_modules

__len__(self)
(Length operator)

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

See Also: get_module_count

has_module(self, lpBaseOfDll)

source code 
Parameters:
  • lpBaseOfDll (int) - Base address of the DLL to look for.
Returns: bool
True if the snapshot contains a Module object with the given base address.

get_module(self, lpBaseOfDll)

source code 
Parameters:
  • lpBaseOfDll (int) - Base address of the DLL to look for.
Returns: Module
Module object with the given base address.

iter_module_addresses(self)

source code 
Returns: dictionary-keyiterator
Iterator of DLL base addresses in this snapshot.

See Also: iter_modules

iter_modules(self)

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

get_module_bases(self)

source code 
Returns: list( int... )
List of DLL base addresses in this snapshot.

get_module_count(self)

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

get_module_by_name(self, modName)

source code 
Parameters:
  • modName (int) - Name of the module to look for, as returned by Module.get_name. If two or more modules with the same name are loaded, only one of the matching modules is returned.

    You can also pass a full pathname to the DLL file. This works correctly even if two modules with the same name are loaded from different paths.

Returns: Module
Module object that best matches the given name. Returns None if no Module can be found.

get_module_at_address(self, address)

source code 
Parameters:
  • address (int) - Memory address to query.
Returns: Module
Module object that best matches the given address. Returns None if no Module can be found.

notify_create_process(self, event)

source code 

Notify the load of the main module.

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

Parameters:

notify_load_dll(self, event)

source code 

Notify the load of a new module.

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

Parameters:

notify_unload_dll(self, event)

source code 

Notify the release of a loaded module.

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

Parameters: