
    [
#g                         d dl Z d dlmZ d dlmZ d dlmZ d dlmZm	Z	m
Z
  e j                  e      Z G d de	j                        Zy)    N)Iterable)
interfaces)requirements)poolscannermodulespedumpc            
            e Zd ZdZdZdZ fdZed        Zede	j                  j                  dededee	j                  j                     fd	       Z xZS )
ModScanz?Scans for modules present in a particular windows memory image.   r   r   c                 F    t        |   |i | | j                  | _        y )N)super__init__scan_modules_enumeration_method)selfargskwargs	__class__s      _/home/panchajanya/Development/work/volatility3/volatility3/framework/plugins/windows/modscan.pyr   zModScan.__init__   s#    $)&)#'#4#4     c                    t        j                  ddddg      t        j                  dt        j                  d      t        j                  d	t
        j                  d
      t        j                  dddd      t        j                  ddd      t        j                  dddd       t        j                  dt        j                  d      gS )NkernelzWindows kernelIntel32Intel64)namedescriptionarchitecturesr   )   r   r   )r   	componentversionr   r   dumpzExtract listed modulesFT)r   r   defaultoptionalbasez)Extract a single module with BASE address)r   r   r$   r   zmodule name/sub string)r   r   r$   r#   r   )r   ModuleRequirementVersionRequirementr   PoolScannerr   ModulesBooleanRequirementIntRequirementStringRequirementr   PEDump)clss    r   get_requirementszModScan.get_requirements   s     **,()4
 ++"k.E.Ey ++'//9 ++4	 ''G
 **4	 ++	; 
  	
r   context
layer_namesymbol_tablereturnc              #      K   t         j                  j                  |dg      }t         j                  j                  ||||      D ]  }|\  }}}|  yw)a  Scans for modules using the poolscanner module and constraints.

        Args:
            context: The context to retrieve required elements (layers, symbol tables) from
            layer_name: The name of the layer on which to operate
            symbol_table: The name of the table containing the kernel symbols

        Returns:
            A list of Driver objects as found from the `layer_name` layer based on Driver pool signatures
        s   MmLdN)r   r(   builtin_constraintsgenerate_pool_scan)	r.   r0   r1   r2   constraintsresult_constraint
mem_object_headers	            r   r   zModScan.scan_modules<   s_     $ "--AA7)
 "--@@Z{
F 06,KW	
s   AA)__name__
__module____qualname____doc___required_framework_version_versionr   classmethodr/   r   r0   ContextInterfacestrr   objectsObjectInterfacer   __classcell__)r   s   @r   r
   r
      s    I"+H5 !
 !
F ##44  	
 
*$$44	5 r   r
   )loggingtypingr   volatility3.frameworkr   #volatility3.framework.configurationr   volatility3.plugins.windowsr   r   r   	getLoggerr<   vollogr)   r
    r   r   <module>rP      s=      , < D D			8	$Hgoo Hr   