+
    ¿Ìj°.  ã                   ó†   € R t R.t^ RIt^ RIt^ RIHtHtHtHtH	t	H
t
 ^RIHt ]	! R4      t ! R R]P                  4      tR# )z9
Module for helper classes to different data structures.
ÚBytesReaderN)ÚAnyÚOptionalÚTupleÚTypeÚTypeVarÚUnion)Ú	constantsÚ_Tc                   óæ  a a€ ] tR t^t oRtRR/V3R lV 3R llltR3V3R lR lltR4V3R lR	 lltR4V3R
 lR lltV3R lR lt	V3R lR lt
V3R lR ltR3V3R lR lltV3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R  lR! ltV3R" lR# ltV3R$ lR% ltV3R& lR' ltV3R( lR) ltV3R* lR+ ltV3R, lR- ltV3R. lR/ ltV3R0 lR1 ltR2tVtV ;t# )5r   zV
Extension of io.BytesIO that allows you to read specific data types from the
stream.
ÚlittleEndianTc                ó    <€ V ^8„  d   QhRS[ /# )é   r   )Úbool)ÚformatÚ__classdict__s   "€Úy/home/l0st/web/w4ttz.lol/public_html/toolz/MsgDoxxer/venv/lib/python3.14/site-packages/extract_msg/structures/_helpers.pyÚ__annotate__ÚBytesReader.__annotate__   s   ø€ ÷ 5ñ 5©Dñ 5ó    c               óJ  <€ \         SV `  ! V/ VB  \        V4      V n        V P                  '       Ed9   \        P
                  P                  V n        \        P
                  P                  V n	        \        P
                  P                  V n        \        P
                  P                  V n        \        P
                  P                  V n        \        P
                  P                   V n        \        P
                  P$                  V n        \        P
                  P(                  V n        \        P
                  P,                  V n        \        P
                  P0                  V n        R # \        P
                  P4                  V n        \        P
                  P6                  V n	        \        P
                  P8                  V n        \        P
                  P:                  V n        \        P
                  P<                  V n        \        P
                  P>                  V n        \        P
                  P@                  V n        \        P
                  PB                  V n        \        P
                  PD                  V n        \        P
                  PF                  V n        R # ©N)$ÚsuperÚ__init__r   Ú_BytesReader__ler	   ÚstÚST_LE_I8Ú_BytesReader__int8_tÚ	ST_LE_I16Ú_BytesReader__int16_tÚ	ST_LE_I32Ú_BytesReader__int32_tÚ	ST_LE_I64Ú_BytesReader__int64_tÚ	ST_LE_UI8Ú_BytesReader__uint8_tÚ
ST_LE_UI16Ú_BytesReader__uint16_tÚ
ST_LE_UI32Ú_BytesReader__uint32_tÚ
ST_LE_UI64Ú_BytesReader__uint64_tÚ	ST_LE_F32Ú_BytesReader__float_tÚ	ST_LE_F64Ú_BytesReader__double_tÚST_BE_I8Ú	ST_BE_I16Ú	ST_BE_I32Ú	ST_BE_I64Ú	ST_BE_UI8Ú
ST_BE_UI16Ú
ST_BE_UI32Ú
ST_BE_UI64Ú	ST_BE_F32Ú	ST_BE_F64)Úselfr   ÚargsÚkwargsÚ	__class__s   &$*,€r   r   ÚBytesReader.__init__   s~  ø€ Ü‰Ò˜$Ð) &Ò)Ü˜Ó&ˆŒ	Ø�9�9‰9Ü%ŸL™L×1Ñ1ˆDŒMÜ&Ÿ\™\×3Ñ3ˆDŒNÜ&Ÿ\™\×3Ñ3ˆDŒNÜ&Ÿ\™\×3Ñ3ˆDŒNÜ&Ÿ\™\×3Ñ3ˆDŒNÜ'Ÿl™l×5Ñ5ˆDŒOÜ'Ÿl™l×5Ñ5ˆDŒOÜ'Ÿl™l×5Ñ5ˆDŒOÜ&Ÿ\™\×3Ñ3ˆDŒNÜ'Ÿl™l×4Ñ4ˆDŽOä%ŸL™L×1Ñ1ˆDŒMÜ&Ÿ\™\×3Ñ3ˆDŒNÜ&Ÿ\™\×3Ñ3ˆDŒNÜ&Ÿ\™\×3Ñ3ˆDŒNÜ&Ÿ\™\×3Ñ3ˆDŒNÜ'Ÿl™l×5Ñ5ˆDŒOÜ'Ÿl™l×5Ñ5ˆDŒOÜ'Ÿl™l×5Ñ5ˆDŒOÜ&Ÿ\™\×3Ñ3ˆDŒNÜ'Ÿl™l×4Ñ4ˆDŽOr   c                ó,   <€ V ^8„  d   QhRS[ RS[RS[ /# )r   ÚencodingÚwidthÚreturn)ÚstrÚint)r   r   s   "€r   r   r   4   s"   ø€ ÷ ñ ©3ð ±sð Á3ñ r   c                óÔ   € V P                  4       p V P                  V4      P                  V4      #   \         d+    T P                  4       T8w  d   T P	                  T4       K(  h i ; i)zÎ
Reads a null terminated string with the specified character width
decoded using the specified encoding. If it cannot be read or cannot be
decoded then the position of the read pointer will not be changed.
)ÚtellÚreadByteStringÚdecodeÚ	ExceptionÚseek)r:   r@   rA   Úpositions   &&& r   Ú_readDecodedStringÚBytesReader._readDecodedString4   s\   € ð —9‘9“;ˆð	Ø×&Ñ& uÓ-×4Ñ4°XÓ>Ð>øÜô 	Ø—)‘)“+ Ô)Ø—	‘	˜(Ö#Øð	ús	   ’2 ²5A'c                ó<   <€ V ^8„  d   QhRS[ RS[S[,          RS[/# )r   ÚlengthÚerrorMsgrB   )rD   r   rC   Úbytes)r   r   s   "€r   r   r   B   s&   ø€ ÷ ñ ¡ð ±¹µð Éñ r   c                ó°   € V^ 8X  d   R# V P                  V4      pV'       d+   \        V4      ^ 8w  d   T;'       g    Rp\        V4      h V# \        R4      h)a¹  
Reads the number of bytes specified and ensures they are all null.

Ensures the reader returns back to the spot before attempting to read if
there are not enough bytes to read.

:param length: The amount of bytes to read.
:param errorMsg: Optional, the error message to use if the bytes are not
    all null.

:returns: The bytes read, if you need them.

:raise IOError: Not enough bytes left to read.
:raises ValueError: Assertion failed.
r   zBytes read were not all null.ú Not enough bytes left in buffer.)ÚtryReadBytesÚsumÚ
ValueErrorÚIOError)r:   rO   rP   Ú	valueReads   &&& r   Ú
assertNullÚBytesReader.assertNullB   sa   € ð" �QŒ;Ùà×%Ñ% fÓ-ˆ	ßÜ�9‹~ Ô"Ø#×FÐFÐ'F�Ü  Ó*Ð*ð #ð Ðô Ð<Ó=Ð=r   c                ó<   <€ V ^8„  d   QhRS[ RS[S[,          RS[ /# )r   ÚvaluerP   rB   )rQ   r   rC   )r   r   s   "€r   r   r   `   s&   ø€ ÷ "ñ "¡ð "±¹#µð "É%ñ "r   c                ó"  € \        V4      ^ 8X  d   R# \        V\        4      '       g   \        R4      hV P	                  \        V4      4      pV'       d1   W18w  d(   T;'       g    Rp\        VP                  WR7      4      h V# \        R4      h)a°  
Reads the number of bytes and compares them to the value provided. If it
does not match, throws a value error.

