+
    ¿Ìj4¸  ã                  ó
  € ^ RI Ht RR.t^ RIt^ RIt^ RIHtHtHtH	t	H
t
HtHtHt ^RIHt ^RIHt ^RIHtHt ^R	IHtHt ^R
IHtHtHt ^ RIHtHt ^ RIHt ]'       d   ^RI H!t!  ! R R4      t" ! R R4      t#R R lt$R# )é    )ÚannotationsÚDirectoryEntryÚ	OleWriterN)ÚDictÚIteratorÚListÚOptionalÚSupportsBytesÚTupleÚTYPE_CHECKINGÚUnion)Ú	constants)ÚMSG_PATH)ÚColorÚDirectoryEntryType)ÚStandardViolationErrorÚTooManySectorsError)ÚceilDivÚdictGetCasedKeyÚinputToMsgPath)ÚOleDirectoryEntryÚ	OleFileIO)ÚRedBlackTree)ÚMSGFilec                  ó<  € ] tR t^ t$ RtRtR]R&   RtR]R&   RtR]R&   Rt	R]R	&   ^ t
R
]R&   ^ tR
]R&   ^ tR
]R&   ]P                  tR]R&   R"tR
]R&   RtR
]R&   RtR
]R&   RtR
]R&   ^ tR
]R&   ]P,                  tR]R&   RtR]R&   RtR]R&   R R ltR R  ltR!tR# )#r   z}
An internal representation of a stream or storage in the OleWriter.

Originals should be inaccessible outside of the class.
Ú ÚstrÚnameNzOptional[DirectoryEntry]Ú
rightChildÚ	leftChildÚchildTreeRootÚintÚ	stateBitsÚcreationTimeÚmodifiedTimer   ÚtypeÚidì   ÿÿ ÚleftSiblingIDÚrightSiblingIDÚchildIDÚstartingSectorLocationr   Úcoloró                   ÚbytesÚclsidó    Údatac               ó   € V ^8„  d   QhRR/# ©é   Úreturnr/   © )Úformats   "Úp/home/l0st/web/w4ttz.lol/public_html/toolz/MsgDoxxer/venv/lib/python3.14/site-packages/extract_msg/ole_writer.pyÚ__annotate__ÚDirectoryEntry.__annotate__=   s   € ÷ ñ ˜5ñ r1   c                	ó"   € V P                  4       # ©N)ÚtoBytes©Úselfs   &r9   Ú	__bytes__ÚDirectoryEntry.__bytes__=   s   € Ø�|‰|‹~Ðr1   c               ó   € V ^8„  d   QhRR/# r4   r7   )r8   s   "r9   r:   r;   @   s   € ÷ /ñ /˜ñ /r1   c                ó¾  € \        V P                  4      ^8”  d   \        R4      h\        V P                  4      ^8  d   \        R4      h\        P                  ! RV P                  4      '       d   \        R4      hV P                  P                  R4      p\        P                  P                  P                  V\        V4      ^,           V P                  V P                  V P                  V P                  V P                  V P                  V P                   V P"                  V P$                  V P&                  \)        V R\        V P*                  4      4      4      # )z5
Converts the entry to bytes to be writen to a file.
z%Name is too long for directory entry.z!Directory entry must have a name.z/\\:!z3Directory entry name contains an illegal character.z	utf-16-leÚ
streamSize)Úlenr   Ú
ValueErrorÚreÚsearchÚencoder   ÚstÚST_CF_DIR_ENTRYÚpackr&   r-   r)   r*   r+   r0   r#   r$   r%   r,   Úgetattrr2   )r@   Ú	nameBytess   & r9   r>   ÚDirectoryEntry.toBytes@   s  € ô
 ˆt�y‰y‹>˜BÔÜÐDÓEÐEÜˆt�y‰y‹>˜AÔÜÐ@ÓAÐAÜ�9Š9�Y §	¡	×*Ò*ÜÐRÓSÐSà—I‘I×$Ñ$ [Ó1ˆ	ä�|‰|×+Ñ+×0Ñ0Ø.7Ü.1°)«n¸qÕ.@Ø.2¯i©iØ.2¯j©jØ.2×.@Ñ.@Ø.2×.AÑ.AØ.2¯l©lØ.2¯j©jØ.2¯n©nØ.2×.?Ñ.?Ø.2×.?Ñ.?Ø.2×.IÑ.IÜ.5°d¸LÌ#ÈdÏiÉiË.Ó.Yó/ð 	/r1   r7   éÿÿÿÿ)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__annotations__r   r    r!   r#   r$   r%   r   ÚUNALLOCATEDr&   r'   r)   r*   r+   r,   r   ÚBLACKr-   r0   r2   rA   r>   Ú__static_attributes__r7   r1   r9   r   r       sÉ   ‡ ñð
 €Dˆ#ƒNØ+/€JÐ(Ó/Ø*.€IÐ'Ó.Ø.2€MÐ+Ó2Ø€IˆsÓØ€L�#ÓØ€L�#ÓØ1×=Ñ=€DÐ
Ó=ð €BˆƒLð $€M�3Ó#Ø$€N�CÓ$à€GˆSÓØ"#Ð˜CÓ#Ø—;‘;€Eˆ5ÓàV€Eˆ5ÓVØ€Dˆ%Óõ÷/ñ /r1   c                  óþ  € ] tR t^`tRt]P                  3R R lltRBR R lltR R lt	R R	 lt
R
 R ltR R lt]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       tR R ltR R ltR R ltR  R! ltR" R# ltR$ R% ltR& R' ltR( R) ltRCR+ R, lltRDR- R. lltR/ R0 ltR1 R2 ltRER3 R4 llt . 3R5 R6 llt!R7 R8 lt"RBR9 R: llt#R; R< lt$R= R> lt%R? R@ lt&RAt'R*# )Fr   zQ
Takes data to write to a compound binary format file, as specified in
[MS-CFB].
c               ó   € V ^8„  d   QhRR/# )r5   Ú	rootClsidr/   r7   )r8   s   "r9   r:   ÚOleWriter.__annotate__e   s   € ÷ ñ  %ñ r1   c                	óø   € \        4       V n        R V P                  n        \        P                  V P                  n        WP                  n        ^V n        / V n        . V n	        ^ V n
        ^ V n        ^V n        R# )z
Root EntryN)r   Ú_OleWriter__rootEntryr   r   ÚROOT_STORAGEr&   r0   Ú_OleWriter__dirEntryCountÚ_OleWriter__dirEntriesÚ_OleWriter__largeEntriesÚ_OleWriter__largeEntrySectorsÚ_OleWriter__numMinifatSectorsÚ_OleWriter__version)r@   r]   s   &&r9   Ú__init__ÚOleWriter.__init__e   sl   € Ü)Ó+ˆÔØ ,ˆ×ÑÔÜ 2× ?Ñ ?ˆ×ÑÔØ!*×ÑÔà ˆÔØˆÔØ46ˆÔØ#$ˆÔ Ø#$ˆÔ ð ˆŽr1   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r5   Úpathú	List[str]ÚentryExistsÚboolÚcreater6   r   r7   )r8   s   "r9   r:   r^   t   s*   € ÷ 3ñ 3¨9ð 3À4ð 3ÐX\ð 3Ðimñ 3r1   c                ó4  € V'       g   \        R4      hV'       d   V'       d   \        R4      h\        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       d   \        R4      hV P                  p\	        VRR 4       F§  w  rVVP                  4       \        \        P
                  VP                  4       4      9  d5   V'       d   V P                  VRV^,            RR7       M\        R	V 24      hV\        WF4      ,          p\        V\        4      '       d   Kž  \        R
4      h	  V'       dX   VR,          P                  4       \        \        P
                  VP                  4       4      9  d   \        R	VR,           24      hV# )a†  
Finds the storage ``dict`` internally where the entry specified by
:param path: would be created.

:param entryExists: If ``True``, throws an error when the requested
    entry does not yet exist.
:param create: If ``True``, creates missing storages with default
    settings.

:raises OSError: If :param create: is ``False`` and the path could not
    be found. Also raised if :param entryExists: is ``True`` and the
    requested entry does not exist.
:raises ValueError: Tried to access an interal stream or tried to use
    both the create option and the entryExists option is ``True``.

