403Webshell
Server IP : 54.37.205.81  /  Your IP : 216.73.216.76
Web Server : nginx/1.22.1
System : Linux vps-249481fa 6.1.0-50-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.176-1 (2026-07-02) x86_64
User : debian ( 1000)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/olefile/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/olefile/__pycache__/olefile.cpython-311.pyc
�

6��[_����dZddlmZdZdZdZgd�ZddlZddlZddl	Z	ddl
Z
ddlZddl
Z
ddlZeeureZ	eZn	#eZYnxYwe
j
d��jd	krdZnCe
j
d
��jd	krd
Zn'e
j
d��jd	krdZned���	en
#e$reZYnwxYwd
ZejddkrdZndZejdzfd�Zed��Z d�Z!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-d	Z.dZ/dZ0dZ1dZ2dZ3dZ4d	Z5dZ6dZ7dZ8dZ9d Z:d!Z;d"Z<d#Z=d$Z>d%Z?d&Z@d'ZAd(ZBd)ZCd*ZDd+ZEd,ZFd-ZGd.ZHd/ZId0ZJd1ZKd2ZLd3ZMd4ZNd5ZOd6ZPd7ZQd8ZRd9ZSd:ZTd;ZUd<ZVd=ZWd>ZXd?ZYd@ZZd!Z[d*Z\d4Z]dAZ^dBZ_dC�Z`eeurdD�ZandE�ZadTdF�ZbdTdG�ZcdH�ZddI�ZeGdJ�dK��ZfGdL�dMejg��ZhGdN�dO��ZiGdP�dQ��ZjdR�ZkeldSkrek��dSdS)Ua:
olefile (formerly OleFileIO_PL)

Module to read/write Microsoft OLE2 files (also called Structured Storage or
Microsoft Compound Document File Format), such as Microsoft Office 97-2003
documents, Image Composer and FlashPix files, Outlook messages, ...
This version is compatible with Python 2.7 and 3.4+

Project website: https://www.decalage.info/olefile

olefile is copyright (c) 2005-2018 Philippe Lagadec
(https://www.decalage.info)

olefile is based on the OleFileIO module from the PIL library v1.1.7
See: http://www.pythonware.com/products/pil/index.htm
and http://svn.effbot.org/public/tags/pil-1.1.7/PIL/OleFileIO.py

The Python Imaging Library (PIL) is
Copyright (c) 1997-2009 by Secret Labs AB
Copyright (c) 1995-2009 by Fredrik Lundh

See source code and LICENSE.txt for information on usage and redistribution.
�)�print_functionz
2018-09-09z0.46zPhilippe Lagadec)�	isOleFile�	OleFileIO�OleMetadata�enable_logging�MAGIC�STGTY_EMPTY�KEEP_UNICODE_NAMES�STGTY_STREAM�
STGTY_STORAGE�
STGTY_ROOT�STGTY_PROPERTY�STGTY_LOCKBYTES�MINIMAL_OLEFILE_SIZE�
DEFECT_UNSURE�DEFECT_POTENTIAL�DEFECT_INCORRECT�DEFECT_FATAL�DEFAULT_PATH_ENCODING�
MAXREGSECT�DIFSECT�FATSECT�
ENDOFCHAIN�FREESECT�	MAXREGSID�NOSTREAM�UNKNOWN_SIZE�
WORD_CLSIDN�L��I�iz>Need to fix a bug with 32 bit arrays, please contact author...T�zutf-8�c�*�|tjjjvr+tj|��}|�|��|Stj|��}|�tj����|�|��|S)an
    Create a suitable logger object for this module.
    The goal is not to change settings of the root logger, to avoid getting
    other modules' logs on the screen.
    If a logger exists with same name, reuse it. (Else it would have duplicate
    handlers and messages would be doubled.)
    The level is set to CRITICAL+1 by default, to avoid any logging.
    )�logging�Logger�manager�
loggerDict�	getLogger�setLevel�
addHandler�NullHandler)�name�level�loggers   �1/usr/lib/python3/dist-packages/olefile/olefile.py�
get_loggerr2�s����w�~�%�0�0�0��"�4�(�(����������
�
�
�t�
$�
$�F����g�)�+�+�,�,�,�
�O�O�E�����M��olefilec�N�t�tj��dS)z�
    Enable logging for this module (disabled by default).
    This will set the module-specific logger level to NOTSET, which
    means the main application controls the actual logging level.
    N)�logr+r&�NOTSET�r3r1rr�s���L�L��� � � � � r3s��ࡱ�l��l��l��l�������i�������	�
���
������������������@�A�B�C�D�E�F�G�H�z$00020900-0000-0000-C000-000000000046�(ic���t|d��r=|�tt����}|�d��n�t|t��r5t|��tkr|dtt���}nOt|d��5}|�tt����}ddd��n#1swxYwY|tkrdSdS)aJ
    Test if a file is an OLE container (according to the magic bytes in its header).

    .. note::
        This function only checks the first 8 bytes of the file, not the
        rest of the OLE structure.

    .. versionadded:: 0.16

    :param filename: filename, contents or file-like object of the OLE file (string-like or file-like object)

        - if filename is a string smaller than 1536 bytes, it is the path
          of the file to open. (bytes or unicode string)
        - if filename is a string longer than 1535 bytes, it is parsed
          as the content of an OLE file in memory. (bytes type only)
        - if filename is a file-like object (with read and seek methods),
          it is parsed as-is.

    :type filename: bytes or str or unicode or file
    :returns: True if OLE, False otherwise.
    :rtype: bool
    �readrN�rbTF)	�hasattrra�lenr�seek�
isinstance�bytesr�open)�filename�header�fps   r1rrs	��0�x�� � �)����s�5�z�z�*�*���
�
�a�����	�H�e�	$�	$�)��X���:N�)N�)N��+�3�u�:�:�+�&����(�D�
!�
!�	)�R��W�W�S��Z�Z�(�(�F�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)����	)�	)�	)�	)�
�����t��us�((C�C �#C c� �t|��S�N)�ord��cs r1�i8rq?s
���1�v�v�
r3c�2�|jtur|n|dS�Nr)�	__class__�intros r1rqrqCs���K�3�&�&�q�q�A�a�D�0r3c�N�tjd|||dz���dS)z�
    Converts a 2-bytes (16 bits) string to an integer.

    :param c: string containing bytes to convert
    :param o: offset of bytes to convert in string
    z<Hr:r��struct�unpack�rp�os  r1�i16r|G�'���=��q��1�Q�3��x�(�(��+�+r3c�N�tjd|||dz���dS)z�
    Converts a 4-bytes (32 bits) string to an integer.

    :param c: string containing bytes to convert
    :param o: offset of bytes to convert in string
    z<Ir rrwrzs  r1�i32rQr}r3c
��t|��dksJ�|�d��sdSdt|d��t|d��t|d��ft	tt|dd�����zzS)	z^
    Converts a CLSID to a human-readable string.

    :param clsid: string of length 16.
    rE��z0%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02Xrr r<r>)rd�striprr|�tuple�maprq)�clsids r1�_clsidr�[s����u�:�:�������;�;�u�����r�
4��%��m�m�S���]�]�C��q�M�M�
:��#�b�%��"��+�&�&�'�'�(�
)�*r3c�j�tjdddddd��}|tj|dz���zS)zL
        convert FILETIME (64 bits int) to Python datetime.datetime
        �Ar$rr@��microseconds)�datetime�	timedelta)�filetime�_FILETIME_null_dates  r1�filetime2datetimer�ls<��'�/��a��A�q�!�D�D��"�X�%7�X�r�\�%R�%R�%R�R�Rr3c�4�eZdZdZgd�Zgd�Zd�Zd�Zd�ZdS)raT
    class to parse and store metadata from standard properties of OLE files.

    Available attributes:
    codepage, title, subject, author, keywords, comments, template,
    last_saved_by, revision_number, total_edit_time, last_printed, create_time,
    last_saved_time, num_pages, num_words, num_chars, thumbnail,
    creating_application, security, codepage_doc, category, presentation_target,
    bytes, lines, paragraphs, slides, notes, hidden_slides, mm_clips,
    scale_crop, heading_pairs, titles_of_parts, manager, company, links_dirty,
    chars_with_spaces, unused, shared_doc, link_base, hlinks, hlinks_changed,
    version, dig_sig, content_type, content_status, language, doc_version

    Note: an attribute is set to None when not present in the properties of the
    OLE file.

    References for SummaryInformation stream:

    - https://msdn.microsoft.com/en-us/library/dd942545.aspx
    - https://msdn.microsoft.com/en-us/library/dd925819%28v=office.12%29.aspx
    - https://msdn.microsoft.com/en-us/library/windows/desktop/aa380376%28v=vs.85%29.aspx
    - https://msdn.microsoft.com/en-us/library/aa372045.aspx
    - http://sedna-soft.de/articles/summary-information-stream/
    - https://poi.apache.org/apidocs/org/apache/poi/hpsf/SummaryInformation.html

    References for DocumentSummaryInformation stream:

    - https://msdn.microsoft.com/en-us/library/dd945671%28v=office.12%29.aspx
    - https://msdn.microsoft.com/en-us/library/windows/desktop/aa380374%28v=vs.85%29.aspx
    - https://poi.apache.org/apidocs/org/apache/poi/hpsf/DocumentSummaryInformation.html

    new in version 0.25
    )�codepage�title�subject�author�keywords�comments�template�
