
    Xf                     :   d dl Z d dlmZmZmZmZmZ d dlmZm	Z	m
Z
  G d de	j        j                  Zi de
j        dfde
j        dfd	e
j        d
fde
j        d
fde
j        dfde
j        dfde
j        dfde
j        dfde
j        dfde
j        dfde
j        dfde
j        dfde
j        dfde
j        dfde
j        dfde
j        dfZe                                 Ze
j        d
fed<    ede          Ze
j        d fed<    ede          ZdS )!    N)AnyDictIterableOptionalType)	constants
interfacesobjectsc                        e Zd ZdZdedeeef         ddf fdZdedee	j
        j                 fdZedee         fd            Zd	ede	j
        j        fd
Z xZS )NativeTablez&Symbol List that handles Native types.namenative_dictionaryreturnNc                 0   t                                          ||            t          j        |          | _        i | _        | j        D ]}| j        |         \  }}|| j        |<   t          | j                                      h d          | _        d S )N>   enumvoidarraybytesstringbitfieldfunction)	super__init__copydeepcopy_native_dictionary
_overridessetunion_types)selfr   r   native_typenative_class_native_struct	__class__s         V/home/panchajanya/Development/work/volatility3/volatility3/framework/symbols/native.pyr   zNativeTable.__init__   s    t$$$"&-0A"B"BIK2 	8 	8K+/+B;+O(L.+7DOK(($12288PPP
 
    c                 Z    | j                             |t          j        d f          \  }}|S )N)r   getr
   Integer)r!   r   ntype_s       r&   get_type_classzNativeTable.get_type_class   s*    *..tgot5LMMqr'   c                     | j         S )z-Returns an iterator of the symbol type names.)r    )r!   s    r&   typeszNativeTable.types   s     {r'   	type_namec                    d}t           j        |v rc|                    t           j                  }t          |          dk    rt	          dt           j         d          |\  }}|t           j        z   }i }d}|dk    s|dk    rt
          j        }n|dk    r%t
          j        }d	|                     d          d
}n|dk    r%t
          j	        }|                     d          i d}nY|dk    r&t
          j
        }d	d	|                     d          d}n-|dk    rt
          j        }dd	i}n|dk    rt
          j        }dd	i}|t          j        j        |fd||z   i|S | j        |         \  }}|dk    rd|                     d          i}t          j        j        |                     |          f||z   t          j        | d|S )a&  Resolves a symbol name into an object template.

        This always construct a new python object, rather than using a
        cached value otherwise changes made later may affect the cached
        copy.  Calling clone after every native type construction was
        extremely slow.
            z#SymbolName cannot contain multiple z separatorsNr   r   r   r   )countsubtyper   )	base_typechoicesr   )	start_bitend_bitr6   r   
max_lengthr   lengthr0   pointerr5   )r0   data_format)r   BANGsplitlen
ValueErrorr
   VoidArrayget_typeEnumerationBitFieldStringBytes	templatesObjectTemplater   r-   DataFormatInfo)	r!   r0   prefix
name_split
table_name
additionalobj_native_typenative_formats	            r&   rD   zNativeTable.get_type$   s'    >Y&&"88J:"" U).UUU   %/!J	).0F%'
BF)z"9"9,CC'!!-C#$v1F1FGGJJ&  %C'+}}V'<'<LLJJ*$$"C!]]622 JJ
 ("".C&*JJ'!!-C"AJ?$3 %	15?   '+&=i&H#m	!!#T]]6%:%:;J /	**
y(.>
 
 	
 
 	
r'   )__name__
__module____qualname____doc__strr   r   r   r   r	   r
   ObjectInterfacer-   propertyr   r/   TemplaterD   __classcell__)r%   s   @r&   r   r      s        00

S 

T#s(^ 

 

 

 

 

 

 

3 4
0B0R+S     x}    X7
# 7
**<*E 7
 7
 7
 7
 7
 7
 7
 7
r'   r   int)   littleTlongzunsigned long)r]   r^   Fzunsigned intchar)   r^   Tbytezunsigned char)ra   r^   Fzunsigned short int)r3   r^   Fzunsigned shortzunsigned be short)r3   bigFshort)r3   r^   Tz	long long)   r^   Tzunsigned long longfloatdoublewcharr<   native)re   r^   F)r   typingr   r   r   r   r   volatility3.frameworkr   r	   r
   symbolsNativeTableInterfacer   r*   rH   Float
std_ctypesnative_typesPointerx86NativeTablex64NativeTable r'   r&   <module>ru      s/  
  6 6 6 6 6 6 6 6 6 6 6 6 6 6 @ @ @ @ @ @ @ @ @ @P
 P
 P
 P
 P
*$9 P
 P
 P
f	GO01
W_12 go';< W_&:;	
 W_12 W]/0 go';< 7?,@A w(<= '/+<= go23 '/#67 7?,?@ gm01 w}12  go34!
$   "?,@AY X|44"?,@AY X|44r'   