:returns: The storage ``dict`` that the entry is in.
zPath cannot be empty.zj:param create: and :param entryExists: cannot both be True (an entry cannot exist if it is being created).c              3  óB   "  € T F  qP                  R 4      x € K  	  R# 5i)ú::N)Ú
startswith©Ú.0Úxs   & r9   Ú	<genexpr>Ú3OleWriter.__getContainingStorage.<locals>.<genexpr>�   s   é € Ð0©4 a�|‰|˜D×!Ð!«4ùs   ‚TFzFound internal name in path.N)ÚstoragezEntry not found: z)Attempted to access children of a stream.rQ   )ÚOSErrorrG   Úanyrc   Ú	enumerateÚlowerÚmapr   ÚkeysÚaddEntryr   Ú
isinstanceÚdict)r@   rk   rm   ro   Ú_dirÚindexr   s   &&&&   r9   Ú__getContainingStorageÚ OleWriter.__getContainingStoraget   s@  € ÷$ ÜÐ1Ó2Ð2÷ —kÜð  Jó  Kð  K÷
 ‹3Ñ0©4Ó0�3�3Š3Ñ0©4Ó0×0Ò0ÜÐ;Ó<Ð<à× Ñ ˆä$ T¨#¨2 YÖ/‰KˆEð �z‰z‹|¤3¤s§y¡y°$·)±)³+Ó#>Ô>ßØ—M‘M $ z¨°­	Ð"2¸d�MÕCä!Ð$5°d°VÐ"<Ó=Ð=Øœ¨Ó3Õ4ˆDô ˜d¤D×)Ô)ÜÐIÓJÐJñ 0÷ ˜4 �8Ÿ>™>Ó+´3´s·y±yÀ$Ç)Á)Ã+Ó3NÔNÜÐ-¨d°2­h¨ZÐ8Ó9Ð9àˆr1   c               ó    € V ^8„  d   QhRRRR/# )r5   rk   rl   r6   r   r7   )r8   s   "r9   r:   r^   ©   s   € ÷ ñ ˜yð ¨^ñ r1   c                ó˜   € V P                  V4      pV\        W!R,          4      ,          p\        V\        4      '       d
   VR,          # V# )z¹
Finds and returns an existing ``DirectoryEntry`` instance in the writer.

