
    Xf                     v   d Z ddlmZmZ ddlmZ  G d de          Z G d de          Z G d d	e          Z	 G d
 de          Z
 G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          ZdS )a%  A list of potential exceptions that volatility can throw.

These include exceptions that can be thrown on errors by the symbol
space or symbol tables, and by layers when an address is invalid.  The
:class:`PagedInvalidAddressException` contains information about the
size of the invalid page.
    )DictOptional)
interfacesc                       e Zd ZdZdS )VolatilityExceptionz5Class to allow filtering of all VolatilityExceptions.N__name__
__module____qualname____doc__     R/home/panchajanya/Development/work/volatility3/volatility3/framework/exceptions.pyr   r      s        ????r   r   c                       e Zd ZdZdS )PluginVersionExceptionzMClass to allow determining that a required plugin has an invalid
    version.Nr   r   r   r   r   r      s           r   r   c                       e Zd ZdZdS )PluginRequirementExceptionzQClass to allow plugins to indicate that a requirement has not been
    fulfilled.Nr   r   r   r   r   r      s           r   r   c                   H     e Zd ZdZdee         dee         ddf fdZ xZS )SymbolErrorz'Thrown when a symbol lookup has failed.symbol_name
table_namereturnNc                 P     t                      j        |  || _        || _        d S N)super__init__r   r   )selfr   r   args	__class__s       r   r   zSymbolError.__init__!   s,     	$&$r   )r	   r
   r   r   r   strr   __classcell__r   s   @r   r   r      sc        11%#C=%6>sm%	% % % % % % % % % %r   r   c                   ,     e Zd ZdZdeddf fdZ xZS )LayerExceptionz;Thrown when an error occurs dealing with memory and layers.
layer_namer   Nc                 B     t                      j        |  || _        d S r   )r   r   r%   )r   r%   r   r   s      r   r   zLayerException.__init__,   s"    $$r   )r	   r
   r   r   r    r   r!   r"   s   @r   r$   r$   )   sQ        EE%3 %$ % % % % % % % % % %r   r$   c                   0     e Zd ZdZdededdf fdZ xZS )InvalidAddressExceptionzBThrown when an address is not valid in the layer it was requested.r%   invalid_addressr   Nc                 J     t                      j        |g|R   || _        d S r   )r   r   r)   )r   r%   r)   r   r   s       r   r   z InvalidAddressException.__init__4   s0    +d++++.r   r	   r
   r   r   r    intr   r!   r"   s   @r   r(   r(   1   sX        LL/3 / / / / / / / / / / / /r   r(   c            
       8     e Zd ZdZdededededdf
 fdZ xZS )	PagedInvalidAddressExceptiona  Thrown when an address is not valid in the paged space in which it was
    request.  This is a subclass of InvalidAddressException and is only
    thrown from a paged layer.  In most circumstances :class:`InvalidAddressException`
    is the correct exception to throw, since this will catch all invalid
    mappings (including paged ones).

    Includes the invalid address and the number of bits of the address
    that are invalid
    r%   r)   invalid_bitsentryr   Nc                 Z     t                      j        ||g|R   || _        || _        d S r   )r   r   r/   r0   )r   r%   r)   r/   r0   r   r   s         r   r   z%PagedInvalidAddressException.__init__D   s9     	_<t<<<<(


r   r+   r"   s   @r   r.   r.   9   sw         

 
 	

 
 

 
 
 
 
 
 
 
 
 
r   r.   c                   <     e Zd ZdZdedededededdf fd	Z xZS )
SwappedInvalidAddressExceptionzThrown when an address is not valid in the paged layer in which it was
    requested, but expected to be in an associated swap layer.

    Includes the swap lookup, as well as the invalid address and the bits of
    the lookup that were invalid.
    r%   r)   r/   r0   swap_offsetr   Nc                 P     t                      j        ||||g|R   || _        d S r   )r   r   r4   )r   r%   r)   r/   r0   r4   r   r   s          r   r   z'SwappedInvalidAddressException.__init__Y   s8     	_lEQDQQQQ&r   r+   r"   s   @r   r3   r3   Q   s         
'
' 
' 	
'
 
' 
' 

' 
' 
' 
' 
' 
' 
' 
' 
' 
'r   r3   c                       e Zd ZdZdS )SymbolSpaceErrorzGThrown when an error occurs dealing with Symbolspaces and SymbolTables.Nr   r   r   r   r7   r7   f   s        QQQQr   r7   c                   L     e Zd Zdeeej        j        f         ddf fdZ xZ	S )UnsatisfiedExceptionunsatisfiedr   Nc                 V    t                                                       || _        d S r   )r   r   r:   )r   r:   r   s     r   r   zUnsatisfiedException.__init__k   s)     	&r   )
r	   r
   r   r   r    r   configurationRequirementInterfacer   r!   r"   s   @r   r9   r9   j   s]        'Z%=%R RS'	' ' ' ' ' ' ' ' ' 'r   r9   c                   (     e Zd Zdeddf fdZ xZS )MissingModuleExceptionmoduler   Nc                 B     t                      j        |  || _        d S r   )r   r   r@   )r   r@   r   r   s      r   r   zMissingModuleException.__init__s   s"    $r   )r	   r
   r   r    r   r!   r"   s   @r   r?   r?   r   sK        s d          r   r?   c                   2     e Zd ZdZdeddf fdZd Z xZS )OfflineExceptionzKThrow when a remote resource is requested but Volatility is in offline modeurlr   Nc                 B     t                      j        |  || _        d S r   )r   r   _url)r   rD   r   r   s      r   r   zOfflineException.__init__{   s"    $			r   c                     d| j          S )Nz*Volatility 3 is offline: unable to access )rF   )r   s    r   __str__zOfflineException.__str__   s    GDIGGGr   )r	   r
   r   r   r    r   rH   r!   r"   s   @r   rC   rC   x   sg        UUC 4      H H H H H H Hr   rC   N)r   typingr   r   volatility3.frameworkr   	Exceptionr   r   r   r   r$   r(   r.   r3   r7   r9   r?   rC   r   r   r   <module>rL      sa    " ! ! ! ! ! ! ! , , , , , ,@ @ @ @ @) @ @ @    0   
    !4   
% % % % %% % % %% % % % %( % % %/ / / / /n / / /    #:   0' ' ' ' '%A ' ' '*R R R R R* R R R' ' ' ' '. ' ' '    0   H H H H H* H H H H Hr   