
    #f                         d Z ddlZddlmZmZ ddl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 )zkA module containing a collection of plugins that produce data typically
found in Linux's /proc file system.    N)ListCallable)	renderers
interfaces	constants)requirements)plugins)utility)linux)pslistc            
           e Zd ZdZdZdZedeej	        j
                 fd            Zed fdej        j        ded	eegef         fd
            Zd Zd ZdS )Lsofz(Lists all memory maps for all processes.   r   r   )   r   r   returnc           	          t          j        ddg d          t          j        dt          j        d          t          j        dt          j        d	          t          j        d
dt          d          gS )NkernelzLinux kernel)Intel32Intel64AArch64)namedescriptionarchitecturesr   r   )r   pluginversion
linuxutils)r   	componentr   pidzFilter on specific process IDsT)r   r   element_typeoptional)
r   ModuleRequirementPluginRequirementr   PsListVersionRequirementr   LinuxUtilitiesListRequirementint)clss    Z/home/panchajanya/Development/work/volatility3/volatility3/framework/plugins/linux/lsof.pyget_requirementszLsof.get_requirements   s     **???  
 *fmY   +!U-A9   (< 	  
 	
    c                     dS )NF )_s    r*   <lambda>zLsof.<lambda>5   s    u r,   contextsymbol_tablefilter_funcc              #     K   d }t           j                            |||          D ]}|Vt          j        |j        j        vrt          d          |j        j                            t          j                  d         }t          j
        |j                  }t          |j                  }t          j                            |||          }|D ]
}	||||	fV  d S )Nz"Task is not part of a symbol tabler   )r   r$   
list_tasksr   BANGvol	type_name
ValueErrorsplitr
   array_to_stringcommr(   r   r   r&   files_descriptors_for_process)
r)   r1   r2   r3   linuxutils_symbol_tabletask	task_commr   fd_generator	fd_fieldss
             r*   list_fdszLsof.list_fds0   s       #'M,,WlKPP 	6 	6D&.>);;;$%IJJJ*.(*<*B*B9>*R*RST*U'/	::Idh--C /MM0$ L * 6 6	9dI555556	6 	6r,   c              #      K   t           j                            |          }|                     | j        ||          }|D ]\  }}}}|\  }	}
}|||	|f}d|fV  d S )N)r3   r   )r   r$   create_pid_filterrC   r1   )selfpidsr2   r3   fds_generatorr   r@   _taskrB   fd_num_filp	full_pathfieldss                r*   
_generatorzLsof._generatorH   s      m55d;;L,K & 
 
 1> 	 	,CE9'0$FE99fi8Ff+		 	r,   c                     | j                             dd           }| j         d         }dt          fdt          fdt          fdt          fg}t	          j        ||                     ||                    S )Nr   r   PIDProcessFDPath)configgetr(   strr   TreeGridrN   )rF   rG   r2   tree_grid_argss       r*   runzLsof.runT   sd    {ud++{8, #,C(84+PS}U!.$//$2U2UVVVr,   N)__name__
__module____qualname____doc___required_framework_version_versionclassmethodr   r   configurationRequirementInterfacer+   r1   ContextInterfacerV   r   r(   boolrC   rN   rY   r.   r,   r*   r   r      s        22"+H
j&>&S!T 
 
 
 [
* 
 .=_	6 6#46 6 seTk*	6 6 6 [6.
 
 
W W W W Wr,   r   )r]   loggingtypingr   r   volatility3.frameworkr   r   r   #volatility3.framework.configurationr    volatility3.framework.interfacesr	   volatility3.framework.objectsr
   volatility3.framework.symbolsr   volatility3.plugins.linuxr   	getLoggerrZ   vollogPluginInterfacer   r.   r,   r*   <module>rp      s  ' '  ! ! ! ! ! ! ! ! B B B B B B B B B B < < < < < < 4 4 4 4 4 4 1 1 1 1 1 1 / / / / / / , , , , , ,		8	$	$FW FW FW FW FW7" FW FW FW FW FWr,   