:raises OSError: If the entry does not exist.
:raises ValueError: If access to an internal item is attempted.
ú::DirectoryEntryrQ   )Ú _OleWriter__getContainingStorager   r�   r‚   )r@   rk   rƒ   Úitems   &&  r9   Ú
__getEntryÚOleWriter.__getEntry©   sE   € ð ×*Ñ*¨4Ó0ˆØ”O D¨r­(Ó3Õ4ˆÜ�dœD×!Ò!ØÐ*Õ+Ð+àˆKr1   c               ó   € V ^8„  d   QhRR/# )r5   Úentryr   r7   )r8   s   "r9   r:   r^   ·   s   € ÷ B(ñ B( >ñ B(r1   c                óv  € VP                  R4      pVP                  R4      pVP                  R4      pVP                  R4      pVP                  R4      pVeg   VP                  \        P                  Jd   \	        R4      h\        V\        4      '       g    \        V4      p\        V4      R	8”  d   \        R
4      hVe=   \        V\        4      '       g   \        R4      h\        V4      ^8w  d   \        R4      hVeY   VP                  \        P                  J d   \        R4      h\        V\        4      '       d   V^ 8  g   VR8”  d   \        R4      hVeY   VP                  \        P                  J d   \        R4      h\        V\        4      '       d   V^ 8  g   VR8”  d   \        R4      hVe0   \        V\        4      '       d   V^ 8  g   VR8”  d   \        R4      hVe   W1n        Ve   WAn        Ve   WQn        Ve   Wan        Ve	   Wqn        R# R#   \         d    \        R4      hi ; i)a9  
Edits the DirectoryEntry with the data provided.

Common code used for :meth:`addEntry` and :meth:`editEntry`.

:raises TypeError: Attempted to modify the data of a storage.
:raises ValueError: Some part of the data given to modify the various
    properties was invalid. See the the listed methods for details.
r2   r0   r$   r%   r#   Nz(Cannot set the data of a storage object.z=Data must be a bytes instance or convertable to bytes if set.ì        úWCurrent version of extract_msg does not support streams greater than 2 GB in OLE files.zCLSID must be bytes.zCLSID must be 16 bytes.z9Modification of creation time cannot be done on a stream.l   ÿÿÿÿ z,Creation time must be a positive 8 byte int.z9Modification of modified time cannot be done on a stream.z,Modified time must be a positive 8 byte int.r(   z)State bits must be a positive 4 byte int.)Úgetr&   r   ÚSTREAMÚ	TypeErrorr�   r/   Ú	ExceptionrG   rF   r"   r2   r0   r$   r%   r#   )r@   r�   Úkwargsr2   r0   r$   r%   r#   s   &&,     r9   Ú__modifyEntryÚOleWriter.__modifyEntry·   s  € ð �z‰z˜&Ó!ˆØ—
‘
˜7Ó#ˆØ—z‘z .Ó1ˆØ—z‘z .Ó1ˆØ—J‘J˜{Ó+ˆ	ð
 ÒØ�z‰zÔ!3×!:Ñ!:Ó:ÜÐ JÓKÐKÜ˜d¤E×*Ò*ðfÜ  ›;�Dô �4‹y˜:Ô%Ü Ð!zÓ{Ð{àÒÜ˜e¤U×+Ò+Ü Ð!7Ó8Ð8Ü�5‹z˜RÔÜ Ð!:Ó;Ð;àÒ#Ø�z‰zÔ/×6Ñ6Ó6Ü Ð!\Ó]Ð]Ü˜l¬C×0Ò0°LÀ1Ô4DÈÐWiÔHiÜ Ð!OÓPÐPàÒ#Ø�z‰zÔ/×6Ñ6Ó6Ü Ð!\Ó]Ð]Ü˜l¬C×0Ò0°LÀ1Ô4DÈÐWiÔHiÜ Ð!OÓPÐPàÒ Ü˜i¬×-Ò-°¸Q´À)ÈjÔBXÜ Ð!LÓMÐMð ÒØŒJØÒØŒKØÒ#Ø!-ÔØÒ#Ø!-ÔØÒ Ø'ŽOñ !øôO !ô fÜ$Ð%dÓeÐeðfús   ÂH! È!H8c               ó   € V ^8„  d   QhRR/# ©r5   r6   ÚNoner7   )r8   s   "r9   r:   r^   û   s   € ÷ \ñ \ dñ \r1   c                ó`  € ^ V n         ^ V n        V P                  P                  4        ^ V n        V P                  4        Fê  pV ;P                   ^,          un         VP                  \        P                  8X  g   K=  \        VP                  4      R8  d9   V ;P                  \        \        VP                  4      ^@4      ,          un        K�  V P                  P                  V4       V ;P                  \        \        VP                  4      V P                  4      ,          un        Kì  	  R# )z
Recalculates several of the internal variables used for saving that
specify the number of sectors and where things should go.
é   N)rb   rf   rd   Úclearre   Ú_OleWriter__walkEntriesr&   r   r”   rF   r2   r   ÚappendÚ_OleWriter__sectorSize©r@   r�   s   & r9   Ú__recalculateSectorsÚOleWriter.__recalculateSectorsû   sÏ   € ð
  !ˆÔØ#$ˆÔ Ø×Ñ×!Ñ!Ô#Ø#$ˆÔ à×'Ñ'Ö)ˆEØ× Ò  AÕ%Õ Ø�z‰zÔ/×6Ñ6Ö6Ü�u—z‘z“? TÔ)Ø×,Ò,´¼¸E¿J¹J»ÈÓ0LÕL×,à×'Ñ'×.Ñ.¨uÔ5Ø×,Ò,´¼¸E¿J¹J»È×IZÑIZÓ0[Õ[×,ó *r1   c               ó   € V ^8„  d   QhRR/# )r5   r6   zIterator[DirectoryEntry]r7   )r8   s   "r9   r:   r^     s   € ÷ #ñ #Ð7ñ #r1   c              #  óZ  "  € V P                   .pV P                  x € \        V4      ^ 8”  d|   VP                  ^ 4      P	                  4        FV  w  r#VP                  R4      '       d   K  \        V\        4      '       d   VR,          x € VP                  V4       KR  Vx € KX  	  K‹  R# 5i)zz
Returns a generator that will walk the entires recursively.

Each item returned by it will be a DirectoryEntry instance.
rr   r‰   N)	rc   r`   rF   ÚpopÚitemsrs   r�   r‚   r¡   )r@   Ú	toProcessr   r‹   s   &   r9   Ú__walkEntriesÚOleWriter.__walkEntries  s‹   é € ð ×&Ñ&Ð'ˆ	Ø×ÑÒä�)‹n˜qÔ Ø'Ÿm™m¨AÓ.×4Ñ4Ö6‘
�Ø—‘ t×,Ô,Ü! $¬×-Ò-Ø"Ð#5Õ6Ò6Ø!×(Ñ(¨Ö.à"œ
ó 7ñ !ùs   ‚A$B+Á+A B+c               ó   € V ^8„  d   QhRR/# ©r5   r6   r"   r7   )r8   s   "r9   r:   r^   !  s   € ÷ (ñ ( Cñ (r1   c                ó(   € V P                   ^€,          # )z;
The number of Directory Entries that can fit in a sector.
©r¢   r?   s   &r9   Ú__dirEntsPerSectorÚOleWriter.__dirEntsPerSector   s   € ð
 × Ñ  CÕ'Ð'r1   c               ó   € V ^8„  d   QhRR/# r®   r7   )r8   s   "r9   r:   r^   (  s   € ÷ &ñ & #ñ &r1   c                ó(   € V P                   ^,          # )z+
The number of links per FAT/DIFAT sector.
r°   r?   s   &r9   Ú__linksPerSectorÚOleWriter.__linksPerSector'  s   € ð
 × Ñ  AÕ%Ð%r1   c               ó   € V ^8„  d   QhRR/# r®   r7   )r8   s   "r9   r:   r^   /  s   € ÷ 'ñ '¨ñ 'r1   c                ó(   € V P                   ^@,          # )z=
The number of mini sectors that a regular sector will hold.
r°   r?   s   &r9   Ú__miniSectorsPerSectorÚ OleWriter.__miniSectorsPerSector.  s   € ð
 × Ñ  BÕ&Ð&r1   c               ó   € V ^8„  d   QhRR/# r®   r7   )r8   s   "r9   r:   r^   6  s   € ÷ 
(ñ 
( 3ñ 
(r1   c                	ó¨   € \        V P                  ^4      V P                  ,           \        V P                  ^4      ,           V P                  ,           # )é   )r   rb   Ú_OleWriter__numMinifatre   r?   s   &r9   Ú__numberOfSectorsÚOleWriter.__numberOfSectors5  sL   € ô �t×+Ñ+¨QÓ/Ø× Ñ õ!ä�t×(Ñ(¨"Ó-õ.ð ×'Ñ'õ(ð 	(r1   c               ó   € V ^8„  d   QhRR/# r®   r7   )r8   s   "r9   r:   r^   C  s   € ÷ Iñ I˜cñ Ir1   c                óP   € \        ^@V P                  ,          V P                  4      # )z<
The number of FAT sectors needed to store the mini stream.
)r   rf   r¢   r?   s   &r9   Ú__numMinifatÚOleWriter.__numMinifatB  s"   € ô
 �r˜D×4Ñ4Õ4°d×6GÑ6GÓHÐHr1   c               ó   € V ^8„  d   QhRR/# r®   r7   )r8   s   "r9   r:   r^   J  s   € ÷ 4ñ 4˜cñ 4r1   c                ó,   € V P                   ^8X  d   R# R# )z$
The size of each sector, in bytes.
i   rž   )rg   r?   s   &r9   Ú__sectorSizeÚOleWriter.__sectorSizeI  s   € ð
 —n‘n¨Ô)ˆsÐ3¨tÐ3r1   c               ó   € V ^8„  d   QhRR/# r›   r7   )r8   s   "r9   r:   r^   P  s   € ÷ 'ñ ' ñ 'r1   c                óÊ   € V P                   P                  4        V P                  4        F4  pRVn        RVn        RVn        RVn        RVn        RVn        RVn	        K6  	  R# )zl
Cleans up the node connections by walking the tree and removing
references that were added during writing.
Nr(   rQ   )
rd   rŸ   r    r'   r    r   r!   r)   r*   r+   r£   s   & r9   Ú_cleanupEntriesÚOleWriter._cleanupEntriesP  s^   € ð
 	×Ñ×!Ñ!Ô#Ø×'Ñ'Ö)ˆEØˆEŒHØ"ˆEŒOØ#ˆEÔØ"&ˆEÔØ",ˆEÔØ#-ˆEÔ Ø&ˆEŽMó *r1   c               ó   € V ^8„  d   QhRR/# )r5   r6   zTuple[int, int, int]r7   )r8   s   "r9   r:   r^   _  s   € ÷ Nñ NÐ 4ñ Nr1   c                óp  € ^ p\        V P                  ;'       g    ^V P                  ^,
          4      p^pW#8w  da   Tp\        \        V^m,
          ^ 4      V P                  ^,
          4      p\        V P                  V,           V P                  ^,
          4      pKf  W!V P                  V,           V,           3# )zŽ
Returns a tuple containing the number of FAT sectors, the number of
DIFAT sectors, and the total number of sectors the saved file will have.
)r   Ú_OleWriter__numberOfSectorsÚ_OleWriter__linksPerSectorÚmax)r@   ÚnumDifatÚnumFatÚ	newNumFats   &   r9   Ú_getFatSectorsÚOleWriter._getFatSectors_  sž   € ð ˆä˜×/Ñ/×4Ð4°1°d×6KÑ6KÈaÕ6OÓPˆØˆ	ØÔ!ØˆFÜœs 6¨C¥<°Ó3°T×5JÑ5JÈQÕ5NÓOˆHÜ × 6Ñ 6¸Õ AÀ4×CXÑCXÐ[\ÕC\Ó]ŠIà $×"8Ñ"8¸8Õ"CÀfÕ"LÐMÐMr1   c               ó    € V ^8„  d   QhRRRR/# ©r5   ÚstartingSectorr"   r6   úList[DirectoryEntry]r7   )r8   s   "r9   r:   r^   p  s   € ÷ Vñ V¨ð VÐ0Dñ Vr1   c                ó^  € \         P                   ! V P                  4      pV P                  ^ 8”  dC   V\        V P                  ^4      ,           \        V P
                  V P                  4      ,           MRVn        V P
                  ^@,          Vn        RVn	        RVn
        V.pW P                  3.pV'       EdŸ   VP                  4       w  rVV'       g   K%  \        4       pV F™  pVP                  R4      '       d   K  Wh,          p	\        V	\         4      '       d$   VP#                  V	R,          V	34       V	R,          p	VP#                  V	4       VP%                  \'        V4      VP)                  4       3V	4       K›  	  VP*                  Vn	        VP-                  4        F±  p
V
P*                  pV
P.                  '       d   \0        P2                  M\0        P4                  Vn        V
P8                  '       d   V
P8                  P*                  Vn        MRVn        V
P<                  '       d   V
P<                  P*                  Vn        Kª  RVn        K³  	  EK§  \A        V4       F  w  rÅWÅn!        K  	  V F�  pVP:                  '       d   VP:                  PB                  MRVn"        VP                  '       d   VP                  PB                  MRVn
        VP>                  '       d   VP>                  PB                  MRVn#        K’  	  ^ pV Fœ  p\'        VPH                  4      ^ 8X  d   WS^ ,          8w  d
   RVn        K3  VPJ                  \L        PN                  8X  g   KT  \'        VPH                  4      R8  g   Kp  WÕn        V\        \'        VPH                  4      ^@4      ,          pKž  	  V# )zŠ
Uses red-black trees to sort the internal data in preparation for
writing the file, returning a list, in order, of the entries to write.
ì   þÿ Nr(   rr   r‰   rž   )(Úcopyr`   r¾   r   rb   rf   rÐ   r,   rE   r!   r+   rc   r¨   r   rs   r�   r‚   r¡   ÚaddrF   ÚupperÚvalueÚin_orderÚis_blackr   rY   ÚREDr-   Úleftr    Úrightr   r|   r'   r)   r*   r2   r&   r   r”   )r@   rÙ   ÚrootÚentriesrª   r�   ÚcurrentItemÚtreer   ÚvalÚnoder‹   Ú_idÚminiFATLocations   &&            r9   Ú	_treeSortÚOleWriter._treeSortp  sâ  € ô �yŠy˜×)Ñ)Ó*ˆð Y]÷  Yjñ  Yjð  mnô  Yn ~¼À×@TÑ@TÐVWÓ8XÕ'XÔ[bÐcg×c{Ñc{ð  ~B÷  ~Sñ  ~Só  \Tö  (Tð  t~ˆÔ#Ø×2Ñ2°RÕ7ˆŒØ!ˆÔØ!ˆŒØ�&ˆà×-Ñ-Ð.Ð/ˆ	çˆiØ!*§¡£ÑˆEßÙô  “>ˆDÛ#�Ø—‘ t×,Ô,Ø%Õ+�Cô " #¤t×,Ò,Ø!×(Ñ(¨#Ð.@Õ*AÀ3Ð)GÔHØ!Ð"4Õ5˜à—N‘N 3Ô'ð —H‘Hœc $›i¨¯©«Ð6¸Ö<ñ $ð  #'§*¡*ˆEÔð Ÿ™ž�Ø—z‘z�à,0¯M¯M¨MœUŸ[š[¼u¿y¹y�”
à—9—9�9Ø%)§Y¡Y§_¡_�D•Nà%)�D”Nà—:—:�:Ø&*§j¡j×&6Ñ&6�D–Oà&*�D–Oô (ô" $ GÖ,‰JˆCØŽHñ -ó ˆEØ8=¿¿¸ %§/¡/×"4Ò"4ÈZˆEÔØ6;×6I×6IÐ6I˜E×/Ñ/×2Ò2ÈzˆEŒMØ:?×:J×:JÐ:J 5×#3Ñ#3×#6Ò#6ÐPZˆEÖ ñ ð ˆãˆEÜ�5—:‘:‹ !Ô#¨¸µÔ(;à/9�Ö,Ø—‘Ô1×8Ñ8Ö8¼SÀÇÁ»_ÈtÖ=SØ/>Ô,Ø¤7¬3¨u¯z©z«?¸BÓ#?Õ?’ñ ð ˆr1   c               ó   € V ^8„  d   QhRR/# r®   r7   )r8   s   "r9   r:   r^   È  s   € ÷ U!ñ U! Cñ U!r1   c           	     ó\  € V P                  4        V P                  4       w  r#pVR8”  d   \        R4      hV P                  R8”  d   \        R4      hVP	                  R4       VP	                  R4       VP	                  R4       TP	                  V P
                  ^8X  d   RMR	4       VP	                  R
4       TP	                  V P
                  ^8X  d   RMR4       VP	                  R4       VP	                  R4       VP	                  \        P                  P                  P                  ^ 4      4       VP	                  \        P                  P                  P                  V4      4       VP	                  \        P                  P                  P                  W#,           4      4       VP	                  R4       VP	                  R4       TP	                  \        P                  P                  P                  V P                  ^ 8”  d$   W#,           \        V P                  ^4      ,           MR4      4       VP	                  \        P                  P                  P                  \        V P                  V P                  4      4      4       TP	                  \        P                  P                  P                  V'       d   ^ MR4      4       VP	                  \        P                  P                  P                  V4      4       \        V4       Fî  pV^m8X  d#   V P
                  ^8X  d   VP	                  R4       V^m8”  d~   V^m,
          V P                  ^,
          ,          ^ 8X  dX   VP	                  \        P                  P                  P                  V^m,
          V P                  ^,
          ,          4      4       VP	                  \        P                  P                  P                  WS,           4      4       Kð  	  V^m8”  db   VP	                  RV P                  ^,
          V^m,
          V P                  ^,
          ,          ,
          ,          4       VP	                  R4       MVP	                  R^mV,
          ,          4       VP	                  RV,          4       VP	                  RV,          4       W2,           p\        V^,           V\        V P                  V P                  4      ,           4       F;  pVP	                  \        P                  P                  P                  V4      4       K=  	  VP	                  R4       V\        V P                  V P                  4      ,          pV P                  ^ 8”  Ed!   \        V^,           V\        V P                  ^4      ,           4       F;  pVP	                  \        P                  P                  P                  V4      4       K=  	  VP	                  R4       V\        V P                  ^4      ,          p\        V^,           W`P                  ,           4       F;  pVP	                  \        P                  P                  P                  V4      4       K=  	  VP	                  R4       W`P                  ,          pV P                    F£  p\        \#        VP$                  4      V P&                  4      pWgn        \        V^,           Wh,           4       F;  pVP	                  \        P                  P                  P                  V4      4       K=  	  VP	                  R4       Wh,          pK¥  	  W@P                  ^,
          ,          p	V	'       d*   VP	                  RV P                  V	,
          ,          4       W2,           # )zü
Writes the beginning to the file :param f:.

This includes the header, DIFAT, and FAT blocks.

:returns: The current sector number after all the data is written.

:raises TooMuchDataError: The number of sectors required for the file is
    too large.
l   ûÿ zIData in OleWriter requires too many sectors to write to a version 3 file.i   z4Data is OleWriter requires too many MiniFAT sectors.s   ÐÏà¡±ár.   s   > s    s    s   þÿs   	 s    s    s         s       s      rÜ   ó   ÿÿÿÿó   þÿÿÿs   üÿÿÿs   ýÿÿÿs                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   )Ú_OleWriter__recalculateSectorsrÕ   r   rf   Úwriterg   r   rK   Ú
ST_LE_UI32rM   r¾   r   rb   rÐ   ÚrangeÚ_OleWriter__dirEntsPerSectorrd   rF   r2   r¢   r,   )
r@   ÚfrÓ   rÒ   ÚtotalSectorsrv   Úoffsetr�   ÚsizeÚfreeSectorss
   &&        r9   Ú_writeBeginningÚOleWriter._writeBeginningÈ  s€  € ð 	×!Ñ!Ô#à)-×)<Ñ)<Ó)>Ñ&ˆ˜,ð ˜*Ô$Ü%Ð&qÓrÐrð
 ×#Ñ# iÔ/Ü%Ð&\Ó]Ð]ð 	
�‰Ð3Ô4à	�‰ÐSÔTà	�‰�Ôð 	
�‰˜tŸ~™~°Ô2‘¸ÔDà	�‰�Ôà	�‰˜tŸ~™~°Ô2‘¸ÔDà	�‰�Ôà	�‰Ð+Ô,à	�‰”	—‘×'Ñ'×,Ñ,¨QÓ/Ô0à	�‰”	—‘×'Ñ'×,Ñ,¨VÓ4Ô5ð 	
�‰”	—‘×'Ñ'×,Ñ,¨VÕ->Ó?Ô@à	�‰Ð#Ô$à	�‰Ð#Ô$à	�‰”	—‘×'Ñ'×,Ñ,Ðgk×gxÑgxÐ{|Ôg|¨fÕ.?Ä'È$×J^ÑJ^Ð`aÓBbÖ.bð  CMó  Nô  	Oà	�‰”	—‘×'Ñ'×,Ñ,¬W°T×5MÑ5MÈt×OdÑOdÓ-eÓfÔgð 	
�‰”	—‘×'Ñ'×,Ñ,·(©QÀ
ÓKÔLà	�‰”	—‘×'Ñ'×,Ñ,¨XÓ6Ô7ô �v–ˆAð �CŒx˜DŸN™N¨aÔ/Ø—‘˜Ô'à�3Œw˜A �G¨×(=Ñ(=ÀÕ(AÕBÀaÔGà—‘œ	Ÿ™×/Ñ/×4Ñ4°a¸#µgÀ4×CXÑCXÐ[\ÕC\Õ5]Ó^Ô_à�G‰G”I—L‘L×+Ñ+×0Ñ0°µÓ>Ö?ñ ð �CŒ<Ø�G‰GÐ'¨D×,AÑ,AÀAÕ,EÈ6ÐTWÍ<Ð\`×\qÑ\qÐtuÕ\uÕJvÕ+wÕxÔyà�G‰GÐ'Õ(à�G‰GÐ'¨3°­<Õ8Ô9ð 	
�‰Ð# hÕ.Ô/à	�‰Ð# fÕ,Ô-àÕ"ˆô �v •z 6¬G°D×4HÑ4HÈ$×JaÑJaÓ,bÕ#bÖcˆAØ�G‰G”I—L‘L×+Ñ+×0Ñ0°Ó3Ö4ñ dð 	
�‰Ð#Ô$à”'˜$×.Ñ.°×0GÑ0GÓHÕHˆð ×#Ñ# aÕ'ä˜6 A�: v´¸×8IÑ8IÈ2Ó0NÕ'NÖO�Ø—‘œ	Ÿ™×/Ñ/×4Ñ4°QÓ7Ö8ñ Pð �G‰GÐ'Ô(à”g˜d×/Ñ/°Ó4Õ4ˆFô ˜6 A�: v×0AÑ0AÕ'AÖB�Ø—‘œ	Ÿ™×/Ñ/×4Ñ4°QÓ7Ö8ñ Cð �G‰GÐ'Ô(à×'Ñ'Õ'ˆFð ×(Ô(ˆEÜœ3˜uŸz™z›?¨D×,=Ñ,=Ó>ˆDØ+1Ô(Ü˜6 A�: v¥}Ö5�Ø—‘œ	Ÿ™×/Ñ/×4Ñ4°QÓ7Ö8ñ 6ð �G‰GÐ'Ô(à�NŠFñ )ð #×&;Ñ&;¸aÕ&?Õ@ˆßØ�G‰GÐ'¨4×+@Ñ+@À;Õ+NÕOÔPð Õ Ð r1   c               ó    € V ^8„  d   QhRRRR/# rØ   r7   )r8   s   "r9   r:   r^   _  s   € ÷ 
ñ 
¸ð 
Ð@Tñ 
r1   c                óê   € V P                  V4      pV F  pV P                  W4       K  	  \        V4      ^,          '       d0   VP                  R^\        V4      ^,          ,
          ,          4       V# )zC
Writes out all the directory entries. Returns the list generated.
s€                                                                       ÿÿÿÿÿÿÿÿÿÿÿÿ                                                )rî   Ú_writeDirectoryEntryrF   rõ   )r@   rù   rÙ   rç   rv   s   &&&  r9   Ú_writeDirectoryEntriesÚ OleWriter._writeDirectoryEntries_  sc   € ð —.‘. Ó0ˆÛˆAØ×%Ñ% aÖ+ñ äˆw‹<˜!×ÔØ�G‰GÐPÐUVÔZ]Ð^eÓZfÐijÕZjÕUkÕlÔmàˆr1   c               ó    € V ^8„  d   QhRRRR/# )r5   r�   r   r6   rœ   r7   )r8   s   "r9   r:   r^   k  s   € ÷ ñ ¨^ð Àñ r1   c                ó:   € VP                  \        V4      4       R# )z+
Writes the directory entry to the file f.
N)rõ   r/   )r@   rù   r�   s   &&&r9   r  ÚOleWriter._writeDirectoryEntryk  s   € ð 	
�‰”�e“Ör1   c               ó   € V ^8„  d   QhRR/# r›   r7   )r8   s   "r9   r:   r^   q  s   € ÷ añ a ñ ar1   c                ót  € V P                    F§  pVP                  VP                  4       \        VP                  4      V P                  ^,
          ,          '       g   KS  VP                  RV P                  \        VP                  4      V P                  ^,
          ,          ,
          ,          4       K©  	  R# )z]
Writes the final sectors of the file, consisting of the streams too
large for the mini FAT.
ó    N)rd   rõ   r2   rF   r¢   )r@   rù   rv   s   && r9   Ú_writeFinalÚOleWriter._writeFinalq  sv   € ð
 ×$Ô$ˆAØ�G‰G�A—F‘FŒOÜ�1—6‘6‹{˜d×/Ñ/°!Õ3×4Ö4Ø—‘˜ 4×#4Ñ#4¼¸A¿F¹F»Àt×GXÑGXÐ[\ÕG\Õ8]Õ#^Õ_Ö`ó %r1   c               ó    € V ^8„  d   QhRRRR/# )r5   rç   rÚ   r6   rœ   r7   )r8   s   "r9   r:   r^   {  s   € ÷ Eñ EÐ%9ð E¸dñ Er1   c                óâ  € ^ pV F×  pVP                   \        P                  8X  g   K$  \        VP                  4      R8  g   K@  \        \        VP                  4      ^@4      p\        V^,           W5,           4       F;  pVP                  \        P                  P                  P                  V4      4       K=  	  V^ 8”  d   VP                  R4       W5,          pKÙ  	  W0P                  ^,
          ,          '       dA   VP                  RV P                  W0P                  ^,
          ,          ,
          ,          4       V F³  p\        VP                  4      ^ 8”  g   K  \        VP                  4      R8  g   K;  VP                  VP                  4       \        VP                  4      ^?,          '       g   Kz  VP                  R^@\        VP                  4      ^?,          ,
          ,          4       Kµ  	  V P                  V P                  ^,
          ,          '       dN   VP                  RV P                  V P                  V P                  ^,
          ,          ,
          ,          4       R# R# )z7
Writes the mini FAT followed by the full mini stream.
rž   ró   rò   r
  Ns@                                                                   )r&   r   r”   rF   r2   r   r÷   rõ   r   rK   rö   rM   rÐ   rf   Ú _OleWriter__miniSectorsPerSector)r@   rù   rç   ÚcurrentSectorrv   rü   s   &&&   r9   Ú
_writeMiniÚOleWriter._writeMini{  s¾  € ð
 ˆÛˆAØ�v‰vÔ+×2Ñ2Ö2´s¸1¿6¹6³{ÀTÖ7IÜœs 1§6¡6›{¨BÓ/�Ü˜}¨qÕ0°-Õ2FÖG�AØ—G‘GœIŸL™L×3Ñ3×8Ñ8¸Ó;Ö<ñ Hà˜!”8Ø—G‘GÐ/Ô0ØÕ%’ñ ð ×1Ñ1°AÕ5×6Ô6Ø�G‰GÐ'¨4×+@Ñ+@ÀM×UjÑUjÐmnÕUnÕDoÕ+pÕqÔró ˆAÜ�1—6‘6‹{˜QŽ¤3 q§v¡v£;°Ö#5Ø—‘˜Ÿ™”Ü�q—v‘v“; ×#Ö#Ø—G‘G˜G r¬S°·±«[¸2Õ-=Õ'>Õ?Ö@ñ	 ð ×#Ñ# t×'BÑ'BÀQÕ'F×GÔGØ�G‰G�\ d×&AÑ&AÀT×E]ÑE]Ðae×a|Ña|ð  @Aõ  bAõ  FBõ  'Cõ  Dö  Eñ Hr1   Nc               ó(   € V ^8„  d   QhRRRRRRRR/# )	r5   rk   r   r2   ú%Optional[Union[bytes, SupportsBytes]]ry   rn   r6   rœ   r7   )r8   s   "r9   r:   r^   ™  s/   € ÷ *#ñ *#˜Xð *#Ð-Rð *#Ðdhð *#ð  @Dñ *#r1   c                óÔ  € \        V4      pV P                  VRR4      pVR,          P                  4       \        \        P                  VP                  4       4      9   d   \        R4      h\        4       pV'       d   \        P                  M\        P                  Vn        VR,          Vn        V P                  ! V3RV/VB  V'       d   RV/WQR,          &   R# WeVR,          &   R# )a~  
Adds an entry to the OleWriter instance at the path specified, adding
storages with default settings where necessary. If the entry is not a
storage, :param data: *must* be set.

:param path: The path to add the entry at. Must not contain a path part
    that is an already added stream.
:param data: The bytes for a stream or an object with a ``__bytes__``
    method.
:param storage: If ``True``, the entry to add is a storage. Otherwise,
    the entry is a stream.
:param clsid: The CLSID for the stream/storage. Must a a bytes instance
    that is 16 bytes long.
:param creationTime: An 8 byte filetime int. Sets the creation time of
    the entry. Not applicable to streams.
:param modifiedTime: An 8 byte filetime int. Sets the modification time
    of the entry. Not applicable to streams.
:param stateBits: A 4 byte int. Sets the state bits, user-defined flags,
    of the entry. For a stream, this *SHOULD* be unset.

:raises OSError: A stream was found on the path before the end or an
    entry with the same name already exists.
:raises ValueError: Attempts to access an internal item.
:raises ValueError: The data provided is too large.
FTú(Cannot add an entry that already exists.r2   r‰   NrQ   )r   rŠ   r}   r~   r   r   rz   r   r   ÚSTORAGEr”   r&   r   Ú_OleWriter__modifyEntry)r@   rk   r2   ry   r—   rƒ   r�   s   &&&&,  r9   r€   ÚOleWriter.addEntry™  s¸   € ô4 ˜dÓ#ˆà×*Ñ*¨4°¸Ó=ˆð ��8�>‰>Óœs¤3§9¡9¨d¯i©i«kÓ:Ô:ÜÐDÓEÐEô Ó ˆß3:Ô'×/Ò/Ô@R×@YÑ@YˆŒ
Ø˜"•XˆŒ
Ø×Ò˜5Ñ8¨Ð8°Ò8ßØ0°%Ð8ˆD�b•‹Nà"��b•‹Nr1   c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r5   rk   r   r�   r   r2   r  r6   rœ   r7   )r8   s   "r9   r:   r^   Å  s+   € ÷ 0"ñ 0" ð 0"Ð1Bð 0"ÐJoð 0"Ð{ñ 0"r1   c                óš  € \        V4      pV P                  VR4      pVR,          P                  4       \        \        P                  VP                  4       4      9   d   \        R4      h\        4       pVP                  \        P                  8X  d‚   VP                  Vn        \        P                  Vn        \        VP                  4      Vn        VP                  Vn        VP"                  Vn        VP&                  Vn        RV/WAR,          &   M�VP                  Vn        \        P*                  Vn        \        VP                  4      Vn        VP                  Vn        T;'       g    Rp\-        V4      Vn        \1        VP.                  4      R8”  d   \3        R4      hWTVR,          &   V ;P4                  ^,          un        R# )	a/  
Uses the entry provided to add the data to the writer.

:raises OSError: Tried to add an entry to a path that has not yet
    been added, tried to add as a child of a stream, or tried to add an
    entry where one already exists under the same name.
:raises ValueError: The data provided is too large.
Fr  r‰   r1   r‘   r’   NrQ   )r   rŠ   r}   r~   r   r   rz   r   Ú
entry_typer   r  r   r&   Ú_unClsidr0   ÚdwUserFlagsr#   Ú
createTimer$   Ú
modifyTimer%   r”   r/   r2   rF   rG   rb   )r@   rk   r�   r2   rƒ   ÚnewEntrys   &&&&  r9   ÚaddOleEntryÚOleWriter.addOleEntryÅ  sb  € ô ˜dÓ#ˆà×*Ñ*¨4°Ó7ˆð ��8�>‰>Óœs¤3§9¡9¨d¯i©i«kÓ:Ô:ÜÐDÓEÐEô "Ó#ˆØ×ÑÔ1×9Ñ9Ô9ð "ŸJ™JˆHŒMÜ.×6Ñ6ˆHŒMÜ% e§k¡kÓ2ˆHŒNØ!&×!2Ñ!2ˆHÔØ$)×$4Ñ$4ˆHÔ!Ø$)×$4Ñ$4ˆHÔ!ð 1°(Ð;ˆD�b•ŠNð "ŸJ™JˆHŒMÜ.×5Ñ5ˆHŒMÜ% e§k¡kÓ2ˆHŒNØ!&×!2Ñ!2ˆHÔð —;�;˜3ˆDÜ! $›KˆHŒMÜ�8—=‘=Ó! JÔ.Ü Ð!zÓ{Ð{ð &��b•‰Nà×Ò Õ!×r1   c               ó   € V ^8„  d   QhRR/# r›   r7   )r8   s   "r9   r:   r^   ÷  s   € ÷ 2ñ 2 4ñ 2r1   c                ód   € \        V4      pV P                  V4      pV\        W!R,          4       R# )zò
Deletes the entry specified by :param path:, including all children.