Ensures the reader returns back to the spot before attempting to read if
there are not enough bytes to read.

:param value: Value to compare read bytes to.
:param errorMsg: Optional, an error message to emit on mismatch. Does
    not apply to the buffer being too small. Allows for a format string
    with the keyword values "expected" and "actual", representing the
    value given to the function and the actual value read, respectively.

:returns: The bytes read, if you need them.

:raises TypeError: The value given was not bytes.
:raises ValueError: Assertion failed.
r   z:param value: was not bytes.z8Value did not match (expected {expected}, got {actual}).)ÚexpectedÚactualrS   )ÚlenÚ
isinstancerQ   Ú	TypeErrorrT   rV   r   rW   )r:   r\   rP   rX   s   &&& r   Ú
assertReadÚBytesReader.assertRead`   s‡   € ô( ˆu‹:˜Œ?Ùä˜%¤×'Ò'ÜÐ:Ó;Ð;à×%Ñ%¤c¨%£jÓ1ˆ	ßØÔ!Ø#×aÐaÐ'a�Ü  §¡¸E Ó!VÓWÐWð "ð Ðô Ð<Ó=Ð=r   c                ó    <€ V ^8„  d   QhRS[ /# ©r   rB   ©rC   )r   r   s   "€r   r   r   „   s   ø€ ÷ /ñ /¡ñ /r   c                ó$   € V P                  R4      # )z0
Reads a null-terminated string in ANSI format.
Úansi©rL   ©r:   s   &r   ÚreadAnsiStringÚBytesReader.readAnsiString„   s   € ð ×&Ñ& vÓ.Ð.r   c                ó    <€ V ^8„  d   QhRS[ /# rf   rg   )r   r   s   "€r   r   r   Š   s   ø€ ÷ 0ñ 0¡ñ 0r   c                ó$   € V P                  R4      # )z1
Reads a null-terminated string in ASCII format.
Úasciirj   rk   s   &r   ÚreadAsciiStringÚBytesReader.readAsciiStringŠ   ó   € ð ×&Ñ& wÓ/Ð/r   c                ó    <€ V ^8„  d   QhRS[ /# rf   ©rD   )r   r   s   "€r   r   r   �   ó   ø€ ÷ >ñ >™#ñ >r   c                óŽ   € V P                  ^4      pV'       d#   V P                  P                  V4      ^ ,          # \        R4      h©z&
Reads a signed byte from the stream.
rS   )rT   r   ÚunpackrW   ©r:   r\   s   & r   ÚreadByteÚBytesReader.readByte�   s=   € ð ×!Ñ! !Ó$ˆßØ—=‘=×'Ñ'¨Ó.¨qÕ1Ð1äÐ<Ó=Ð=r   c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r   rA   rB   ©rD   rQ   )r   r   s   "€r   r   r   š   s   ø€ ÷ #ñ #¡Cð #±ñ #r   c                ó  € V^8  d   \        R4      hV P                  4       pRpRV,          p V P                  V4      pVR8X  d4   V P                  4       V8w  d   V P                  V4       K(  \	        R4      hWT8X  d   V# W5,          pK^  )aG  
Reads a string of bytes until it finds the null character, returning
everything before that and consuming the null. Unlike other string
functions, this will not decode the data into a string.

:param width: tells how big a character is (in bytes), so this function
can be used for strings whose characters are multiple bytes.
z#Character width must be at least 1.r   ó    zCould not find null character.)rV   rF   ÚreadrJ   rW   )r:   rA   rK   ÚstringÚnullÚnextChars   &&    r   rG   ÚBytesReader.readByteStringš   s…   € ð �1Œ9ÜÐBÓCÐCà—9‘9“;ˆØˆØ˜�ˆàØ—y‘y Ó'ˆHØ˜3Œð —i‘i“k XÔ-Ø—I‘I˜hÖ'ÜÐ>Ó?Ð?ØÔ!à�ð Õ"’r   c                ó6   <€ V ^8„  d   QhRS[ S[,          RS[/# )r   Ú_classrB   )r   r
   )r   r   s   "€r   r   r   ¹   s   ø€ ÷ >ñ >¡¡R¥ð >©Rñ >r   c                ó¨   € \        VR4      '       g   \        R4      hV P                  VP                  4      pV'       d	   V! V4      # \	        R4      h)aH  
Takes anything with a __SIZE__ property and a call function that takes
a single bytes argument and returns the result of that function.

Generally, this is intended to take a fixed-size class and return an
instance of the class created with that amount of bytes. However, there
is little reason to truly limit it to only that.
Ú__SIZE__z5Argument to readClass MUST have a __SIZE__ attribute.rS   )Úhasattrrb   rT   r‰   rW   )r:   r‡   r\   s   && r   Ú	readClassÚBytesReader.readClass¹   sJ   € ô �v˜z×*Ò*ÜÐSÓTÐTØ×!Ñ! &§/¡/Ó2ˆßÙ˜%“=Ð äÐ<Ó=Ð=r   c                ó    <€ V ^8„  d   QhRS[ /# rf   ©Úfloat)r   r   s   "€r   r   r   Ê   s   ø€ ÷ >ñ >™Eñ >r   c                óŽ   € V P                  ^4      pV'       d#   V P                  P                  V4      ^ ,          # \        R4      h)z!
Reads a double from the stream.
rS   )rT   r/   ry   rW   rz   s   & r   Ú
readDoubleÚBytesReader.readDoubleÊ   ó=   € ð ×!Ñ! !Ó$ˆßØ—?‘?×)Ñ)¨%Ó0°Õ3Ð3äÐ<Ó=Ð=r   c                ó    <€ V ^8„  d   QhRS[ /# rf   rŽ   )r   r   s   "€r   r   r   Ô   s   ø€ ÷ >ñ >™5ñ >r   c                óŽ   € V P                  ^4      pV'       d#   V P                  P                  V4      ^ ,          # \        R4      h)z 
Reads a float from the stream.
rS   )rT   r-   ry   rW   rz   s   & r   Ú	readFloatÚBytesReader.readFloatÔ   ó=   € ð ×!Ñ! !Ó$ˆßØ—>‘>×(Ñ(¨Ó/°Õ2Ð2äÐ<Ó=Ð=r   c                ó    <€ V ^8„  d   QhRS[ /# rf   ru   )r   r   s   "€r   r   r   Þ   s   ø€ ÷ >ñ >™ñ >r   c                óŽ   € V P                  ^4      pV'       d#   V P                  P                  V4      ^ ,          # \        R4      h)z%
Reads a signed int from the stream.
rS   )rT   r!   ry   rW   rz   s   & r   ÚreadIntÚBytesReader.readIntÞ   r˜   r   c                ó    <€ V ^8„  d   QhRS[ /# rf   ru   )r   r   s   "€r   r   r   è   rv   r   c                óŽ   € V P                  ^4      pV'       d#   V P                  P                  V4      ^ ,          # \        R4      hrx   )rT   r#   ry   rW   rz   s   & r   ÚreadLongÚBytesReader.readLongè   r˜   r   c                ó    <€ V ^8„  d   QhRS[ /# rf   ru   )r   r   s   "€r   r   r   ò   s   ø€ ÷ >ñ >™3ñ >r   c                óŽ   € V P                  ^4      pV'       d#   V P                  P                  V4      ^ ,          # \        R4      h)z'
Reads a signed short from the stream.
rS   )rT   r   ry   rW   rz   s   & r   Ú	readShortÚBytesReader.readShortò   r˜   r   c                ód   <€ V ^8„  d   QhRS[ S[P                  S[3,          RS[S[R3,          /# )r   Ú_structrB   .)r   ÚstructÚStructr   r   )r   r   s   "€r   r   r   ü   s1   ø€ ÷ >ñ >¡%©¯©±sÐ(:Õ";ð >ÁÁcÈ3ÀhÅñ >r   c                ó€   € V P                  VP                  4      pV'       d   VP                  V4      # \        R4      h)aW  
Read enough bytes for a struct and unpack it, returning the tuple of
values.

:param _struct: A struct or struct-like object using duck-typing. Only
    requires the object have an unpack method that takes a single
    argument and a size property to tell how many bytes to read.

:raises IOError: If there are not enough bytes left to read.
rS   )rT   Úsizery   rW   )r:   r¦   r\   s   && r   Ú
readStructÚBytesReader.readStructü   s6   € ð ×!Ñ! '§,¡,Ó/ˆßØ—>‘> %Ó(Ð(äÐ<Ó=Ð=r   c                ó    <€ V ^8„  d   QhRS[ /# rf   ru   )r   r   s   "€r   r   r     ó   ø€ ÷ >ñ >¡#ñ >r   c                óŽ   € V P                  ^4      pV'       d#   V P                  P                  V4      ^ ,          # \        R4      h)z)
Reads an unsigned byte from the stream.
rS   )rT   r%   ry   rW   rz   s   & r   ÚreadUnsignedByteÚBytesReader.readUnsignedByte  r˜   r   c                ó    <€ V ^8„  d   QhRS[ /# rf   ru   )r   r   s   "€r   r   r     s   ø€ ÷ >ñ >¡ñ >r   c                óŽ   € V P                  ^4      pV'       d#   V P                  P                  V4      ^ ,          # \        R4      h)z(
Reads an unsigned int from the stream.
rS   )rT   r)   ry   rW   rz   s   & r   ÚreadUnsignedIntÚBytesReader.readUnsignedInt  r“   r   c                ó    <€ V ^8„  d   QhRS[ /# rf   ru   )r   r   s   "€r   r   r   !  r®   r   c                óŽ   € V P                  ^4      pV'       d#   V P                  P                  V4      ^ ,          # \        R4      h)z)
Reads an unsigned long from the stream.
rS   )rT   r+   ry   rW   rz   s   & r   ÚreadUnsignedLongÚBytesReader.readUnsignedLong!  r“   r   c                ó    <€ V ^8„  d   QhRS[ /# rf   ru   )r   r   s   "€r   r   r   +  s   ø€ ÷ >ñ >¡3ñ >r   c                óŽ   € V P                  ^4      pV'       d#   V P                  P                  V4      ^ ,          # \        R4      h)z*
Reads an unsigned short from the stream.
rS   )rT   r'   ry   rW   rz   s   & r   ÚreadUnsignedShortÚBytesReader.readUnsignedShort+  r“   r   c                ó    <€ V ^8„  d   QhRS[ /# rf   rg   )r   r   s   "€r   r   r   5  s   ø€ ÷ 0ñ 0¡ñ 0r   c                ó$   € V P                  R4      # )z1
Reads a null-terminated string in UTF-8 format.
zutf-8rj   rk   s   &r   ÚreadUtf8StringÚBytesReader.readUtf8String5  rs   r   c                ó    <€ V ^8„  d   QhRS[ /# rf   rg   )r   r   s   "€r   r   r   ;  ó   ø€ ÷ Uñ U¡ñ Ur   c                óX   € T P                  V P                  '       d   R^4      # R^4      # )zs
Reads a null terminated string in UTF-16 format using the endienness of
the reader to determine which one to use.
z	utf-16-lez	utf-16-be©rL   r   rk   s   &r   ÚreadUtf16StringÚBytesReader.readUtf16String;  ó+   € ð
 ×&Ñ&°d·i·i°i {ÐRSÓTÐTÀ[ÐRSÓTÐTr   c                ó    <€ V ^8„  d   QhRS[ /# rf   rg   )r   r   s   "€r   r   r   B  rÃ   r   c                óX   € T P                  V P                  '       d   R^4      # R^4      # )zs
Reads a null terminated string in UTF-32 format using the endienness of
the reader to determine which one to use.
z	utf-32-lez	utf-32-berÅ   rk   s   &r   ÚreadUtf32StringÚBytesReader.readUtf32StringB  rÈ   r   c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r   rª   rB   r~   )r   r   s   "€r   r   r   I  s   ø€ ÷ ñ ¡ð ©ñ r   c                óà   € V^8  d   \        R4      hV P                  4       pV P                  V4      p\        V4      V8X  d   V# V P                  4       V8w  d   V P	                  V4       K(  R# )z˜
Tries to read the specified number of bytes, returning b'' if not
possible. Will only change the position of the read pointer if reading
was possible.
z :param size: must be at least 1.r   )rV   rF   r�   r`   rJ   )r:   rª   rK   r\   s   &&  r   rT   ÚBytesReader.tryReadBytesI  s_   € ð �!Œ8ÜÐ?Ó@Ð@Ø—9‘9“;ˆØ—	‘	˜$“ˆÜˆu‹:˜ÔØˆLð �i‰i‹k˜XÔ%Ø�I‰I�hÖÙr   )Ú
__double_tÚ	__float_tÚ	__int16_tÚ	__int32_tÚ	__int64_tÚ__int8_tÚ__leÚ
__uint16_tÚ
__uint32_tÚ
__uint64_tÚ	__uint8_t)é   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   rL   rY   rc   rl   rq   r{   rG   r‹   r‘   r–   r›   rŸ   r£   r«   r°   r´   r¸   r¼   rÀ   rÆ   rË   rT   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r=   r   s   @@r   r   r      s  ù‡ € ñð
5°4÷ 5õ 5÷4ò ÷ò ÷<"ò "÷H/ð /÷0ð 0÷>ð >÷#ò #÷>>ð >÷">ð >÷>ð >÷>ð >÷>ð >÷>ð >÷>ð >÷">ð >÷>ð >÷>ð >÷>ð >÷0ð 0÷Uð U÷Uð U÷÷ ð r   )rà   Ú__all__Úior§   Útypingr   r   r   r   r   r   Ú r	   r
   ÚBytesIOr   © r   r   Ú<module>rê      sB   ðñð
 ð€ó
 
Û ç =× =å áˆTƒ]€ôE�"—*‘*ö Er   