
    #f
                         d dl 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  e j                  e      Z G d dej                   j"                        Zy)	    N)
interfaces	renderers
exceptions)requirements)format_hints)linux)lsmodc                   0    e Zd ZdZdZed        Zd Zd Zy)Keyboard_notifiersz'Parses the keyboard notifier call chain   r   r   c                     t        j                  ddg d      t        j                  dt        j                  d      t        j
                  dt        j                  d	      gS )
NkernelzLinux kernel)Intel32Intel64AArch64)namedescriptionarchitecturesr	   r   )r   pluginversion
linuxutils)r   	componentr   )r   ModuleRequirementPluginRequirementr	   LsmodVersionRequirementr   LinuxUtilities)clss    h/home/panchajanya/Development/work/volatility3/volatility3/framework/plugins/linux/keyboard_notifiers.pyget_requirementsz#Keyboard_notifiers.get_requirements   s]     ***?
 **U[[) ++!U-A-A9
 	
    c              #     K   | j                   j                  | j                  d      }t        j                  j                  | j                   |j                        }t        j                  j                  | j                   |j                  |      }	 |j                  d      }|st        d      |j                  d|j                  j                   d      }t        j                  j#                  |dd|j$                        D ]N  }|j&                  }t        j                  j)                  |||      \  }}	d	t+        j,                  |      ||	gf P y # t        j                  $ r d }Y w xY ww)
Nr   keyboard_notifier_listzThis plugin requires the keyboard_notifier_list 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.atomic_notifier_headT)object_typeoffsetabsolutenotifier_blocknextr   )contextmodulesconfigr	   r   list_modulesr   r   r   generate_kernel_handler_infoobject_from_symbolr   SymbolError	TypeErrorobjectvolr'   walk_internal_listheadnotifier_calllookup_module_addressr   Hex)
selfvmlinuxr,   handlersknl_addrknl	call_back	call_addrmodule_namesymbol_names
             r    
_generatorzKeyboard_notifiers._generator%   sW    ,,&&t{{8'<=++**4<<F''DDLL',,
	112JKH z  nn.<<&&  
 --@@%vsxx
 		OI "//I',';';'Q'Q9($K |''	2KMNN		O! %% 	H	s+   BE2E $B3E2E/,E2.E//E2c                     t        j                  dt        j                  fdt        fdt        fg| j                               S )NAddressModuleSymbol)r   TreeGridr   r9   strrC   )r:   s    r    runzKeyboard_notifiers.runK   s<    !!))*XsOh_MOO
 	
r"   N)	__name__
__module____qualname____doc___required_framework_versionclassmethodr!   rC   rJ    r"   r    r   r      s)    1"+
 
$OL
r"   r   )loggingvolatility3.frameworkr   r   r   #volatility3.framework.configurationr   volatility3.framework.renderersr   volatility3.framework.symbolsr   volatility3.plugins.linuxr	   	getLoggerrK   vollogpluginsPluginInterfacer   rQ   r"   r    <module>r\      sF   
  C C < 8 / +			8	$?
++;; ?
r"   