:raises OSError: If the entry does not exist or a part of the path that
    is not the last was a stream.
:raises ValueError: Attempted to delete an internal data stream.
NrQ   )r   rŠ   r   )r@   rk   rƒ   s   && r9   ÚdeleteEntryÚOleWriter.deleteEntry÷  s1   € ô ˜dÓ#ˆà×*Ñ*¨4Ó0ˆð ” ¨B¥xÓ0Ò1r1   c               ó    € V ^8„  d   QhRRRR/# )r5   rk   r   r6   rœ   r7   )r8   s   "r9   r:   r^   	  s   € ÷ ,ñ ,˜hð ,°Tñ ,r1   c                ó`   € V P                  \        V4      4      pV P                  ! V3/ VB  R# )a+  
Used to edit values of an entry by setting the specific kwargs. Set a
value to something other than None to set it.

:param data: The data of a stream. Will error if used for something
    other than a stream. Must be bytes or convertable to bytes.
:param clsid: The CLSID for the stream/storage. Must a a bytes instance
    that is 16 bytes long.
:param creationTime: An 8 byte filetime int. Sets the creation time of
    the entry. Not applicable to streams.
:param modifiedTime: An 8 byte filetime int. Sets the modification time
    of the entry. Not applicable to streams.
:param stateBits: A 4 byte int. Sets the state bits, user-defined flags,
    of the entry. For a stream, this *SHOULD* be unset.