last_saved_by�revision_number�total_edit_time�last_printed�create_time�last_saved_time�	num_pages�	num_words�	num_chars�	thumbnail�creating_application�security)�codepage_doc�category�presentation_targetrg�lines�
paragraphs�slides�notes�
hidden_slides�mm_clips�
scale_crop�
heading_pairs�titles_of_partsr(�company�links_dirty�chars_with_spaces�unused�
shared_doc�	link_base�hlinks�hlinks_changed�version�dig_sig�content_type�content_status�language�doc_versionc��d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_!d|_"d|_#d|_$d|_%d|_&d|_'d|_(d|_)d|_*d|_+d|_,d|_-d|_.dS)z_
        Constructor for OleMetadata
        All attributes are set to None by default
        N)/r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rgr�r�r�r�r�r�r�r�r�r(r�r�r�r�r�r�r�r�r�r�r�r�r�r���selfs r1�__init__zOleMetadata.__init__�se����
���
���������
���
���
�!���#���#��� ������#���������������$(��!���
� �����
�#'�� ���
���
���������
�!�����
����!���#������������!%���������������"��������� ���"�����
�����r3c�h�|j|jzD]}t||d���|�d��rr|�dddg���}tt
|j����D]7}|�|dzd��}t||j||���8|�d��rp|�dd���}tt
|j����D]9}|�|dzd��}t||j||���8dSdS)	a=
        Parse standard properties of an OLE file, from the streams
        ``\x05SummaryInformation`` and ``\x05DocumentSummaryInformation``,
        if present.
        Properties are converted to strings, integers or python datetime objects.
        If a property is not present, its value is set to None.
        NzSummaryInformationTr@)�convert_time�
no_conversionr$zDocumentSummaryInformation�r�)�SUMMARY_ATTRIBS�DOCSUM_ATTRIBS�setattr�exists�
getproperties�rangerd�get)r�r4�attrib�propsr"�values      r1�parse_propertieszOleMetadata.parse_properties�sg���+�d�.A�A�	(�	(�F��D�&�$�'�'�'�'��>�>�2�3�3�
	>��)�)�*B�!�"��*�7�7�E��3�t�3�4�4�5�5�
>�
>���	�	�!�A�#�t�,�,����d�2�1�5�u�=�=�=�=��>�>�:�;�;�	=��)�)�*J�!�*�#�#�E��3�t�2�3�3�4�4�
=�
=���	�	�!�A�#�t�,�,����d�1�!�4�e�<�<�<�<�	=�	=�

=�
=r3c	�2�td��|jD]4}t||��}td|�dt|�������5td��|jD]4}t||��}td|�dt|�������5dS)z<
        Dump all metadata, for debugging purposes.
        z*Properties from SummaryInformation stream:�- �: z2Properties from DocumentSummaryInformation stream:N)�printr��getattr�reprr�)r��propr�s   r1�dumpzOleMetadata.dumps���	�:�;�;�;��(�	4�	4�D��D�$�'�'�E��E����d�5�k�k�k�2�3�3�3�3�
�B�C�C�C��'�	4�	4�D��D�$�'�'�E��E����d�5�k�k�k�2�3�3�3�3�	4�	4r3N)	�__name__�
__module__�__qualname__�__doc__r�r�r�r�r�r8r3r1rrzss������ � �H���O�E�E�E�N�5 �5 �5 �p=�=�=�@4�4�4�4�4r3rc��eZdZdZd�ZdS)�	OleStreama�
    OLE2 Stream

    Returns a read-only file object which can be used to read
    the contents of a OLE stream (instance of the BytesIO class).
    To open a stream, use the openstream method in the OleFile class.

    This function can be used with either ordinary streams,
    or ministreams, depending on the offset, sectorsize, and
    fat table arguments.

    Attributes:

        - size: actual size of data stream, after it was opened.
    c	�x
�t�d��t�d|||||t|��t|��fz��||_|jjjrtd���d}	|tkr.t|��|z}d}	t�d��||dz
z|z}
t�d|
z��|
t|��kr |j�	td	��g}|d
krE|tkr:t�d��|j�	td��t|
��D�]�}t�d
||fz��|tkrY|	rt�d���nUt�d��|j�	td��|d
ks|t|��krot�d||t|��fz��t�d||
fz��|j�	td���n�	|�
|||zz��nO#t�d||||zz|fz��|j�	td��Y�n*xYw|�|��}
t|
��|kr�|t|��dz
kr�t�d|t|��|||zz|t|
��fz��t�d|||zzt|
��zz��|j�	td��|�|
��	||dz}��p#t $r$|j�	td��YnwxYwd�|��}t|��|kr>t�dt|��|fz��|d|�}||_n�|	r?t�dt|��z��t|��|_n`t�dt|��|fz��t|��|_|j�	td��t&j�||��dS) a_
        Constructor for OleStream class.

        :param fp: file object, the OLE container or the MiniFAT stream
        :param sect: sector index of first sector in the stream
        :param size: total size of the stream
        :param offset: offset in bytes for the first FAT or MiniFAT sector
        :param sectorsize: size of one sector
        :param fat: array/list of sector indexes (FAT or MiniFAT)
        :param filesize: size of OLE file (for debugging)
        :param olefileio: OleFileIO object containing this stream
        :returns: a BytesIO instance containing the OLE stream
        zOleStream.__init__:zE  sect=%d (%X), size=%d, offset=%d, sectorsize=%d, len(fat)=%d, fp=%sz2Attempting to open a stream from a closed OLE FileFTz  stream with UNKNOWN SIZEr$�nb_sectors = %dz(malformed OLE document, stream too largerz!size == 0 and sect != ENDOFCHAIN:z+incorrect OLE sector index for empty streamzReading stream sector[%d] = %Xhz6Reached ENDOFCHAIN sector for stream with unknown sizez$sect=ENDOFCHAIN before expected sizezincomplete OLE streamzsect=%d (%X) / len(fat)=%dzi=%d / nb_sectors=%d�,incorrect OLE FAT, sector index out of rangezsect=%d, seek=%d, filesize=%d�OLE sector index out of rangez9sect=%d / len(fat)=%d, seek=%d / filesize=%d, len read=%dzseek+len(read)=%d�incomplete OLE sectorr9r3z3Read data of length %d, truncated to stream size %dNz3Read data of length %d, the stream size was unknownz9Read data of length %d, less than expected stream size %dz%OLE stream size is less than declared)r6�debugrdr��olerk�closed�OSErrorr�
_raise_defectrrr�rera�append�
IndexError�join�size�io�BytesIOr�)r�rk�sectr��offset�
sectorsize�fat�filesize�	olefileio�unknown_size�
nb_sectors�datar"�sector_datas              r1r�zOleStream.__init__*s��	�	�	�'�(�(�(��	�	�Y��4��V�J�s�3�x�x��b���
B�C�	D�	D�	D�����8�;��	P��N�O�O�O����<����s�8�8�J�&�D��L��I�I�2�3�3�3��j��l�+�
�:�
��	�	�#�j�0�1�1�1���C��� � ��H�"�"�#3�5_�`�`�`����1�9�9���+�+��I�I�9�:�:�:��H�"�"�#3�5b�c�c�c��z�"�"�3	�3	�A��I�I�7�1�d�)�C�D�D�D��z�!�!��V��I�I�V�W�W�W��E��I�I�D�E�E�E��H�*�*�+;�=T�U�U�U��A�v�v��s�3�x�x����	�	�6�$��c�#�h�h�9O�O�P�P�P��	�	�0�1�j�/�A�B�B�B���&�&�'7�9g�h�h�h���
������d�!2�2�3�3�3�3��
��	�	�9��6�*�T�/�1�8�<�=�>�>�>���&�&�'7�9X�Y�Y�Y��������'�'�*�-�-�K�
�;����+�+��s�3�x�x��z�0B�0B��	�	�U��3�s�8�8�V�J�t�O�%;�X�s�;�GW�GW�X�Y�Z�Z�Z��	�	�-��
�4��1G��K�HX�HX�1X�Y�Z�Z�Z���&�&�'7�9P�Q�Q�Q��K�K��$�$�$�
��4�y�:�-�����
�
�
���&�&�'7�9g�h�h�h����	
�����x�x��~�~���t�9�9�����I�I�K�s�SW�y�y�Z^�N_�_�`�`�`�����;�D��D�I�I�
�
	^�
�I�I�K�c�RV�i�i�W�X�X�X��D�	�	�D�I�I�
�I�I�Q�UX�Y]�U^�U^�`d�Te�e�f�f�f��D�	�	�D�I��H�"�"�#3�5\�]�]�]�
�
���D�$�'�'�'�'�'s�J�AK)�O"�"*P�PN)r�r�r�r�r�r8r3r1r�r�s2��������&|(�|(�|(�|(�|(r3r�c��eZdZdZdZdZeje��eksJ�d�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zdd
�Zd�Zd�ZdS)�OleDirectoryEntryz
    OLE2 Directory Entry
    z<64sHBBIII16sIQQIII�c��||_||_g|_i|_d|_tjtj|��\|_	|_
|_|_|_
|_|_}|_|_|_|_|_|_|jt,t.t0t2fvr|�t6d��|jt,kr!|dkr|�t6d��|dkr+|jt,kr|�t6d��|j
dkr"|�t6d��d|_
|j	d|j
d	z
�|_|�|j��|_t>� d
|jtC|j��fz��t>� d|jz��t>� d|jz��t>� d
|j
|j|jfz��|j"dkrs|jdkr[|jdkrPt>� d|j"|j|j|jfz��|�tFd��|j|_$n$|jtK|j��dzz|_$t>� d|j$|j|jfz��tM|��|_'|jt.kr&|j$dkr|�tPd��d|_)|jt,t0fvrZ|j$dkrO|j$|j*kr|jt0krd|_)nd|_)|�+|j|j)��d|_,dS)aI
        Constructor for an OleDirectoryEntry object.
        Parses a 128-bytes entry from the OLE Directory stream.

        :param entry  : string (must be 128 bytes long)
        :param sid    : index of this directory entry in the OLE file directory
        :param olefile: OleFileIO containing this directory entry
        Fzunhandled OLE storage typerzduplicate OLE root entryzincorrect OLE root entryrUz(incorrect DirEntry name length >64 bytesNr:zDirEntry SID=%d: %sz - type: %dz - sect: %Xhz% - SID left: %d, right: %d, child: %d�r9z+sectorsize=%d, sizeLow=%d, sizeHigh=%d (%X)zincorrect OLE stream size� z% - size: %d (sizeLow=%d, sizeHigh=%d)zOLE storage with size>0T)-�sidr4�kids�	kids_dict�usedrxryr��STRUCT_DIRENTRY�name_raw�
namelength�
entry_type�color�sid_left�	sid_right�	sid_child�dwUserFlags�
createTime�
modifyTime�
isectStart�sizeLow�sizeHighr
rrr	r�r�
name_utf16�_decode_utf16_strr.r6r�r�r�rr��longr�r�r�
is_minifat�minisectorcutoff�_check_duplicate_stream�
sect_chain)r��entryrr4r�s     r1r�zOleDirectoryEntry.__init__�sx����������	������	�"
�M�+�;�U�C�C�	
��M��O��O��J��M��N��N�����O��O��O��L��M��?�:�}�l�K�"X�X�X��!�!�"2�4P�Q�Q�Q��?�j�(�(�S�A�X�X��!�!�"2�4N�O�O�O��!�8�8���:�5�5��!�!�"2�4N�O�O�O��?�2����!�!�"2�4^�_�_�_� �D�O��-�(<�$�/�!�*;�(<�=���
�-�-�d�o�>�>��	��	�	�'�4�8�T�$�)�_�_�*E�E�F�F�F��	�	�-�$�/�1�2�2�2��	�	�.�4�?�2�3�3�3��	�	�9�T�]��N�D�N�=,�,�	-�	-�	-����$�$��}��!�!�d�m�z�&A�&A��	�	�G��'���t�}�d�m�T�U�V�V�V��%�%�m�5P�Q�Q�Q���D�I�I����T�]�(;�(;�R�(?�@�D�I��	�	�9�T�Y���VZ�Vc�<d�d�e�e�e��E�]�]��
��?�m�+�+��	�Q����!�!�"2�4M�N�N�N�����?�z�<�8�8�8�T�Y�q�[�[��y�7�3�3�3����-�-�"&����"'����+�+�D�O�T�_�M�M�M�����r3c�|�|jrdS|jttfvs|jdkrdSt��|_|jr|js|���|j	}|tkrI|j�|��|jr|j|}n
|j|}|tk�GdSdSrs)
rrr
rr��listr�minifat�loadminifatrrr�r�)r�r4�	next_sects   r1�build_sect_chainz"OleDirectoryEntry.build_sect_chain-s����?�	��F��?�:�|�"<�<�<��	�Q����F��&�&����?�	"�7�?�	"����!�!�!��O�	��:�%�%��O�"�"�9�-�-�-���
3�#�O�I�6�	�	�#�K�	�2�	��:�%�%�%�%�%�%r3c��t�d|jt|j��|jfz��|jtkr5|�|j��|j�	��dSdS)z�
        Read and build the red-black tree attached to this OleDirectoryEntry
        object, if it is a storage.
        Note that this method builds a tree of all subentries, so it should
        only be called for the root object once.
        z.build_storage_tree: SID=%d - %s - sid_child=%dN)
r6r�rr�r.rr�append_kidsr�sortr�s r1�build_storage_treez$OleDirectoryEntry.build_storage_tree@s��	�	�	�B��x��d�i���$�.�9�:�	;�	;�	;��>�X�%�%�
���T�^�,�,�,�
�I�N�N������&�%r3c�d�t�d|z��|tkrdS|dks|t|jj��kr"|j�td��dS|j�|��}t�d|j	t|j��|j|j
|jfz��|jr"|j�td��dSd|_|�|j��|j���}||jvr |j�td��|j�|��||j|<|�|j
��|���dS)	a)
        Walk through red-black tree of children of this directory entry to add
        all of them to the kids list. (recursive method)

        :param child_sid: index of child directory entry to use, or None when called
            first time for the root. (only used during recursion)
        zappend_kids: child_sid=%dNrzOLE DirEntry index out of rangezHappend_kids: child_sid=%d - %s - sid_left=%d, sid_right=%d, sid_child=%dz#OLE Entry referenced more than onceTz!Duplicate filename in OLE storage)r6r�rrdr4�
direntriesr�r�_load_direntryrr�r.r	r
rrr!�lowerrrr�r#)r��	child_sid�child�
name_lowers    r1r!zOleDirectoryEntry.append_kidsXs���	�	�	�-�	�9�:�:�:��� � ��F��Q�;�;�)�S���)@�%A�%A�A�A��L�&�&�'7�9Z�[�[�[�[�[��L�/�/�	�:�:�E��I�I�`��9�d�5�:�.�.�����QV�Q`�a�b�
c�
c�
c��z�
���*�*�+;�9�;�;�;����E�J�
���U�^�,�,�,���)�)�+�+�J��T�^�+�+���*�*�+;�7�9�9�9�
�I���U�#�#�#�).�D�N�:�&����U�_�-�-�-��$�$�&�&�&�&�&r3c�"�|j|jkS�zCompare entries by name�r.�r��others  r1�__eq__zOleDirectoryEntry.__eq__�s���y�E�J�&�&r3c�"�|j|jkSr,r-r.s  r1�__lt__zOleDirectoryEntry.__lt__�s���y�5�:�%�%r3c�.�|�|��Srm)r0r.s  r1�__ne__zOleDirectoryEntry.__ne__�s���;�;�u�%�%�%�%r3c�V�|�|��p|�|��Srm)r0r2r.s  r1�__le__zOleDirectoryEntry.__le__�s%���{�{�5�!�!�7�T�[�[��%7�%7�7r3rc���gd�}	||j}n#t$rd}YnwxYwtd|zt|j��z|d���|jt
tfvrt|jdd���t��|jttfvr$|j	rtd|zd|j	zz��|j
D]}|�|dz���dS)	zADump this entry, and all its subentries (for debug purposes only))z	(invalid)z	(storage)z(stream)z(lockbytes)z
(property)z(root)z	(UNKNOWN)� ��endrgz{%s}r:N)rr�r�r�r.rr
r�rr�rr�)r��tab�TYPES�	type_name�kids     r1r�zOleDirectoryEntry.dump�s
��)�)�)��	$��d�o�.�I�I���	$�	$�	$�#�I�I�I�	$����
�c�#�g��T�Y���'���<�<�<�<��?�|�Z�8�8�8��$�)�W�#�.�.�.�.�
�����?�}�j�9�9�9�d�j�9��#�c�'�F�T�Z�/�/�0�0�0��9�	�	�C��H�H�S�1�W�����	�	s�
�#�#c�D�|jdkrdSt|j��S)z�
        Return modification time of a directory entry.

        :returns: None if modification time is null, a python datetime object
            otherwise (UTC timezone)

        new in version 0.26
        rN)rr�r�s r1�getmtimezOleDirectoryEntry.getmtime��&���?�a����4� ���1�1�1r3c�D�|jdkrdSt|j��S)z�
        Return creation time of a directory entry.

        :returns: None if modification time is null, a python datetime object
            otherwise (UTC timezone)

        new in version 0.26
        rN)r
r�r�s r1�getctimezOleDirectoryEntry.getctime�rAr3N�r)r�r�r�r�r�
DIRENTRY_SIZErx�calcsizer�rr#r!r0r2r4r6r�r@rCr8r3r1r�r��s���������.,�O��M��6�?�?�+�+�}�<�<�<�<�_�_�_�D3�3�3�&���0,'�,'�,'�^'�'�'�&�&�&�&�&�&�8�8�8�����&2�2�2�2�2�2�2�2r3r�c��eZdZdZdeddefd�Zd�Zd�Ze	fd�Z
d,d	�Zd-d
�Zd�Z
d-d�Zd.d�Zd.d�Zd�Zd�Zd�Zd�Zd�Zd/d�Zd/d�Zd�Zd�Zd�Zedfd�Zd0d�Zd0d�Zd�Zd �Z d!�Z!d"�Z"d#�Z#d$�Z$d%�Z%d&�Z&d'�Z'd(�Z(d)�Z)d1d*�Z*d+�Z+dS)2ra�
    OLE container object

    This class encapsulates the interface to an OLE 2 structured
    storage file.  Use the listdir and openstream methods to
    access the contents of this file.

    Object names are given as a list of strings, one for each subentry
    level.  The root entry should be omitted.  For example, the following
    code extracts all image streams from a Microsoft Image Composer file::

        ole = OleFileIO("fan.mic")

        for entry in ole.listdir():
            if entry[1:2] == "Image":
                fin = ole.openstream(entry)
                fout = open(entry[0:1], "wb")
                while True:
                    s = fin.read(8192)
                    if not s:
                        break
                    fout.write(s)

    You can use the viewer application provided with the Python Imaging
    Library to view the resulting files (which happens to be standard
    TIFF files).
    NFc�l�||_g|_||_||_d|_d|_g|_g|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_!d|_"d|_#d|_$d|_%d|_&|r|�'||���dSdS)a�
        Constructor for the OleFileIO class.

        :param filename: file to open.

            - if filename is a string smaller than 1536 bytes, it is the path
              of the file to open. (bytes or unicode string)
            - if filename is a string longer than 1535 bytes, it is parsed
              as the content of an OLE file in memory. (bytes type only)
            - if filename is a file-like object (with read, seek and tell methods),
              it is parsed as-is.

        :param raise_defects: minimal level for defects to be raised as exceptions.
            (use DEFECT_FATAL for a typical application, DEFECT_INCORRECT for a
            security-oriented application, see source code for details)

        :param write_mode: bool, if True the file is opened in read/write mode instead
            of read-only by default.

        :param debug: bool, set debug mode (deprecated, not used anymore)

        :param path_encoding: None or str, name of the codec to use for path
            names (streams and storages), or None for Unicode.
            Unicode by default on Python 3+, UTF-8 on Python 2.x.
            (new in olefile 0.42, was hardcoded to Latin-1 until olefile v0.41)
        N)�
