
    F#f                         d dl Z d dlmZ d dlmZmZmZmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZ d dlmZ  e j        e          Z G d	 d
ej                  ZdS )    N)List)
interfaces	renderers
exceptions	constants)requirements)plugins)utility)format_hints)lsmodc                       e Zd ZdZdZedeej        j	                 fd            Z
edej        j        defd            Zd Zd	 Zd
S )Check_modulesz0Compares module list to sysfs info, if available   r   r   returnc                 v    t          j        ddg d          t          j        dt          j        d          gS )NkernelzLinux kernel)Intel32Intel64AArch64)namedescriptionarchitecturesr   r   )r   pluginversion)r   ModuleRequirementPluginRequirementr   Lsmod)clss    c/home/panchajanya/Development/work/volatility3/volatility3/framework/plugins/linux/check_modules.pyget_requirementszCheck_modules.get_requirements   sR     **???  
 *U[)  	
 		
    contextvmlinux_namec                 ,   |j         |         }	 |                    d          }n# t          j        $ r d }Y nw xY w|st	          d          i }|                    d                              d          }|j                            |j	        t          j        z   dz   d          D ]l}|                    d|j        j        |z
  d          }|j        }	t!          j        |j        d	          }
|j        r|                                d
k    r|	||
<   m|S )Nmodule_ksetzThis plugin requires the module_kset structure. This structure is not present in the supplied symbol table. This means you are either analyzing an unsupported kernel version or that your symbol table is corrupt.module_kobjectkobjkobjectentryT)object_typeoffsetabsolute    r   )modulesobject_from_symbolr   SymbolError	TypeErrorget_typerelative_child_offsetlistto_listsymbol_table_namer   BANGobjectvolr,   modr
   pointer_to_stringr   reference_count)r   r#   r$   vmlinuxr&   retkobj_offr(   mod_kobjr;   r   s              r    get_kset_moduleszCheck_modules.get_kset_modules$   sJ    /,/	!44]CCKK% 	 	 	KKK	  	 f   ##$455KKFSS$,,%	6BG
 
 	  	 D ~~,x1 &  H ,C,TY;;Dy  T1133a77D	
s   % 99c              #     K   |                      | j        | j        d                   }t          d t          j                            | j        | j        d                   D                       }t          |                                                              |          D ]/}dt          j
        ||                   t          |          ffV  0d S )Nr   c              3   b   K   | ]*}t          t          j        |j                            V  +d S )N)strr
   array_to_stringr   ).0r/   s     r    	<genexpr>z+Check_modules._generator.<locals>.<genexpr>L   sK       
 
 '5566
 
 
 
 
 
r"   r   )rB   r#   configsetr   r   list_moduleskeys
differencer   HexrE   )selfkset_moduleslsmod_modulesmod_names       r    
_generatorzCheck_modules._generatorI   s      ,,T\4;x;PQQ 
 
 ;33DL$+hBWXX
 
 
 
 

 L--//00;;MJJ 	Q 	QH|'X(>??XOPPPPP	Q 	Qr"   c                 z    t          j        dt          j        fdt          fg|                                           S )NzModule AddresszModule Name)r   TreeGridr   rN   rE   rS   )rO   s    r    runzCheck_modules.runT   s9    ! 01M33GHOO
 
 	
r"   N)__name__
__module____qualname____doc___required_framework_versionclassmethodr   r   configurationRequirementInterfacer!   r#   ContextInterfacerE   rB   rS   rV    r"   r    r   r      s        ::"+

j&>&S!T 

 

 

 [

 " (9"IL" " " ["H	Q 	Q 	Q
 
 
 
 
r"   r   )loggingtypingr   volatility3.frameworkr   r   r   r   #volatility3.framework.configurationr    volatility3.framework.interfacesr	   volatility3.framework.objectsr
   volatility3.framework.renderersr   volatility3.plugins.linuxr   	getLoggerrW   vollogPluginInterfacer   r`   r"   r    <module>rl      s   
        N N N N N N N N N N N N < < < < < < 4 4 4 4 4 4 1 1 1 1 1 1 8 8 8 8 8 8 + + + + + +		8	$	$F
 F
 F
 F
 F
G+ F
 F
 F
 F
 F
r"   