To convert a 32 character hexadecial CLSID into the bytes for this
function, the _unClsid function in the ole_writer submodule can be used.

:raises OSError: The entry does not exist in the file.
:raises TypeError: Attempted to modify the bytes of a storage.
:raises ValueError: The type of a parameter was wrong, or the data of a
    parameter was invalid.
N)Ú_OleWriter__getEntryr   r  )r@   rk   r—   r�   s   &&, r9   Ú	editEntryÚOleWriter.editEntry	  s,   € ð2 —‘¤¨tÓ 4Ó5ˆð 	×Ò˜5Ñ+ FÔ+r1   c               ó$   € V ^8„  d   QhRRRRRR/# )r5   Úmsgr   ÚallowBadEmbedrn   r6   rœ   r7   )r8   s   "r9   r:   r^   '  s&   € ÷ <kñ <k˜7ð <k°4ð <kÀDñ <kr1   c           
     óf  € \        VP                  R4      P                  4      V P                  n        VP	                  RRR4      pVP                  \        R7       V Fö  pVP                  V4      pVP                  \        P                  8X  d   VP                  V4      MRpV^ ,          R8X  d‘   VP                  ^ 8”  d€   \        V4      ^,          ^ 8w  d    VR,          R,           VR	,          ,           pMV'       g   \        R