write_mode)(�_raise_defects_level�parsing_issuesrI�
path_encoding�	_filesize�
ministream�_used_streams_fat�_used_streams_minifat�
byte_order�directory_fpr%�dll_versionr��first_difat_sector�first_dir_sector�first_mini_fat_sectorrk�header_clsid�header_signature�metadata�mini_sector_shift�mini_sector_size�mini_stream_cutoff_sizer�minifatsectr�minisectorsize�
minor_version�nb_sect�num_difat_sectors�num_dir_sectors�num_fat_sectors�num_mini_fat_sectors�	reserved1�	reserved2�root�sector_shift�sector_size�transaction_signature_numberrh)r�ri�
raise_defectsrIr�rLs      r1r�zOleFileIO.__init__�sf��:%2��!�!���$���*���������!#���%'��"���� ������������"&��� $���%)��"���� ��� $�����
�!%��� $���'+��$������� $���"������!������!%���#���#���$(��!���������	� ������,0��)��	7��I�I�h�:�I�6�6�6�6�6�	7�	7r3c��|Srmr8r�s r1�	__enter__zOleFileIO.__enter__6s���r3c�.�|���dSrm)�close)r��argss  r1�__exit__zOleFileIO.__exit__:s���
�
�����r3c���||jkr%t�|��||���|j�||f��t�|��dS)a�
        This method should be called for any defect found during file parsing.
        It may raise an IOError exception according to the minimal level chosen
        for the OleFileIO object.

        :param defect_level: defect level, possible values are:

            - DEFECT_UNSURE    : a case which looks weird, but not sure it's a defect
            - DEFECT_POTENTIAL : a potential defect
            - DEFECT_INCORRECT : an error according to specifications, but parsing can go on
            - DEFECT_FATAL     : an error which cannot be ignored, parsing is impossible

        :param message: string describing the defect, used with raised exception.
        :param exception_type: exception class to be raised, IOError by default
        N)rJr6�errorrKr��warning)r��defect_level�message�exception_types    r1r�zOleFileIO._raise_defect>sj��"�4�4�4�4��I�I�g���� �.��)�)�)�
��&�&���'@�A�A�A��K�K�� � � � � r3�replacec�v�|�d|��}|jr|�|j|��S|S)a�
        Decode a string encoded in UTF-16 LE format, as found in the OLE
        directory or in property streams. Return a string encoded
        according to the path_encoding specified for the OleFileIO object.

        :param utf16_str: bytes string encoded in UTF-16 LE format
        :param errors: str, see python documentation for str.decode()
        :return: str, encoded according to path_encoding
        zUTF-16LE)�decoderL�encode)r��	utf16_str�errors�unicode_strs    r1rzOleFileIO._decode_utf16_strXsE�� �&�&�z�6�:�:����	��%�%�d�&8�&�A�A�A��r3c���||_t|d��r||_nht|t��r2t|��tkrtj|��|_n!|jrd}nd}t||��|_d}|j�
dtj��	|j�
��}|j�
d��n#|j�
d��wxYw||_t�d|j|jfz��g|_g|_|j�d��}t|��dks|dd�t(krHt�d	|dd��d
t(����|�t,d��d}t/j|��}t�d
||dzfz��|d|�}t/j||��\|_|_|_|_|_|_|_ |_!|_"|_#|_$|_%|_&|_'|_(|_)|_*|_+t�t/j||����|jt(kr|�t,d��|jtYd��kr|�tZd��t�d|jz��t�d|jz��|jdvr|�tZd��t�d|jz��|jdkr|�tZd��d|jz|_.t�d|j.z��|j.dvr|�tZd��|jdkr|j.dks|jdkr&|j.dkr|�tZd ��d|j z|_/t�d!|j/z��|j/d"vr|�tZd#��|j!dks|j"dkr|�tZd$��t�d%|j#z��|j.dkr&|j#dkr|�tZd&��t�d'|j$z��t�d(|j%z��t�d)|j&z��|j&dkr|�t`d*��t�d+|j'z��|j'dkrD|�tZd,��t�1d-|j'z��d|_'t�d.|j(z��t�d/|j)z��t�d0|j*z��t�d1|j+z��||j.zd2z
|j.zd2z
|_2t�d3|j2|j2fz��tg|dd4���|_|j.|_4|j/|_5|j'|_6|�7|j%��|j)r|�7|j(��|j+r|�7|j*��|�8|��|�9|j%��|j(|_:dS)5a�
        Open an OLE2 file in read-only or read/write mode.
        Read and parse the header, FAT and directory.

        :param filename: string-like or file-like object, OLE file to parse

            - if filename is a string smaller than 1536 bytes, it is the path
              of the file to open. (bytes or unicode string)
            - if filename is a string longer than 1535 bytes, it is parsed
              as the content of an OLE file in memory. (bytes type only)
            - if filename is a file-like object (with read, seek and tell methods),
              it is parsed as-is.

        :param write_mode: bool, if True the file is opened in read/write mode instead
            of read-only by default. (ignored if filename is not a path)
        razr+brbrzFile size: %d bytes (%Xh)r�Nr>zMagic = z instead of z#not an OLE2 structured storage filez<8s16sHHHHHHLLLLLLLLLLzfmt_header size = %d, +FAT = %di�zincorrect OLE signaturerEzincorrect CLSID in OLE headerzMinor Version = %dz%DLL Version   = %d (expected: 3 or 4))r#r z"incorrect DllVersion in OLE headerz#Byte Order    = %X (expected: FFFE)i��z!incorrect ByteOrder in OLE headerr:z0Sector Size   = %d bytes (expected: 512 or 4096))r�r^z#incorrect sector_size in OLE headerr#r r^z3sector_size does not match DllVersion in OLE headerz/MiniFAT Sector Size   = %d bytes (expected: 64))rUz(incorrect mini_sector_size in OLE headerz.incorrect OLE header (non-null reserved bytes)z Number of Directory sectors = %dz3incorrect number of directory sectors in OLE headerzNumber of FAT sectors = %dzFirst Directory sector  = %Xhz$Transaction Signature Number    = %dz5incorrect OLE header (transaction_signature_number>0)z/Mini Stream cutoff size = %Xh (expected: 1000h)z/incorrect mini_stream_cutoff_size in OLE headerzJFixing the mini_stream_cutoff_size to 4096 (mandatory value) instead of %dzFirst MiniFAT sector      = %XhzNumber of MiniFAT sectors = %dzFirst DIFAT sector        = %XhzNumber of DIFAT sectors   = %dr$z/Maximum number of sectors in the file: %d (%Xh)rM);rIrcrkrfrgrdrr�r�rhre�os�SEEK_END�tellrMr6r�rOrPrarr�rrxrFryrXrWr_rSrQrhrZrerfrbrcrUrjr\rVrdrTra�	bytearrayrrir[rrtr`r�r�r^rr�loadfat�
loaddirectoryr])	r�rirI�moder�rj�
fmt_header�header_size�header1s	         r1rhzOleFileIO.openksQ��"%����8�V�$�$�	+��D�G�G�
��%�
(�
(�	+�S��]�]�>R�-R�-R��j��*�*�D�G�G���
�������8�T�*�*�D�G�
������Q���$�$�$�	��w�|�|�~�~�H��G�L�L��O�O�O�O��D�G�L�L��O�O�O�O����!����	�	�-�����0P�P�Q�Q�Q�"$���%'��"�����c�"�"���v�;�;�#��������u�!4�!4��I�I�I�F�2�A�2�J�J�J���F�G�G�G����|�-R�S�S�S�N.�
��o�j�1�1���	�	�4��[�SX�EX�7Y�Y�[�[�[���+��&��(
�M�*�g�.�.�'	
��!��������O����"��N��N�� �� ��!��-��(��&��%��#��"��	�	�6�=���8�8�9�9�9�� �E�)�)����|�-F�G�G�G���	�"�
�
�-�-����/�1P�Q�Q�Q��	�	�'�$�*<�<�>�>�>��	�	�:�T�=M�M�O�O�O���6�)�)�
���/�1U�V�V�V��	�	�8�4�?�J�L�L�L��?�f�$�$����/�1T�U�U�U��d�/�/����	�	�E��HX�X�Z�Z�Z���;�.�.����/�1V�W�W�W���a���D�$4�c�$9�$9���a���D�$4�d�$:�$:����/�1f�g�g�g� !�4�#9� 9����	�	�D�t�G\�\�^�^�^�� ��,�,����/�1[�\�\�\��>�Q���$�.�A�"5�"5����/�1a�b�b�b��	�	�5��8L�L�N�N�N���S� � �T�%9�1�%<�%<����/�1f�g�g�g��	�	�/�$�2F�F�H�H�H��	�	�2�T�5J�J�L�L�L��	�	�9�D�<]�]�_�_�_�
�,��1�1����/�1h�i�i�i��	�	�D�t�Gc�c�e�e�e��'�6�1�1����/�1b�c�c�c��K�K�d��4�5�
6�
6�
6�+1�D�(��	�	�4�t�7Q�Q�S�S�S��	�	�3�d�6O�O�Q�Q�Q��	�	�4�t�7N�N�P�P�P��	�	�3�d�6L�L�N�N�N�#�T�%5�5�a�7�D�<L�L�PQ�Q����	�	�D���VZ�Vb�Gc�c�d�d�d�
#�6�!�B�$�<�0�0����*���"�3��� $� <���	
�$�$�T�%:�;�;�;��$�	E��(�(��)C�D�D�D��!�	B��(�(��)@�A�A�A�	
���V����	
���4�0�1�1�1��5����s�0C$�$Dc�8�|j���dS)z@
        close the OLE file, to release the file object
        N)rkror�s r1rozOleFileIO.closeKs��	
��
�
�����r3c�D�|r%t�d|z��|j}nBt�d|z��|ttt
tfvrdS|j}||vr|�td��dS|�
|��dS)ag
        Checks if a stream has not been already referenced elsewhere.
        This method should only be called once for each known stream, and only
        if stream size is not null.

        :param first_sect: int, index of first sector of the stream in FAT
        :param minifat: bool, if True, stream is located in the MiniFAT, else in the FAT
        z,_check_duplicate_stream: sect=%Xh in MiniFATz(_check_duplicate_stream: sect=%Xh in FATNzStream referenced twice)r6r�rPrrrrrOr�rr�)r��
