
    Zi                        S r SrSSKrSSKrSSKr\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rSSKJr  SSKJr  S rS rS	 r\S
:X  a  \" 5         gg)ax  
oletimes.py

oletimes is a script to parse OLE files such as MS Office documents (e.g. Word,
Excel), to extract creation and modification times of all streams and storages
in the OLE file.

Usage: oletimes.py <file>

oletimes project website: http://www.decalage.info/python/oletimes

oletimes is part of the python-oletools package:
http://www.decalage.info/python/oletools
z0.54    Nz..)xglob)prettytablec                 >    U c  gU R                  SS9n [        U 5      $ )z
Convert a datetime object to a string for display, without microseconds

:param dt: datetime.datetime object, or None
:return: str, or None
Nr   )microsecond)replacestr)dts    k/var/www/eduai.edurigo.com/question_generate/ques_gen_env/lib/python3.13/site-packages/oletools/oletimes.pydt2strr   V   s%     
z		"Br7N    c           
         [         R                  " / SQ5      nSUl        SUl        UR	                  S[        U R                  R                  5       5      [        U R                  R                  5       5      45        U R                  SSS9 H_  nUR	                  [        SR                  U5      5      [        U R                  U5      5      [        U R                  U5      5      45        Ma     [        U5        g )N)zStream/Storage namezModification TimezCreation Timel   RootT)streamsstorages/)r   PrettyTablealign	max_widthadd_rowr   rootgetmtimegetctimelistdirreprjoinprint)oletobjs      r
   process_oler"   c   s     ]^AAGAKIIvvchh//12F388;L;L;N4OPQ{{4${7			4&s||C/@(A6#,,WZJ[C\]^ 8	!Hr   c            	      D   [        S[        -  5        [        S5        [        S5        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  a4  [        [        5        UR                  5         [        R                  " 5         [        R                  " X2R                  UR                  UR                  S9 H  u  pEnU(       a  UR!                  S5      (       a  M%  U(       a	  U< SU< 3OUn[        S5        [        SU-  5        Ub  ["        R$                  " U5      nO["        R$                  " U5      n['        U5        UR)                  5         M     g )Nz2oletimes %s - http://decalage.info/python/oletoolsz3THIS IS WORK IN PROGRESS - Check updates regularly!zGPlease report any issue at https://github.com/decalage2/oletools/issuesz4usage: oletimes [options] <filename> [filename2 ...])usagez-r
store_true	recursivez)find files recursively in subdirectories.)actiondesthelpz-zz--zipzip_passwordr   zhif 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&   r*   r-   r   z in zO===============================================================================z	FILE: %s
)r   __version__optparseOptionParser
add_option
parse_argslen__doc__
print_helpsysexitr   
iter_filesr&   r*   r-   endswitholefile	OleFileIOr"   close)	r$   parseroptionsargs	containerfilenamedata	full_namer   s	            r
   mainrE   o   s   	
>
LM	@A	TUBE""/F
d<kF  H
dG.ud F  G
dL{PS M  N '')OW 4yA~g
%*%5%5dFWFWCJCWCWcjctct&v!	T **3//:C(I6	hlY&'##D)C ##H-CC		!&vr   __main__)r5   r/   r7   osr0   pathnormpathabspathdirname__file___thismodule_dirr   _parent_dirinsertr;   oletools.thirdpartyr   oletools.thirdparty.prettytabler   r   r"   rE   __name__ r   r
   <module>rT      s   j    ''""277??277??83L#MNggrww||OTBCchhHHOOA{#  % 7

+Z zF r   