4      hV'       d/   VP                  R4      f   VP                  '       d
   VR,          pV P                  WEV4       Kø  	  VP                  ^ 8”  d{    V P                  RVP                  RR4      R4       R TP'                  4        4       pT F7  pT P                  YAP                  TRR7      TP                  TRR7      4       K9  	  R# R#   \          d@   p\#        T4      P%                  R4      '       d   T'       d    Rp?R# \        R4      hh Rp?ii ; i)aŒ  
Copies the streams and stream information necessary from the MSG file.

:param allowBadEmbed: If True, attempts to skip steps that will fail if 
    the embedded MSG file violates standards. It will also attempt to repair the data to try to ensure it can open in Outlook.

:raises StandardViolationError: Something about the embedded data has a
    fundemental issue that violates the standard.
Ú/TF©ÚkeyNz__properties_version1.0:Né   Ns           :r4  NNzXEmbedded msg file attempted to be extracted that contains a top level properties stream.Ú340D0003s    4          ú__nameid_version1.0zCannot add an entryzQEmbedded msg file attempted to be extracted that contains it's own named streams.c              3  ój   "  € T F)  p\        V4      ^8”  g   K  V^ ,          R8X  g   K%  Vx € K+  	  R# 5i)é   r6  N)rF   rt   s   & r9   rw   Ú$OleWriter.fromMsg.<locals>.<genexpr>a  s,   é € Ð`Ñ/˜´3°q³6¸A±:”1À!ÀAÅ$ÐJ_ÑB_—1’1Ó/ùs   ‚3™3©
3)Úprefix)r  Ú_getOleEntryr0   r`   ÚlistDirÚsortrF   r  r   r”   Ú	getStreamÚ	prefixLenr   ÚgetPropertyValÚareStringsUnicoder"  rz   r   rs   Ú_oleListDir)	r@   r.  r/  rç   rv   r�   r2   ÚeÚgens	   &&&      r9   ÚfromMsgÚOleWriter.fromMsg'  sí  € ô "*¨#×*:Ñ*:¸3Ó*?×*EÑ*EÓ!Fˆ×ÑÔð —+‘+˜d D¨%Ó0ˆØ�‰œ3ˆÔãˆAØ×$Ñ$ QÓ'ˆEØ',×'7Ñ'7Ô;M×;TÑ;TÔ'T�3—=‘= Ô#ÐZ^ˆDð ��tÐ0Ô0°S·]±]ÀQÔ5FÜ�t“9˜r•> QÔ&Ø �9Ð'JÕJÈTÐRUÍYÕV‘Dß&ä0ð  2Ló  Mð  Mß à×)Ñ)¨*Ó5Ò=Ø×0×0Ð0à $Ð(kÕ k Ø×Ñ˜Q tÖ,ñ) ð0 �=‰=˜1ÔðØ× Ñ Ð!6¸×8HÑ8HÐI^Ð`eÓ8fÐhlÔmñ a˜cŸo™oÔ/Ó`ˆCÛ�Ø× Ñ  ×$4Ñ$4°QÀÐ$4Ó$GÈÏÉÐWXÐchÈÓIiÖjó ñ# øô ô Ü�q“6×$Ñ$Ð%:×;Ò;ß$ÝÜ0ð  2Fó  Gð  GØûðús   Å+#G& Ç&H0Ç1'H+ÈH+È+H0c               ó$   € V ^8„  d   QhRRRRRR/# )r5   Úoler   ÚrootPathr   r6   rœ   r7   )r8   s   "r9   r:   r^   e  s!   € ÷ 7-ñ 7-˜yð 7-°Hð 7-Àdñ 7-r1   c           	     óœ  € \        V4      pV. 8X  dƒ   \        VP                  ^ ,          P                  4      V P                  n        VP                  RR4       Uu/ uF0  p\        V4      W1P                  VP                  V4      ,          3bK2  	  ppMº VP                  VP                  V4      ,          p\        VP                  4      V P                  n        TP                  RR4       Uu/ uFW  p\        T4      \        T4      8”  g   K  \        T\        T4      R 4      Y1P                  TP                  T4      ,          3bKY  	  pp\        VP                  4       4       Fs  pWC,          w  r…VP                  \         P"                  8X  d4   VP%                  V4      ;_uu_ 4       p	V	P'                  4       p
RRR4       MRp
V P)                  W5X
4       Ku  	  R# u upi   \         dC   p\        T4      R8X  d-   TP                  ;'       g    TP                  p\        R4      Thh Rp?ii ; iu upi   + '       g   i     L‚; i)aN  
Copies all the streams from the proided OLE file into this writer.

NOTE: This method does *not* handle any special rule that may be
required by a format that uses the compound binary file format as a base
when extracting an embedded directory. For example, MSG files require
modification of an embedded properties stream when extracting an
embedded MSG file.

:param rootPath: A path (accepted by ``olefile.OleFileIO``) to the
    directory to use as the root of the file. If not provided, the file
    root will be used.

:raises OSError: If :param rootPath: does not exist in the file.
Tzfile not foundz(Root path was not found in the OLE file.N)r   r  Ú
direntriesr0   r`   ÚlistdirÚtupleÚ_findrz   r   Ú	__cause__Ú__context__rF   Úsortedr   r  r   r”   Ú
openstreamÚreadr"  )r@   rH  rI  rv   Úpathsr�   rC  ÚcontextÚfullPathrù   r2   s   &&&        r9   ÚfromOleFileÚOleWriter.fromOleFilee  sä  € ô  " (Ó+ˆð �rŒ>ä%-¨c¯n©n¸QÕ.?×.EÑ.EÓ%FˆD×ÑÔ"ØJMÏ+É+ÐVZÐ\`ÔJaÓbÑJaÀQ”U˜1“X §>¡>°#·)±)¸A³,Õ#?Ð@Ò@ÑJaˆEÐbˆEðØŸ™ s§y¡y°Ó':Õ;�Ü)1°%·+±+Ó)>�× Ñ Ô&ð "Ÿk™k¨$°Ô5óQÙ5˜¼¸Q»Ä#ÀhÃ-Ñ9Oô Q”U˜1œS ›]˜^Ð,Ó-°·>±>À#Ç)Á)ÈAÃ,Õ3OÐ/PÒPÙ5ð ð Qô ˜Ÿ
™
›Ö%ˆAØ#�h‰OˆHà×ÑÔ#5×#<Ñ#<Ô<Ø—^‘^ H×-Ô-°ØŸ6™6›8�D÷ .Ð-ð �à×Ñ˜Q tÖ,ó &ùò1 cøô ô Ü�q“6Ð-Ô-ð  Ÿk™k×:Ð:¨Q¯]©]�GÜ!Ð"LÓMÐSZÐZàûðüòQ÷ .×-ús=   Á6G!ÂAG& Ã0H6Ä=H6Æ-H;Ç&H3Ç1"H.ÈH.È.H3È;Ic               ó    € V ^8„  d   QhRRRR/# )r5   rk   r   r6   r   r7   )r8   s   "r9   r:   r^   ž  s   € ÷ @ñ @˜Xð @¨.ñ @r1   c                ó^   € \         P                   ! V P                  \        V4      4      4      # )zû
Finds and returns a copy of an existing `DirectoryEntry` instance in the
writer. Use this method to check the internal status of an entry.

:raises OSError: If the entry does not exist.
:raises ValueError: If access to an internal item is attempted.
)rÝ   r*  r   )r@   rk   s   &&r9   ÚgetEntryÚOleWriter.getEntryž  s!   € ô �yŠy˜Ÿ™¬¸Ó)=Ó>Ó?Ð?r1   c               ó$   € V ^8„  d   QhRRRRRR/# )r5   Ústreamsrn   Ústoragesr6   zList[List[str]]r7   )r8   s   "r9   r:   r^   ¨  s!   € ÷ ñ  ð ¸ð Èñ r1   c                ó*  € V'       g   V'       g   . # . pV P                  4        FZ  w  rEpV'       d"   V F  pVP                  WG.,           4       K  	  V'       g   K9  V F  pVP                  WG.,           4       K  	  K\  	  VP                  4        V# )zä
Returns a list of the specified items currently in the writter.