first_sectr�used_streamss    r1rz!OleFileIO._check_duplicate_streamRs����	2��I�I�D�z�Q�R�R�R��5�L�L��I�I�@�:�M�N�N�N��g�g�j��B�B�B����1�L���%�%����/�1J�K�K�K�K�K����
�+�+�+�+�+r3rc�0�d}tdtdtdtdi}t	|��}||zdz
|z}tdd�	��t
|��D]}td
|zd�	���t��t
|��D]�}||z}	td||	zzd�	��t
|	|	|z��D]F}||krn=||}
|
dz}||vr	||}n|
|dzkrd
}nd
|
z}t|d�	���Gt����dS)zU
        Display a part of FAT in human-readable form for debugging purposes
        r>z..free..z[ END. ]zFATSECT zDIFSECT r$�indexr8r9�%8X�%6X:r9z    --->N)rrrrrdr�r�)
r�r��
firstindex�VPL�fatnames�nbsect�nlinesr"�lr�r��auxr.s
             r1�dumpfatzOleFileIO.dumpfatlsc��
���
��
��
��
�	���S������*�Q�,��$��
�g�3������s���	&�	&�A��%�!�)��%�%�%�%�%�
�����v���	�	�A��c�E�E��&�J�u�,�-�3�7�7�7�7��5�%��)�,�,�
%�
%���f�9�9��E��1�v���Z�'���(�?�?�#�C�=�D�D��q��s�{�{�)���$�t�|���d��$�$�$�$�$��G�G�G�G�!	�	r3c�4�d}tjt|��}tjdkr|���t|��}||zdz
|z}t
dd���t|��D]}t
d|zd����t
��t|��D]h}||z}	t
d||	zzd���t|	|	|z��D](}||krn||}
d|
z}t
|d����)t
���id	S)
zS
        Display a sector in a human-readable form, for debugging purposes
        r>�bigr$r�r8r9r�r�N)�array�UINT32�sys�	byteorder�byteswaprdr�r�)r��sectorr�r�r;r�r�r"r�r�r�r.s            r1�dumpsectzOleFileIO.dumpsect�s?��
���k�&�&�)�)���=�E�!�!��L�L�N�N�N��S������*�Q�,��$��
�g�3������s���	&�	&�A��%�!�)��%�%�%�%�%�
�����v���		�		�A��c�E�E��&�J�u�,�-�3�7�7�7�7��5�%��)�,�,�
%�
%���f�9�9��E��1�v���t�|���d��$�$�$�$�$��G�G�G�G�		�		r3c��tjt|��}tjdkr|���|S)z�
        convert a sector to an array of 32 bits unsigned integers,
        swapping bytes on big endian CPUs such as PowerPC (old Macs)
        r�)r�r�r�r�r�)r�r��as   r1�
sect2arrayzOleFileIO.sect2array�s4��

�K���%�%���=�E�!�!�
�J�J�L�L�L��r3c��t|tj��r|}nN|�|��}t�t
j��r|�|��d}|D]�}|dz}t�d|z��|tks|tkrt�d��n:|�|��}|�|��}|j|z|_��|S)z�
        Adds the indexes of the given sector to the FAT

        :param sect: string containing the first FAT sector, or array of long integers
        :returns: index of last FAT sector.
        Nr9z
isect = %Xzfound end of sector chain)
rfr�r�r6�isEnabledForr&�DEBUGr�r�rr�getsectr�)r�r��fat1�isect�s�nextfats      r1�loadfat_sectzOleFileIO.loadfat_sect�s����d�E�K�(�(�	$��D�D��?�?�4�(�(�D�����
�.�.�
$��
�
�d�#�#�#����	*�	*�E��J�&�E��I�I�l�U�*�+�+�+��
�"�"�e�x�&7�&7��	�	�5�6�6�6������U�#�#�A��o�o�a�(�(�G��x�'�)�D�H�H��r3c�"�t�d��|dd�}t�dt|��t|��dzfz��tjt��|_|�|��|jdk�r�t�d��|jdkr|�	td	��|j|jkr|�	td
��t�d��|jdzdz
}|jdz
|zdz
|z}t�d
|z��|j|krtd���|j}t!|��D]�}t�d||fz��|�|��}|�|��}t�t(j��r|�|��|�|d|���||}t�d|z����|t.t0fvrtd���nt�d��t|j��|jkrOt�dt|j��|jfz��|jd|j�|_t�dt|j��|jfz��t�t(j��r6t�d��|�|j��dSdS)z%
        Load the FAT table.
        zDLoading the FAT table, starting with the 1st sector after the header�Lr�zlen(sect)=%d, so %d integersr rz)DIFAT is used, because file size > 6.8MB.�mz#incorrect DIFAT, not enough sectorsz)incorrect DIFAT, first index out of rangezDIFAT analysis...r$z
nb_difat = %dzincorrect DIFATzDIFAT block %d, sector %XNznext DIFAT sector: %Xzincorrect end of DIFATz$No DIFAT, because file size < 6.8MB.z!len(fat)=%d, shrunk to nb_sect=%dz6FAT references %d sectors / Maximum %d sectors in filez
FAT:)r6r�rdr�r�r�r�rarcr�rrTr`rr��IOError�	iterranger�r�r�r&r�r�rrr�)	r�rjr��nb_difat_sectors�nb_difat�isect_difatr"�sector_difat�difats	         r1r�zOleFileIO.loadfat�s9��	�	�	�X�Y�Y�Y��b��f�~���	�	�1�S��Y�Y��D�	�	�1��4M�M�O�O�O�
�;�v�&�&������$�����!�Q�&�&��I�I�A�B�B�B��#�s�*�*��"�"�#3�5Z�[�[�[��&�$�,�6�6��"�"�<�1\�]�]�]��I�I�*�,�,�,�!%��� 2�A�5���,�S�0�3C�C�A�E�HX�X�H��I�I���1�3�3�3��%��1�1��/�0�0�0��1�K��x�(�(�
C�
C���	�	�6�!�[�9I�I�K�K�K�#�|�|�K�8�8������5�5���#�#�G�M�2�2�0��M�M�,�/�/�/��!�!�%�(9�)9�(9�":�;�;�;�#�$4�5���	�	�2�[�@�B�B�B�B��:�x�"8�8�8��6�7�7�7�9�
�I�I�<�=�=�=��t�x�=�=�4�<�'�'��I�I�9�S���]�]�D�L�<Y�Y�Z�Z�Z��x�
���
�.�D�H��	�	�J�c�RV�RZ�m�m�]a�]i�Mj�j�k�k�k����G�M�*�*�	#��I�I�h�����L�L���"�"�"�"�"�	#�	#r3c�4�|j|jz}|jj|jzdz
|jz}|dz}t
�d|j|j|||fz��||kr|�td��|�
|j|d������}|�|��|_
t
�dt|j
��|fz��|j
d|�|_
t
�d	t|j
��z��t
�t j��r6t
�d
��|�|j
��dSdS)z)
        Load the MiniFAT table.
        r$r zaloadminifat(): minifatsect=%d, nb FAT sectors=%d, used_size=%d, stream_size=%d, nb MiniSectors=%dz%OLE MiniStream is larger than MiniFATT��	force_FATz$MiniFAT shrunk from %d to %d sectorsNzloadminifat(): len=%dz	
MiniFAT:)rdrirgr�r[r6r�r]r�r�_openrar�rrdr�r&r�r�)r��stream_size�nb_minisectors�	used_sizer�s     r1rzOleFileIO.loadminifat.s|���/�$�2B�B���)�.�4�+@�@��B�t�G\�\��"�Q�&�	��	�	�u�
�
�t�8�)�[�R`�a�b�	c�	c�	c��{�"�"����/�1X�Y�Y�Y��J�J�t�'���J�E�E�J�J�L�L�����q�)�)����	�	�8�C���<M�<M�~�;^�^�_�_�_��|�O�^�O�4����	�	�)�C���,=�,=�=�>�>�>����G�M�*�*�	'��I�I�l�#�#�#��L�L���&�&�&�&�&�	'�	'r3c��	|j�|j|dzz��nR#t�d||j|dzz|jfz��|�td��YnxYw|j�|j��}t|��|jkrMt�d|t|��|jfz��|�td��|S)z�
        Read given sector from file on disk.

        :param sect: int, sector index
        :returns: a string containing the sector data.
        r$z(getsect(): sect=%X, seek=%d, filesize=%dr�z*getsect(): sect=%X, read=%d, sectorsize=%dr�)
rkrer�r6r�rMr�rrard)r�r�r�s   r1r�zOleFileIO.getsectRs���$	N��G�L�L���D��F�3�4�4�4�4��	N��I�I�@��t���Q��/���@�A�
B�
B�
B����|�-L�M�M�M�M�M��������d�o�.�.���v�;�;�$�/�)�)��I�I�B��s�6�{�{�D�O�4�5�
6�
6�
6����|�-D�E�E�E��
s
�%(�A
A7r�c��t|t��std���t|t��rt|��dkrtd���	|j�|j|dzz��nR#t�d||j|dzz|j	fz��|�
td��YnxYwt|��|jkr|||jt|��z
zz
}n't|��|jkrtd���|j�
|��dS)z�
        Write given sector to file on disk.

        :param sect: int, sector index
        :param data: bytes, sector data
        :param padding: single byte, padding character if data < sector size
        z'write_sect: data must be a bytes stringr$z4write_sect: padding must be a bytes string of 1 charz+write_sect(): sect=%X, seek=%d, filesize=%dr��Data is larger than sector sizeN)rfrg�	TypeErrorrdrkrer�r6r�rMr�r�
ValueError�write)r�r�r��paddings    r1�
write_sectzOleFileIO.write_sectrsK���$��&�&�	G��E�F�F�F��'�5�)�)�	T�S��\�\�1�_�_��R�S�S�S�	N��G�L�L���D��F�3�4�4�4�4��	N��I�I�C��t���Q��/���@�A�
B�
B�
B����|�-L�M�M�M�M�M�����t�9�9�t��&�&��G�t���T���:�;�;�D�D�
��Y�Y���
(�
(��>�?�?�?���
�
�d�����s
�%B�A
Cc�<�t|t��std���t|t��rt|��dkrtd���	|j�|��nF#t�d||jfz��|�	td��YnxYwt|��}||jkr|||j|z
zz
}|j|krtd���|j�
|��dS)z�
        Write given sector to file on disk.

        :param fp_pos: int, file position
        :param data: bytes, sector data
        :param padding: single byte, padding character if data < sector size
        z,write_mini_sect: data must be a bytes stringr$z9write_mini_sect: padding must be a bytes string of 1 charz)write_mini_sect(): fp_pos=%d, filesize=%dr�r�N)rfrgr�rdrkrer6r�rMr�rr[r�r�)r��fp_posr�r��len_datas     r1�_write_mini_sectzOleFileIO._write_mini_sect�s+���$��&�&�	L��J�K�K�K��'�5�)�)�	Y�S��\�\�Q�->�->��W�X�X�X�	N��G�L�L�� � � � ��	N��I�I�A��t�~�.�/�
