
    Zi+                     ~   S r SSKJr  SrSSKrSSKrSSKrSSKrSSKr\R                  S:X  a  \R                  R                  SS9  \R                  R                  \R                  R                  \R                  R                  \5      5      5      r\R                  R                  \R                  R%                  \S5      5      r\\R                  ;  a  \R                  R)                  S\5        SS	KJr  SS
KJr  SSKJr  S\-  r\R8                  S\R:                  S\R<                  S\R>                  S\R@                  S\RB                  S0r"\R8                  S\R:                  S\R<                  S\R>                  S\R@                  S\RB                  S0r#SSSS.r$S r%S r&S r'\(S:X  a  \'" 5         gg)a_  
oledir.py

oledir parses OLE files to display technical information about their directory
entries, including deleted/orphan streams/storages and unused entries.

Author: Philippe Lagadec - http://www.decalage.info
License: BSD, see source code or documentation

oledir is part of the python-oletools package:
http://www.decalage.info/python/oletools
    )print_functionz0.54NntT)auto_colorsz..)tablestream)xglob)KNOWN_CLSIDSz0oledir %s - http://decalage.info/python/oletoolsEmptyStorageStream
ILockBytesIPropertyStorageRootgreencyanyellowmagentared)unused<Used>ORPHANc                 0    U [         R                  :X  a  gU $ )N-)olefileNOSTREAM)sids    i/var/www/eduai.edurigo.com/question_generate/ques_gen_env/lib/python3.13/site-packages/oletools/oledir.pysid_displayr   y   s    
g
    c                 n    U R                  5       nU[        ;   a  U S[        U   -  -  n SnSU ;   a  SnX4$ )Nz
%sr   CVEr   )upperr   )clsidclsid_uppercolors      r   clsid_displayr%      sB    ++-Kl",{333E~>r   c                  N	   Sn [         R                  " U S9nUR                  SSSSS9  UR                  SS	S
SS SS9  UR                  SSSSSSS9  UR                  5       u  p#[	        U5      S:X  aC  [        [        5        [        [        5        UR                  5         [        R                  " 5         [        [        5        [        R                  S:X  a  [        R                  R                  SSS9  [         R"                  " X2R$                  UR&                  UR(                  S9 GHn  u  pEnU(       a  UR+                  S5      (       a  M&  U(       a	  U< SU< 3OUn[        SU-  5        Ub  [,        R.                  " U5      nO[,        R.                  " U5      n[0        R2                  " / SQS[0        R4                  S9n	[7        [	        UR8                  5      5       GHT  n
UR8                  U
   nUc5  UR;                  U
5      nUR<                  [,        R>                  :X  a  SnOSnOS nUR                  RA                  S!5      (       a  S"nO[C        UR                  5      S#S$ n[E        URF                  5      n[E        URH                  5      n[E        URJ                  5      n[L        RO                  UR<                  S%5      n[P        RO                  UR<                  S&5      n[R        RO                  US&5      nU	RU                  XUXUUS'URV                  -  URX                  4	S UUS S S S S S 4	S(9  GMW     [0        R2                  " / S)QS*[0        R4                  S9n	UR[                  5       nSnUR\                  R^                  n[a        U5      u  nnU	RU                  UUS+U4S S,S U4S(9  [c        URe                  SS-95       H  nUS$   n[C        U5      S#S$ nS nURg                  U5      [,        Rh                  [,        Rj                  4;   a  S,nS.[	        U5      S#-
  -  U-   nURm                  U5      n URo                  U5      nURq                  U5      n[a        U5      u  nnU	RU                  UUUU4S US U4S(9  M     URs                  5         GMq     g !   S+n NW= f)/Nz2usage: oledir [options] <filename> [filename2 ...])usagez-r
store_true	recursivez)find files recursively in subdirectories.)actiondesthelpz-zz--zipzip_passwordstrzhif the file is a zip archive, open all files from it, using the provided password (requires Python 2.6+))r+   typedefaultr,   z-fz
--zipfname	zip_fname*zoif the file is a zip archive, file(s) to be opened within the zip. Wildcards * and ? are supported. (default:*)r   r   T)r   reset_atexit)r)   r-   r1   /z in z!OLE directory entries in file %s:)	               r9   r9      r6   )	idStatusTypeNameLeftRightChildz1st SectSize)column_width
header_rowstyler   r   r        Unknownr   z%X)colors)r5      r6   &   )r;   r>   rB   CLSIDr   r   )storagesz  ):optparseOptionParser
add_option
parse_argslenprintBANNER__doc__
print_helpsysexitosname
colorclassWindowsenabler   
iter_filesr)   r-   r1   endswithr   	OleFileIOr   TableStreamTableStyleSlimrange
direntries_load_direntry
entry_typeSTGTY_EMPTY
startswithreprr   sid_left	sid_right	sid_childSTORAGE_NAMESgetSTORAGE_COLORSSTATUS_COLORS	write_row
isectStartsizeget_rootentry_namerootr"   r%   sortedlistdirget_typeSTGTY_STORAGE
STGTY_ROOT_findget_sizegetclsidclose)r'   parseroptionsargs	containerfilenamedata	full_nameoletabler;   dstatusr\   leftrightchildrh   etype_colorstatus_colorrootnameentry_idr"   
clsid_textclsid_colorentry
name_colorindented_nameru   s                                r   mainr      sZ   @E""/F
d<kF  H
dG.ud F  G
dL{PS M  N '')OW 4yA~fg
 
&M	ww$!!d!F%*%5%5dFWFWCJCWCWcjctct&v!	T **3//:C(I6	1I=>##D)C ##H-C ''5Qe,,. CNN+,Br"Ay&&r*<<7#6#66%F%F "vv  (( AFF|Ab)

+D,E,E&**1<<CJ(,,Q\\5AK(,,VU;L
 OORTtVWVbVbObdedjdjklKtT4QUW[\  ^; -@ ''^6,,. ))+"/"6
K8S*= $fdK@ 	 	BCKKK67E9D:a#DJ||E"w'<'<g>P>P&QQ#
 #e*Q,/$6Myy'H||E* LL'E&3E&:#JOOX}dJG$(*dK#H  J 8& 			C&vrs   <RR$__main__))rW   
__future__r   __version__rY   r[   rP   r   r]   r\   r^   r_   pathnormpathabspathdirname__file___thismodule_dirjoin_parent_dirinsertoletools.thirdparty.tablestreamr   oletools.thirdparty.xglobr   oletools.common.clsidr   rV   ri   r{   STGTY_STREAMSTGTY_LOCKBYTESSTGTY_PROPERTYr|   ro   rq   rr   r   r%   r   __name__ r   r   <module>r      s  L &       77d?$/ ''""277??277??83L#MNggrww||OTBCchhHHOOA{# 7 + . 
<k	I WYX\/V WVXYYV ~D zF r   