:param streams: If ``True``, includes the path for each stream in the
    list.
:param storages: If ``True``, includes the path for each storage in the
    list.
)Úwalkr¡   r=  )r@   r^  r_  rT  Ú
currentDirÚstorÚstrer   s   &&&     r9   Ú	listItemsÚOleWriter.listItems¨  sv   € ÷  ŸxØˆIàˆØ&*§i¡i¦kÑ"ˆJ˜dßÛ �DØ—L‘L ¨fÕ!4Ö5ñ !ç‰wÛ �DØ—L‘L ¨fÕ!4Ö5ó !ñ '2ð 	�
‰
ŒØˆr1   c               ó$   € V ^8„  d   QhRRRRRR/# )r5   rk   r   ÚnewNamer   r6   rœ   r7   )r8   s   "r9   r:   r^   Ç  s!   € ÷ -$ñ -$ ð -$°3ð -$¸4ñ -$r1   c                óZ  € \        V\        4      '       g   \        R4      h\        P                  P
                  P                  V4      '       d   \        R4      h\        V4      ^8”  d   \        R4      hV P                  \        V4      4      pVP                  4       \        \        P                  VP                  4       4      9   d   \        R4      h\        W1R,          4      pW4,          p\        V\        4      '       d   TpVR,          pMRpW%n        W4 Vf   WSV&   R# WcV&   R# )a  