0�
0�
0����|�-L�M�M�M�M�M�����t�9�9���d�+�+�+��G�t�4�x�?�@�@�D�� �8�+�+��>�?�?�?���
�
�d�����s
�A8�8AB;c�x�t�d��|�|d���|_|jjdz}t�d|jj|fz��dg|z|_|�d��}|jd|_|j���dS)z]
        Load the directory.

        :param sect: sector index of directory stream.
        zLoading the Directory:Tr�r�z&loaddirectory: size=%d, max_entries=%dNr)	r6r�r�rRr�r%r&rgr#)r�r��max_entries�
root_entrys    r1r�zOleFileIO.loaddirectory�s���	�	�	�*�+�+�+�!�J�J�t�t�J�<�<����'�,��3���	�	�:�
�
�
#�[�1�2�	3�	3�	3� �&�;�.����(�(��+�+�
��O�A�&��	�	
�	�$�$�&�&�&�&�&r3c��|dks|t|j��kr|�td��|j|�(|�td��|j|S|j�|dz��|j�d��}t|||��|j|<|j|S)aY
        Load a directory entry from the directory.
        This method should only be called once for each storage/stream when
        loading the directory.

        :param sid: index of storage/stream in the directory.
        :returns: a OleDirectoryEntry object

        :exception IOError: if the entry has always been referenced.
        rz OLE directory index out of rangeNz'double reference for OLE stream/storager�)	rdr%r�rrrRrerar�)r�rrs   r1r&zOleFileIO._load_direntry�s����q�5�5�C��T�_�-�-�-�-����|�-O�P�P�P��?�3��+����/�9�
;�
;�
;��?�3�'�'�����s�S�y�)�)�)��!�&�&�s�+�+��0���T�B�B�������s�#�#r3c�8�|j���dS)z5
        Dump directory (for debugging only)
        N)rgr�r�s r1�
dumpdirectoryzOleFileIO.dumpdirectory�s��	
�	�������r3c
�$�t�d||t|��fz��||jkr�|s�|jsp|���|jj}t�d|jj|fz��|�	|jj|d���|_t|j||d|j|j|jj|���St|j
|||j|j|j|j|���S)a|
        Open a stream, either in FAT or MiniFAT according to its size.
        (openstream helper)

        :param start: index of first sector
        :param size: size of stream (or nothing if size is unknown)
        :param force_FAT: if False (default), stream will be opened in FAT or MiniFAT
            according to size. If True, it will always be opened in FAT.
        z1OleFileIO.open(): sect=%Xh, size=%d, force_FAT=%sz%Opening MiniStream: sect=%Xh, size=%dTr�r)rkr�r�r�r�r�r�r�)r6r��strrrNrrgr�rr�r�r^rrkr�r�rM)r��startr�r��size_ministreams     r1r�zOleFileIO._open�s,��	�	�	�E�
�D�#�i�.�.�)�*�	+�	+�	+��$�'�'�'�	�'��?�	
5�� � �"�"�"�#'�)�.���	�	�A��Y�)�?�;�<�=�=�=�"&�*�*�T�Y�-A�#�t�#-�#5�#5������e�$�$%�$�2E�!%����8L�'+�-�-�-�
-����e�$�$(�O�(,��T�X�&*�n�'+�	-�-�-�
-r3Tc�|�||jgz}|jD]�}|jtkrB|r&|�|dd�|jgz��|�|||||���T|jtkr)|r&|�|dd�|jgz����|�td����dS)a�
        listdir helper

        :param files: list of files to fill in
        :param prefix: current location in storage tree (list of names)
        :param node: current node (OleDirectoryEntry object)
        :param streams: bool, include streams if True (True by default) - new in v0.26
        :param storages: bool, include storages if True (False by default) - new in v0.26
            (note: the root storage is never included)
        r$NzIThe directory tree contains an entry which is not a stream nor a storage.)	r.rrrr��_listrr�r)r��files�prefix�node�streams�storagesrs       r1r�zOleFileIO._lists����4�9�+�%���Y�	B�	B�E���=�0�0��<��L�L������u�z�l�!:�;�;�;��
�
�5�&�%��(�C�C�C�C��!�\�1�1��<��L�L������u�z�l�!:�;�;�;���"�"�#3�6A�B�B�B�B�	B�	Br3c�F�g}|�|g|j||��|S)am
        Return a list of streams and/or storages stored in this file

        :param streams: bool, include streams if True (True by default) - new in v0.26
        :param storages: bool, include storages if True (False by default) - new in v0.26
            (note: the root storage is never included)
        :returns: list of stream and/or storage paths
        )r�rg)r�r�r�r�s    r1�listdirzOleFileIO.listdir3s*�����
�
�5�"�d�i��(�;�;�;��r3c��t|t��r|�d��}|j}|D]N}|jD]3}|j���|���krn�4td���|}�O|jS)a*
        Returns directory entry of given filename. (openstream helper)
        Note: this method is case-insensitive.

        :param filename: path of stream in storage tree (except root entry), either:

            - a string using Unix path syntax, for example:
              'storage_1/storage_1.2/stream'
            - or a list of storage filenames, path to the desired stream/storage.
              Example: ['storage_1', 'storage_1.2', 'stream']

        :returns: sid of requested filename
        :exception IOError: if file not found
        �/zfile not found)	rf�
basestring�splitrgrr.r'r�r)r�rir�r.r>s     r1�_findzOleFileIO._findAs���$�h�
�+�+�	+��~�~�c�*�*�H��y���	�	�D��y�
0�
0���8�>�>�#�#�t�z�z�|�|�3�3��E�4��.�/�/�/��D�D��x�r3c���|�|��}|j|}|jtkrt	d���|�|j|j��S)a;
        Open a stream as a read-only file object (BytesIO).
        Note: filename is case-insensitive.

        :param filename: path of stream in storage tree (except root entry), either:

            - a string using Unix path syntax, for example:
              'storage_1/storage_1.2/stream'
            - or a list of storage filenames, path to the desired stream/storage.
              Example: ['storage_1', 'storage_1.2', 'stream']

        :returns: file object (read-only)
        :exception IOError: if filename not found, or if this is not a stream.
        zthis file is not a stream)r�r%rrr�r�rr��r�rirrs    r1�
openstreamzOleFileIO.openstreamasW���j�j��"�"�����$����|�+�+��5�6�6�6��z�z�%�*�E�J�7�7�7r3c��|js|�|��t|j��}|jjs|j�|��|j|jz}t
|j��D]�\}}||z}||z}|jj|dz|jz||jzz}	||dz
kr|||jz|dz|jz�}
n|||jzd�}
|�|	|
����dS)Nr$)rrrdrgrir[�	enumerater�)r�r�
data_to_writer��
block_size�idxr��	sect_base�sect_offsetr��data_per_sectors           r1�_write_mini_streamzOleFileIO._write_mini_streamvs1����	)��"�"�4�(�(�(���)�*�*�
��y�#�	-��I�&�&�t�,�,�,��%��)>�>�
�"�5�#3�4�4�	;�	;�I�C���
�*�I���+�K��i�*�9�5��9�4�;K�K�k�Z^�Zo�No�o�F��j�1�n�%�%�"/��d�6K�0K�c�TU�g�Y]�Yn�Mn�0n�"o���"/��d�6K�0K�0L�0L�"M���!�!�&�/�:�:�:�:�	;�	;r3c	�8�t|t��std���|�|��}|j|}|jtkrtd���|j}|t|��krtd���||jkr'|jtkr|�
||���S|j}||jdz
z|jz}t �d|z��t%|��D]�}||dz
kr8|||jz|dz|jz�}	t|	��|jksJ�nr|||jzd�}	t �d||jt|	��||jzfz��t|	��|jz||jzksJ�|�||	��	|j|}��#t*$rtd	���wxYw|t,krtd
���dS)aD
        Write a stream to disk. For now, it is only possible to replace an
        existing stream by data of the same size.

        :param stream_name: path of stream in storage tree (except root entry), either:

            - a string using Unix path syntax, for example:
              'storage_1/storage_1.2/stream'
            - or a list of storage filenames, path to the desired stream/storage.
              Example: ['storage_1', 'storage_1.2', 'stream']

        :param data: bytes, data to be written, must be the same size as the original
            stream.
        z)write_stream: data must be a bytes stringzthis is not a streamz?write_stream: data must be the same size as the existing stream)rr�r$r�NzGwrite_stream: size=%d sectorsize=%d data_sector=%Xh size%%sectorsize=%dr�z)incorrect last sector index in OLE stream)rfrgr�r�r%rrr�r�rdr�rr
r�rr�r6r�r�r�r�r�r)
r��stream_namer�rrr�r�r�r"�data_sectors
          r1�write_streamzOleFileIO.write_stream�sR���$��&�&�	I��G�H�H�H��j�j��%�%�����$����|�+�+��0�1�1�1��z���3�t�9�9����^�_�_�_��$�'�'�'�E�,<�
�,J�,J��*�*�5�$�*�O�O�O�����d�o�a�/�0�T�_�D�
��	�	�#�j�0�1�1�1��z�"�"�	N�	N�A��*�Q�,���"�A�d�o�$5��1��d�o�8M�$M�N���;�'�'���8�8�8�8�8�"�A�d�o�$5�$6�$6�7���	�	�c��T�_�c�+�.>�.>��t��@V�W�X�Y�Y�Y��;�'�'�$�/�9�4�$�/�;Q�Q�Q�Q�Q��O�O�D�+�.�.�.�
N��x��~�����
N�
N�
N��L�M�M�M�
N�����:����E�F�F�F��s�
G#�#G=c�f�	|�|��}|j|}|jS#YdSxYw)a�
        Test if given filename exists as a stream or a storage in the OLE
        container, and return its type.

        :param filename: path of stream in storage tree. (see openstream for syntax)
        :returns: False if object does not exist, its entry type (>0) otherwise:

            - STGTY_STREAM: a stream
            - STGTY_STORAGE: a storage
            - STGTY_ROOT: the root entry
        F)r�r%rr�s    r1�get_typezOleFileIO.get_type�s=��	��*�*�X�&�&�C��O�C�(�E��#�#��	��5�5���s�(+�0c�T�|�|��}|j|}|jS)a
        Return clsid of a stream/storage.

        :param filename: path of stream/storage in storage tree. (see openstream for
            syntax)
        :returns: Empty string if clsid is null, a printable representation of the clsid otherwise

        new in version 0.44
        )r�r%r�r�s    r1�getclsidzOleFileIO.getclsid�s)���j�j��"�"�����$���{�r3c�n�|�|��}|j|}|���S)a9
        Return modification time of a stream/storage.

        :param filename: path of stream/storage in storage tree. (see openstream for
            syntax)
        :returns: None if modification time is null, a python datetime object
            otherwise (UTC timezone)

        new in version 0.26
        )r�r%r@r�s    r1r@zOleFileIO.getmtime��1���j�j��"�"�����$���~�~���r3c�n�|�|��}|j|}|���S)a1
        Return creation time of a stream/storage.

        :param filename: path of stream/storage in storage tree. (see openstream for
            syntax)
        :returns: None if creation time is null, a python datetime object
            otherwise (UTC timezone)

        new in version 0.26
        )r�r%rCr�s    r1rCzOleFileIO.getctime�r�r3c�B�	|�|��}dS#YdSxYw)a
        Test if given filename exists as a stream or a storage in the OLE
        container.
        Note: filename is case-insensitive.

        :param filename: path of stream in storage tree. (see openstream for syntax)
        :returns: True if object exist, else False.
        TF)r�)r�rirs   r1r�zOleFileIO.exists	s-��	��*�*�X�&�&�C��4��	��5�5���s��c��|�|��}|j|}|jtkrt	d���|jS)a2
        Return size of a stream in the OLE container, in bytes.

        :param filename: path of stream in storage tree (see openstream for syntax)
        :returns: size in bytes (long integer)
        :exception IOError: if file not found
        :exception TypeError: if this is not a stream.
        zobject is not an OLE stream)r�r%rrr�r�r�s    r1�get_sizezOleFileIO.get_sizesF���j�j��"�"�����$����|�+�+��9�:�:�:��z�r3c��|jjS)zp
        Return root entry name. Should usually be 'Root Entry' or 'R' in most
        implementations.
        )rgr.r�s r1�get_rootentry_namezOleFileIO.get_rootentry_name*s��
�y�~�r3c	�
�|dkrg}|}t|t��sd�|��}|�|��}i}	|�d��}t|dd���}|�d��}t|dd���}	|�t|d����d|�t|�d	����d	z
��z}t|d	��}
nW#t$rJ}d
t|���d|��}|�
t|t|����|cYd}~Sd}~wwxYwt|
tt|��dz����}
t!|
��D�]�}
d}	t|d|
dzz��}t|d
|
dzz��}t||��}t"�d|||fz��|t&kr t)||d	z��}|dkr|dz
}�n�|t*krt)||d	z��}�n�|t,t.t0fvrt||d	z��}�n�|t2t4fvrt||d	z��}�ny|t6t8fvrAt||d	z��}||dz|dz|zdz
�}|�dd��}�n(|t<kr(t||d	z��}||dz|dz|z�}�n�|t>kr>t||d	z��}|� ||dz|dz|dzz���}�n�|tBkr�tEt||d	z����tEt||dz����dzz}|r�||vr�t"�d||tG|��dzfz��tIj$dddddd��}t"�d|dzz��|tIj%|dz���z}n�|dz}n�|tLkrtO||d	z��}n�|tPkrt||d	z|dz���}n|tRkr't||d	z��}||dz|dz|z�}nM|tTkr!tWt)||d	z����}n!d}t"�d||fz��|||<��}#t$rI}d|t|��|fz}|�
t|t|����Yd}~���d}~wwxYw|S)a�
        Return properties described in substream.

        :param filename: path of stream in storage tree (see openstream for syntax)
        :param convert_time: bool, if True timestamps will be converted to Python datetime
        :param no_conversion: None or list of int, timestamps not to be converted
            (for example total editing time is not a real timestamp)

        :returns: a dictionary of values indexed by id (integer)
        Nr�rQr>rMrIrEs****r z0Error while parsing properties header in stream r�rrBz!property id=%d: type=%d offset=%Xi�ir$r�r3r:r�z8Converting property #%d to python datetime, value=%d=%fsi���r�ztimedelta days=%dl@�T$r@r�z5property id=%d: type=%d not implemented in parser yetz3Error while parsing property id %d in stream %s: %s),rfr�r�r�rar�rer�
BaseExceptionr�r�r�type�minrurdr�r6r��VT_I2r|�VT_UI2�VT_I4�VT_INT�VT_ERROR�VT_UI4�VT_UINT�VT_BSTR�VT_LPSTRrx�VT_BLOB�	VT_LPWSTRr�VT_FILETIMEr�floatr�r��VT_UI1rq�VT_CLSID�VT_CF�VT_BOOL�bool)r�rir�r��
streampathrkr�r�r��fmtid�	num_props�exc�msgr"�property_idr��
property_typer��countr�s                    r1r�zOleFileIO.getproperties2s����D� � ��M��
��*�c�*�*�	.����*�-�-�J�
�_�_�X�
&�
&����	�������A��1�Q�r�T�7�O�O�E�������A��1�S�b�S�6�N�N�E��G�G�C��2�J�J�����"�'�'�#�b�g�g�a�j�j�/�/�!�"3�4�4�4�A��A�q�	�	�I�I���	�	�	�	�
�Z� � � � �#�#�'�C����/��d�3�i�i�@�@�@��K�K�K�K�K�K�����	�����	�3�s�1�v�v��z�?�?�3�3�	��9�%�%�b	E�b	E�A��K�`
E�!�!�Q�q��s�U�m�m���Q��1�Q�3����� #�A�v���
��	�	�=��m�]c�@d�d�e�e�e�
!�E�)�)���6�!�8�,�,�E���~�~� %��
���"�f�,�,���6�!�8�,�,�E�E�"�u�f�h�&?�?�?� ��6�!�8�,�,�E�E�"�v�w�&7�7�7���6�!�8�,�,�E�E�"�w��&9�9�9�
 ��6�!�8�,�,�E��f�Q�h�v�a�x��~�a�'7�7�8�E�!�M�M�'�3�7�7�E�E�"�g�-�-� ��6�!�8�,�,�E��f�Q�h�v�a�x��~�5�6�E�E�"�i�/�/�
 ��6�!�8�,�,�E� �2�2�1�V�A�X�f�Q�h�u�Q�w�>N�5N�3O�P�P�E�E�"�k�1�1� ��Q��q��!1�!1�2�2�d�3�q�&��(�;K�;K�6L�6L�b�6P�Q�E�$�2��=�(H�(H��	�	�"\�"-�u�e�E�l�l�8�6K�!L�#M�N�N�N�/7�.?��a��A�q�RS�.T�.T�+��	�	�"5��AS�9T�"U�V�V�V� 3�h�6H�V[�]_�V_�6`�6`�6`� `���!&�� 1���"�f�,�,��q����{�O�O�E�E�"�h�.�.�"�1�V�A�X�f�R�i�%7�#8�9�9�E�E�"�e�+�+� ��6�!�8�,�,�E��f�Q�h�v�a�x��~�5�6�E�E�"�g�-�-�!��Q��q��!1�!1�2�2�E�E� �E��I�I�U�Yd�fs�Xt�t�u�u�u�%*��[�!�!�� �
E�
E�
E�L���j�!1�!1�3�O8�8���"�"�#3�S�$�s�)�)�D�D�D�D�D�D�D�D�����
E�����s8�
CD�
E(�?E#�E(�#E(�-M5T$�$
U7�.>U2�2U7c�j�t��|_|j�|��|jS)z�
        Parse standard properties streams, return an OleMetadata object
        containing all the available metadata.
        (also stored in the metadata attribute of the OleFileIO object)

        new in version 0.25
        )rrYr�r�s r1�get_metadatazOleFileIO.get_metadata�s-��$�
�
��
��
�&�&�t�,�,�,��}�r3)rx)FrD)r�)TF)FN),r�r�r�r�rrr�rmrqr�r�rrhrorr�r�r�r�r�rr�r�r�r�r&r�rr�r�r�r�r�r�r�r�r�r@rCr�r�r�r�rr8r3r1rr�s���������8!%�L�!��>S�J7�J7�J7�J7�Z������CJ�!�!�!�!�4����&]6�]6�]6�]6�@���,�,�,�,�4"�"�"�"�J����2	�	�	�!�!�!�HQ#�Q#�Q#�h"'�"'�"'�H���@����4����4&'�&'�&'�R$�$�$�4���#/�%�#-�#-�#-�#-�LB�B�B�B�:�������@8�8�8�*;�;�;�$;G�;G�;G�|���(���
 �
 �
 � 
 �
 �
 � 
�
�
� ���"���V�V�V�V�p
�
�
�
�
r3rc�F�ddl}ddl}d}tjtjtjtjtjd�}d}|�|���}|�	ddd	d
���|�	ddd
d���|�	dddd|d���|�
��\}}tdt�dt�d���t|��dkr7tt��|���|j��|jrd|_tj||jd���t+��|D�]5}	t-|��}	td��t|��td��|	���|	���D�]}
|
dddkr�td|
z��	|	�|
d� ��}t5|�����}|D]~\}}
t9|
t:t<f��rt|
��d!kr
|
dd!�}
t9|
t<��rd"D]}|t?|
��vrd#}
n�td$||
�����#t@�!d%|
z��Y��xYw��	|j"r�td&��|	���D]�}
td'tGd(�$|
����d'd�)��|	�%|
��}|tLkr;td*|	�'|
��z��|	�(|
����td+|z����t��td,��|	j)D]E}|�Atd-|j*�d.|�+���d/|�,�������Ft��	|	�-��}|�.��n!#t@�!d0��YnxYwt��|	�/��}td1|z��|	�0d2��rytd3��td4|	�%d2����td5|	�'d2����|	�0d6��rtd7��td8��|	j1r(|	j1D]\}}td-|j2�d9|����� ntd:����#t@�!d;|z��Y��4xYwdS)<z�
    Main function when olefile is runs as a script from the command line.
    This will open an OLE2 file and display its structure and properties
    :return: nothing
    rNrt)r��infortrs�criticalz1usage: %prog [options] <filename> [filename2 ...])�usagez-c�
store_true�
check_streamsz*check all streams (for debugging purposes))�action�dest�helpz-d�
debug_modez\debug mode, shortcut for -l debug (displays a lot of debug information, for developers only)z-lz
--loglevel�loglevel�storezBlogging level debug/info/warning/error/critical (default=%default))r'r&�defaultr(zolefile version r8z( - https://www.decalage.info/en/olefile
r�z%(levelname)-8s %(message)s)r/�formatzD--------------------------------------------------------------------����z%r: propertiesTr��2)r$r:r#r r;r<r=rArBrD�rErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTz
(binary data)z   z&Error while parsing property stream %rz
Checking streams...�-r�r9zsize %dzNOT a stream : type=%dz5Modification/Creation times of all directory entries:r�z: mtime=z ctime=zError while parsing metadatazRoot entry name: "%s"�worddocumentzThis is a Word document.ztype of stream 'WordDocument':zsize :z
macros/vbaz%This document may contain VBA macros.z(
Non-fatal issues raised during parsing:r��NonezError while parsing file %r)3r��optparser&r��INFO�WARNING�ERROR�CRITICAL�OptionParser�
add_option�
parse_argsr��__version__�__date__rdr��
print_help�exitr)r*�basicConfigrrr�r�r��sorted�itemsrfr�rgr�r6�	exceptionr%r�r�r�rr�r�r%r.r@rCrr�r�r�rKr�)r�r5�DEFAULT_LOG_LEVEL�
LOG_LEVELSr#�parser�optionsrprir��
streamnamer��k�vrp�st_typer�metarg�exctypers                     r1�mainrO�s����������!���M��L��O��M��$�
�
�J�
@�E�
�
"�
"��
"�
/�
/�F�
���d�<�o�
9��;�;�;�
���d�<�l�
k��m�m�m�
���d�L�z�'�Sd�!e��g�g�g��'�'�)�)�O�W�d�	�E�k�k�k�[c�[c�[c�
d�e�e�e��4�y�y�A�~�~�
�g�������������
�
�
���#�"�����j��)9�:�C`�a�a�a�a������RD�RD��Q	D��H�%�%�C��(�O�O�O��(�O�O�O��(�O�O�O�������!�k�k�m�m�
]�
]�
��b�>�!�$��.�.��*�Z�7�8�8�8�]� #� 1� 1�*�4� 1� P� P�� &�u�{�{�}�}� 5� 5��$)�/�/�D�A�q�)�!�j�%�-@�A�A�/�#&�q�6�6�B�;�;�()�#�2�#��A�)�!�U�3�3�.�*F�!.�!.�A�'(�I�a�L�L�'8�'8�,;��(-��(9�"�%��A�.�.�.�.�/��]��
�
�&N�Q[�&[�\�\�\�\�\����'/�*�$�

��-�.�.�.�"%�+�+�-�-�	B�	B�J��#�t�C�H�H�Z�$8�$8�9�9�#�3�G�G�G�G�!�l�l�:�6�6�G��,�.�.��i�#�,�,�z�*B�*B�B�C�C�C����z�2�2�2�2��6��@�A�A�A�A�����
�I�J�J�J���
=�
=���$��E�u�z�z�z����(�(�(�(�%�.�.�*:�*:�*:�<�=�=�=���G�G�G�
>��'�'�)�)���	�	������
>��
�
�<�=�=�=�=�=�����G�G�G��)�)�+�+�D��)�D�0�1�1�1��z�z�.�)�)�
C��0�1�1�1��6����^�8T�8T�U�U�U��h����^� <� <�=�=�=��:�:�l�+�+�C��A�B�B�B�
�=�>�>�>��!�
�$'�$6�@�@�L�G�S��E��(8�(8�(8�#�#�>�?�?�?�?�@��f�
�
�
���	D��M�M�7�(�B�C�C�C�C�C����eRD�RDs@�.BU<�:B9J4�3U<�4K�E
U<�!(Q
�	U<�
Q(�&DU<�<V�__main__rD)mr��
__future__rr>r=�
__author__�__all__r�r�rxr��os.pathr�r�r&r�rgrur�xranger�r��itemsizer�r�r��	NameErrorr
�version_inforr9r2r6rrrrrrrrrr	rrrrr
r�VT_EMPTY�VT_NULLrr�VT_R4�VT_R8�VT_CY�VT_DATEr�VT_DISPATCHrr�
VT_VARIANT�
VT_UNKNOWN�
VT_DECIMAL�VT_I1rrr	�VT_I8�VT_UI8rr
�VT_VOID�
VT_HRESULT�VT_PTR�VT_SAFEARRAY�	VT_CARRAY�VT_USERDEFINEDrrrr
�	VT_STREAM�
VT_STORAGE�VT_STREAMED_OBJECT�VT_STORED_OBJECT�VT_BLOB_OBJECTrr�	VT_VECTORrrrrrrrrqr|rr�r�rr�r�r�rrOr�r8r3r1�<module>rrs�����8&�%�%�%�%�%�x���� �
�����
�	�	�	�
�
�
�
�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�
�e����D���I�I����I�I�I�����5�;�s�����!�!�
�F�F��U�[�����!�#�#�
�F�F��U�[�����!�#�#��F�F�
�*�U�
V�
V�V�
��J�J�������J�J�J�����
����A�����#���!��
#�+�A�-�����8�j�����!�!�!�	,���
�
��
��
�
�
���	�
�����
��������
���
��A�G�Q�u�a��q���%��5�	��1�7�!�k�b�X�"�'�
�
�"�z��j�2�U�b�v�	��"�6�B�e�r��"�6�b�g�
��r�J�"�6�2�l��y���B�8�"�	�"�k�
��b�I�R�*�B�);���B�^�b��2�(�
�	�4�
��
�������
��
'�'�'�T	�C�<�<�����1�1�1�,�,�,�,�,�,�,�,�
*�
*�
*�"S�S�S�W4�W4�W4�W4�W4�W4�W4�W4�xP(�P(�P(�P(�P(��
�P(�P(�P(�l[2�[2�[2�[2�[2�[2�[2�[2�@	H�H�H�H�H�H�H�H�^(D�D�D�D�z����D�F�F�F�F�F��s�9�?�"B%�%B/�.B/

Youez - 2016 - github.com/yon3zu
LinuXploit