
    Xf                         d dl 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y)	    N)	renderers)requirements)plugins)mac)pslistc                   0    e Zd ZdZdZed        Zd Zd Zy)Lsofz2Lists all open file descriptors for all processes.)   r   r   c           	         t        j                  ddddg      t        j                  dt        j                  d      t        j
                  d	t        j                  d
      t        j                  ddt        d      gS )NkernelzKernel module for the OSIntel32Intel64)namedescriptionarchitecturesmacutils)   r   r   )r   	componentversionr   )   r   r   )r   pluginr   pidzFilter on specific process IDsT)r   r   element_typeoptional)
r   ModuleRequirementVersionRequirementr   MacUtilitiesPluginRequirementr   PsListListRequirementint)clss    X/home/panchajanya/Development/work/volatility3/volatility3/framework/plugins/mac/lsof.pyget_requirementszLsof.get_requirements   s~     **6()4
 ++3+;+;Y **fmmY ((< 	
 	
    c              #   0  K   | j                   j                  | j                  d      }|D ]g  }|j                  }t        j
                  j                  | j                   |j                  |      D ]!  \  }}}|s
t        |      dkD  sd|||ff # i y w)Nr   r   )	contextmodulesconfigp_pidr   r   files_descriptors_for_processsymbol_table_namelen)selftasksdarwintaskr   _filepathfds           r#   
_generatorzLsof._generator+   s     %%dkk(&;< 	3D**C#&#3#3#Q#Qf66$ 38R H 1sB122	3	3s   A6B9BBc           
         t         j                  j                  | j                  j	                  dd             }t         j                  j                  | j                  j	                  dt         j                  j                  d               }t        j                  dt        fdt        fdt        fg| j                   || j                  | j                  d   |                  S )	Nr   pslist_methodr   PIDzFile Descriptorz	File Pathr   )filter_func)r   r   create_pid_filterr)   getget_list_taskspslist_methodsr   TreeGridr!   strr5   r'   )r.   r9   
list_taskss      r#   runzLsof.run6   s    mm55dkkooeT6RS]]11KKOOOV]]-I-I!-LM

 !!S\-s3k35GHOO4<<X)>KX
 	
r%   N)	__name__
__module____qualname____doc___required_framework_versionclassmethodr$   r5   rA    r%   r#   r	   r	      s'    <"+
 
*	3
r%   r	   )loggingvolatility3.frameworkr   #volatility3.framework.configurationr    volatility3.framework.interfacesr   volatility3.framework.symbolsr   volatility3.plugins.macr   	getLoggerrB   vollogPluginInterfacer	   rH   r%   r#   <module>rR      s=   
  + < 4 - *			8	$1
7"" 1
r%   