Changes the name of an entry, leaving it in it's current position.

:raises OSError: If the entry does not exist or an entry with the new
    name already exists,
:raises ValueError: If access to an internal item is attempted or the
    new name provided is invalid.
zNew name must be a string.zRInvalid character(s) in new name. Must not contain the following characters: \//!:z)New name must be less than 32 characters.z*An entry with the new name already exists.r‰   NrQ   )r�   r   rG   r   rH   ÚINVALID_OLE_PATHrI   rF   rŠ   r   r}   r~   r   rz   r   r‚   r   )r@   rk   rh  rƒ   ÚoriginalNamer�   ÚdirDatas   &&&    r9   ÚrenameEntryÚOleWriter.renameEntryÇ  sþ   € ô ˜'¤3×'Ò'ÜÐ9Ó:Ð:Ü�<‰<×(Ñ(×/Ñ/°×8Ò8ÜÐrÓsÐsÜˆw‹<˜"ÔÜÐHÓIÐIð ×*Ñ*¬>¸$Ó+?Ó@ˆð �=‰=‹?œc¤#§)¡)¨T¯Y©Y«[Ó9Ô9ÜÐFÓGÐGô ' t°"­XÓ6ˆð Õ"ˆÜ�eœT×"Ò"ØˆGØÐ,Õ-‰EàˆGð Œ
ð ÐàŠ?Ø!�‹Mà#�‹Mr1   c               ó   € V ^8„  d   QhRR/# )r5   r6   z0Iterator[Tuple[List[str], List[str], List[str]]]r7   )r8   s   "r9   r:   r^   ö  s   € ÷ 2ñ 2ÐFñ 2r1   c              #  óÊ  "  € . V P                   3.pV'       dÈ   VP                  4       w  r#. p. p\        VP                  4       \        P
                  R7       F|  pVP                  R4      '       d   K  \        W6,          \        4      '       d4   VP                  V4       VP                  W&.,           W6,          34       Kk  VP                  V4       K~  	  W$V3x € KÏ  R# 5i)a¼  
Functional equivelent to ``os.walk``, but for going over the file
structure of the OLE file to be written. Unlike ``os.walk``, it takes
no arguments.

:returns: A tuple of three lists. The first is the path, as a list of
    strings, for the directory (or an empty list for the root), the
    second is a list of the storages in the current directory, and the
    last is a list of the streams. Streams and storages are sorted
    caselessly.
r2  rr   N)
rc   r¨   rQ  r   r   r}   rs   r�   r‚   r¡   )r@   rª   rb  ÚdirDictr_  r^  r   s   &      r9   ra  ÚOleWriter.walkö  sµ   é € ð ˜$×+Ñ+Ð,Ð-ˆ	÷ Ø"+§-¡-£/ÑˆJØˆHØˆGÜ˜wŸ|™|›~´S·Y±Y×?�Ø—‘ t×,Ô,Ü! '¥-´×6Ò6Ø Ÿ™¨Ô-Ø!×(Ñ(¨*°vÕ*=¸w½}Ð)MÖNàŸ™ tÖ,ñ @ð ¨Ð1Ô1ñ ùs   ‚C#šAC#Á5A.C#c               ó   € V ^8„  d   QhRR/# r›   r7   )r8   s   "r9   r:   r^     s   € ÷ "ñ "˜Tñ "r1   c                óÂ  € Rp\        VR4      '       d    \        VP                  R4      '       d   TpM\        VR4      pRp V P                  V4      pV P	                  W44      pV P                  W54       V P                  V4       V P                  4        V'       d   VP                  4        R# R#   T P                  4        T'       d   TP                  4        i i ; i)a  
Writes the data to the path specified.

If :param path: has a ``write`` method, the object will be used
directly.

If a failure occurs, the file or IO device may have been modified.

:raises TooManySectorsError: The number of sectors requires for a part
    of writing is too large.
Frõ   Ú__call__ÚwbTN)	Úhasattrrõ   Úopenrþ   r  r  r  rË   Úclose)r@   rk   Úopenedrù   rû   rç   s   &&    r9   rõ   ÚOleWriter.write  s½   € ð ˆô �4˜×!Ò!¤g¨d¯j©j¸*×&EÒ&EØ‰Aä�T˜4Ó ˆAØˆFð	ð ×)Ñ)¨!Ó,ˆFØ×1Ñ1°!Ó<ˆGØ�O‰O˜AÔ'Ø×Ñ˜QÔà× Ñ Ô"çØ—‘–	ñ øð × Ñ Ô"çØ—‘•	ð ús   ÁAB3 Â3+C)Ú__dirEntriesÚ__dirEntryCountÚ__largeEntriesÚ__largeEntrySectorsÚ__numMinifatSectorsÚ__rootEntryÚ	__version)TF)NFr=   )F)(rR   rS   rT   rU   rV   r   ÚDEFAULT_CLSIDrh   rŠ   r*  r  rô   r    Úpropertyrø   rÐ   r  rÏ   r¾   r¢   rË   rÕ   rî   rþ   r  r  r  r  r€   r"  r&  r+  rE  rW  r[  re  rm  ra  rõ   rZ   r7   r1   r9   r   r   `   s'  † ñð +4×*AÑ*A÷ ÷3õjõB(õH\õ&#ð$ ô(ó ð(ð ô&ó ð&ð ô'ó ð'ð ô
(ó ð
(ð ôIó ðIð ô4ó ð4õ'õNõ"VõpU!õn
õõaõE÷<*#÷X0"õd2õ$,÷<<kð| @B÷ 7-õr@÷õ>-$õ^2÷<"ñ "r1   c               ó    € V ^8„  d   QhRRRR/# )r5   r0   r   r6   r/   r7   )r8   s   "r9   r:   r:   :  s   € ÷ ñ �Cð ˜Eñ r1   c                ó²  € V '       g   R# V P                  RR4      p  \        \        V R,          ^4      \        V R,          ^4      \        V R,          ^4      \        V R,          ^4      \        V R,          ^4      \        V R	,          ^4      \        V R
,          ^4      \        V R,          ^4      \        V R,          ^4      \        V R,          ^4      \        V R,          ^4      \        V R,          ^4      \        V R,          ^4      \        V R,          ^4      \        V R,          ^4      \        V R,          ^4      34      #   \         d    h i ; i)zC
Converts the clsid from ``olefile.olefile._clsid`` back to bytes.
r1   Ú-r   :é   é   N:r½   rˆ  N:r5   r½   N:r   r5   N:é
   é   N:r‰  rŠ  N:é   é   N:r‹  rŒ  N:r�  é   N:rŽ  é   N:r�  é   N:r�  r4  N:r4  é   N:r‘  é   N:r’  é   N:r“  é    N)Úreplacer/   r"   r–   )r0   s   &r9   r  r  :  s%  € ÷ ÙØ�M‰M˜#˜rÓ"€EðÜÜ��c•
˜BÓÜ��c•
˜BÓÜ��c•
˜BÓÜ��c•
˜BÓÜ��e•˜bÓ!Ü��d•˜RÓ Ü��e•˜bÓ!Ü��e•˜bÓ!Ü��e•˜bÓ!Ü��e•˜bÓ!Ü��e•˜bÓ!Ü��e•˜bÓ!Ü��e•˜bÓ!Ü��e•˜bÓ!Ü��e•˜bÓ!Ü��e•˜bÓ!ð!
ó ð 	øô$ ô Øðús   žD*E	 Å	E)%Ú
__future__r   Ú__all__rÝ   rH   Útypingr   r   r   r	   r
   r   r   r   r   r   r   Úenumsr   r   Ú
exceptionsr   r   Úutilsr   r   r   Úolefile.olefiler   r   Úred_black_dict_modr   Úmsg_classesr   r   r   r  r7   r1   r9   Ú<module>rŸ     sm   ðÝ "ð Øð€ó Û 	÷÷ ó õ
 Ý ß ,ß Cß ;Ñ ;ß 8Ý +÷ Ý$÷</ñ </÷@Vñ V÷tr1   