
    Xfa                         d dl Z d dlZd dlmZ d dlmZ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)	renderers
interfaces)requirements)pluginsc                   ^    e Zd ZdZdZedeej        j	                 fd            Z
d Zd ZdS )ConfigWriterzZRuns the automagics and both prints and outputs configuration in the
    output directory.)   r   r   returnc                 d    t          j        ddddg          t          j        dddd	
          gS )NprimaryzMemory layer for the kernelIntel32Intel64)namedescriptionarchitecturesextraz Outputs whole configuration treeFT)r   r   defaultoptional)r   TranslationLayerRequirementBooleanRequirement)clss    \/home/panchajanya/Development/work/volatility3/volatility3/framework/plugins/configwriter.pyget_requirementszConfigWriter.get_requirements   sT     49()4  
 +>	  
 	
    c           
   #     K   d}t          |                                           }| j                            dd          r5t                              d           t          | j        j                  }d}	 |                     |          5 }|                    t          t          j        |dd          d	                     d d d            n# 1 swxY w Y   n4# t          $ r'}t                              d
|            Y d }~nd }~ww xY w|                                D ]\  }}d|t          j        |          ffV   d S )Nzconfig.jsonr   FzHOutputting additional information, this will NOT work with the -c optionzconfig.extraTr
   )	sort_keysindentraw_unicode_escapez%Unable to JSON encode configuration: r   )dictbuild_configurationconfiggetvollogdebugcontextopenwritebytesjsondumps	Exceptionwarningitems)selffilenamer"   	file_dataexcpkvs          r   
_generatorzConfigWriter._generator&   s      d..0011;??7E** 	&LLZ   $,-..F%H		K8$$ 	
6T!DDD,                   	K 	K 	KNNI4IIJJJJJJJJ	K LLNN 	* 	*DAqq$*Q--()))))	* 	*s<   7C 9CC CC CC 
D'D		Dc                 p    t          j        dt          fdt          fg|                                           S )NKeyValue)r   TreeGridstrr5   )r/   s    r   runzConfigWriter.run=   s,    !E3<'3"@$//BSBSTTTr   N)__name__
__module____qualname____doc___required_framework_versionclassmethodr   r   configurationRequirementInterfacer   r5   r;    r   r   r	   r	      sy          #,
j&>&S!T 
 
 
 [
* * *.U U U U Ur   r	   )r*   loggingtypingr   volatility3.frameworkr   r   #volatility3.framework.configurationr    volatility3.framework.interfacesr   	getLoggerr<   r$   PluginInterfacer	   rD   r   r   <module>rL      s   
         7 7 7 7 7 7 7 7 < < < < < < 4 4 4 4 4 4		8	$	$.U .U .U .U .U7* .U .U .U .U .Ur   