diff options
Diffstat (limited to '.venv/lib/python3.12/site-packages/olefile/doc')
13 files changed, 910 insertions, 0 deletions
diff --git a/.venv/lib/python3.12/site-packages/olefile/doc/API.html b/.venv/lib/python3.12/site-packages/olefile/doc/API.html new file mode 100644 index 00000000..633755eb --- /dev/null +++ b/.venv/lib/python3.12/site-packages/olefile/doc/API.html @@ -0,0 +1,164 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <meta name="generator" content="pandoc" />
+ <title></title>
+</head>
+<body>
+<h1 id="how-to-use-olefile---api">How to use olefile - API</h1>
+<p>This page is part of the documentation for <a href="https://bitbucket.org/decalage/olefileio_pl/wiki">olefile</a>. It explains how to use all its features to parse and write OLE files. For more information about OLE files, see <a href="OLE_Overview.html">OLE_Overview</a>.</p>
+<p>olefile can be used as an independent module or with PIL/Pillow. The main functions and methods are explained below.</p>
+<p>For more information, see also the file <strong>olefile.html</strong>, sample code at the end of the module itself, and docstrings within the code.</p>
+<h2 id="import-olefile">Import olefile</h2>
+<p>When the olefile package has been installed, it can be imported in Python applications with this statement:</p>
+<pre><code>import olefile</code></pre>
+<p>Before v0.40, olefile was named OleFileIO_PL. To maintain backward compatibility with older applications and samples, a simple script is also installed so that the following statement imports olefile as OleFileIO_PL:</p>
+<pre><code>import OleFileIO_PL</code></pre>
+<p>As of version 0.30, the code has been changed to be compatible with Python 3.x. As a consequence, compatibility with Python 2.5 or older is not provided anymore. However, a copy of OleFileIO_PL v0.26 (with some backported enhancements) is available as olefile2.py. When importing the olefile package, it falls back automatically to olefile2 if running on Python 2.5 or older. This is implemented in olefile/<strong>init</strong>.py. (new in v0.40)</p>
+<p>If you think olefile should stay compatible with Python 2.5 or older, please <a href="http://decalage.info/contact">contact me</a>.</p>
+<h2 id="test-if-a-file-is-an-ole-container">Test if a file is an OLE container</h2>
+<p>Use <strong>isOleFile</strong> to check if the first bytes of the file contain the Magic for OLE files, before opening it. isOleFile returns True if it is an OLE file, False otherwise (new in v0.16).</p>
+<pre><code>assert olefile.isOleFile('myfile.doc')</code></pre>
+<p>The argument of isOleFile can be (new in v0.41):</p>
+<ul>
+<li>the path of the file to open on disk (bytes or unicode string smaller than 1536 bytes),</li>
+<li>or a bytes string containing the file in memory. (bytes string longer than 1535 bytes),</li>
+<li>or a file-like object (with read and seek methods).</li>
+</ul>
+<h2 id="open-an-ole-file-from-disk">Open an OLE file from disk</h2>
+<p>Create an <strong>OleFileIO</strong> object with the file path as parameter:</p>
+<pre><code>ole = olefile.OleFileIO('myfile.doc')</code></pre>
+<h2 id="open-an-ole-file-from-a-bytes-string">Open an OLE file from a bytes string</h2>
+<p>This is useful if the file is already stored in memory as a bytes string.</p>
+<pre><code>ole = olefile.OleFileIO(s)</code></pre>
+<p>Note: olefile checks the size of the string provided as argument to determine if it is a file path or the content of an OLE file. An OLE file cannot be smaller than 1536 bytes. If the string is larger than 1535 bytes, then it is expected to contain an OLE file, otherwise it is expected to be a file path.</p>
+<p>(new in v0.41)</p>
+<h2 id="open-an-ole-file-from-a-file-like-object">Open an OLE file from a file-like object</h2>
+<p>This is useful if the file is not on disk but only available as a file-like object (with read, seek and tell methods).</p>
+<pre><code>ole = olefile.OleFileIO(f)</code></pre>
+<p>If the file-like object does not have seek or tell methods, the easiest solution is to read the file entirely in a bytes string before parsing:</p>
+<pre><code>data = f.read()
+ole = olefile.OleFileIO(data)</code></pre>
+<h2 id="how-to-handle-malformed-ole-files">How to handle malformed OLE files</h2>
+<p>By default, the parser is configured to be as robust and permissive as possible, allowing to parse most malformed OLE files. Only fatal errors will raise an exception. It is possible to tell the parser to be more strict in order to raise exceptions for files that do not fully conform to the OLE specifications, using the raise_defect option (new in v0.14):</p>
+<pre><code>ole = olefile.OleFileIO('myfile.doc', raise_defects=olefile.DEFECT_INCORRECT)</code></pre>
+<p>When the parsing is done, the list of non-fatal issues detected is available as a list in the parsing_issues attribute of the OleFileIO object (new in 0.25):</p>
+<pre><code>print('Non-fatal issues raised during parsing:')
+if ole.parsing_issues:
+ for exctype, msg in ole.parsing_issues:
+ print('- %s: %s' % (exctype.__name__, msg))
+else:
+ print('None')</code></pre>
+<h2 id="open-an-ole-file-in-write-mode">Open an OLE file in write mode</h2>
+<p>Before using the write features, the OLE file must be opened in read/write mode:</p>
+<pre><code>ole = olefile.OleFileIO('test.doc', write_mode=True)</code></pre>
+<p>(new in v0.40)</p>
+<p>The code for write features is new and it has not been thoroughly tested yet. See <a href="https://bitbucket.org/decalage/olefileio_pl/issue/6/improve-olefileio_pl-to-write-ole-files">issue #6</a> for the roadmap and the implementation status. If you encounter any issue, please send me your <a href="http://www.decalage.info/en/contact">feedback</a> or <a href="https://bitbucket.org/decalage/olefileio_pl/issues?status=new&status=open">report issues</a>.</p>
+<h2 id="syntax-for-stream-and-storage-paths">Syntax for stream and storage paths</h2>
+<p>Two different syntaxes are allowed for methods that need or return the path of streams and storages:</p>
+<ol style="list-style-type: decimal">
+<li><p>Either a <strong>list of strings</strong> including all the storages from the root up to the stream/storage name. For example a stream called "WordDocument" at the root will have ['WordDocument'] as full path. A stream called "ThisDocument" located in the storage "Macros/VBA" will be ['Macros', 'VBA', 'ThisDocument']. This is the original syntax from PIL. While hard to read and not very convenient, this syntax works in all cases.</p></li>
+<li><p>Or a <strong>single string with slashes</strong> to separate storage and stream names (similar to the Unix path syntax). The previous examples would be 'WordDocument' and 'Macros/VBA/ThisDocument'. This syntax is easier, but may fail if a stream or storage name contains a slash (which is normally not allowed, according to the Microsoft specifications [MS-CFB]). (new in v0.15)</p></li>
+</ol>
+<p>Both are case-insensitive.</p>
+<p>Switching between the two is easy:</p>
+<pre><code>slash_path = '/'.join(list_path)
+list_path = slash_path.split('/')</code></pre>
+<p><strong>Encoding</strong>:</p>
+<ul>
+<li>Stream and Storage names are stored in Unicode format in OLE files, which means they may contain special characters (e.g. Greek, Cyrillic, Japanese, etc) that applications must support to avoid exceptions.</li>
+<li><strong>On Python 2.x</strong>, all stream and storage paths are handled by olefile in bytes strings, using the <strong>UTF-8 encoding</strong> by default. If you need to use Unicode instead, add the option <strong>path_encoding=None</strong> when creating the OleFileIO object. This is new in v0.42. Olefile was using the Latin-1 encoding until v0.41, therefore special characters were not supported.<br /></li>
+<li><strong>On Python 3.x</strong>, all stream and storage paths are handled by olefile in unicode strings, without encoding.</li>
+</ul>
+<h2 id="get-the-list-of-streams">Get the list of streams</h2>
+<p>listdir() returns a list of all the streams contained in the OLE file, including those stored in storages. Each stream is listed itself as a list, as described above.</p>
+<pre><code>print(ole.listdir())</code></pre>
+<p>Sample result:</p>
+<pre><code>[['\x01CompObj'], ['\x05DocumentSummaryInformation'], ['\x05SummaryInformation']
+, ['1Table'], ['Macros', 'PROJECT'], ['Macros', 'PROJECTwm'], ['Macros', 'VBA',
+'Module1'], ['Macros', 'VBA', 'ThisDocument'], ['Macros', 'VBA', '_VBA_PROJECT']
+, ['Macros', 'VBA', 'dir'], ['ObjectPool'], ['WordDocument']]</code></pre>
+<p>As an option it is possible to choose if storages should also be listed, with or without streams (new in v0.26):</p>
+<pre><code>ole.listdir (streams=False, storages=True)</code></pre>
+<h2 id="test-if-known-streamsstorages-exist">Test if known streams/storages exist:</h2>
+<p>exists(path) checks if a given stream or storage exists in the OLE file (new in v0.16). The provided path is case-insensitive.</p>
+<pre><code>if ole.exists('worddocument'):
+ print("This is a Word document.")
+ if ole.exists('macros/vba'):
+ print("This document seems to contain VBA macros.")</code></pre>
+<h2 id="read-data-from-a-stream">Read data from a stream</h2>
+<p>openstream(path) opens a stream as a file-like object. The provided path is case-insensitive.</p>
+<p>The following example extracts the "Pictures" stream from a PPT file:</p>
+<pre><code>pics = ole.openstream('Pictures')
+data = pics.read()</code></pre>
+<h2 id="get-information-about-a-streamstorage">Get information about a stream/storage</h2>
+<p>Several methods can provide the size, type and timestamps of a given stream/storage:</p>
+<p>get_size(path) returns the size of a stream in bytes (new in v0.16):</p>
+<pre><code>s = ole.get_size('WordDocument')</code></pre>
+<p>get_type(path) returns the type of a stream/storage, as one of the following constants: STGTY_STREAM for a stream, STGTY_STORAGE for a storage, STGTY_ROOT for the root entry, and False for a non existing path (new in v0.15).</p>
+<pre><code>t = ole.get_type('WordDocument')</code></pre>
+<p>get_ctime(path) and get_mtime(path) return the creation and modification timestamps of a stream/storage, as a Python datetime object with UTC timezone. Please note that these timestamps are only present if the application that created the OLE file explicitly stored them, which is rarely the case. When not present, these methods return None (new in v0.26).</p>
+<pre><code>c = ole.get_ctime('WordDocument')
+m = ole.get_mtime('WordDocument')</code></pre>
+<p>The root storage is a special case: You can get its creation and modification timestamps using the OleFileIO.root attribute (new in v0.26):</p>
+<pre><code>c = ole.root.getctime()
+m = ole.root.getmtime()</code></pre>
+<p>Note: all these methods are case-insensitive.</p>
+<h2 id="overwriting-a-sector">Overwriting a sector</h2>
+<p>The write_sect method can overwrite any sector of the file. If the provided data is smaller than the sector size (normally 512 bytes, sometimes 4KB), data is padded with null characters. (new in v0.40)</p>
+<p>Here is an example:</p>
+<pre><code>ole.write_sect(0x17, b'TEST')</code></pre>
+<p>Note: following the <a href="http://msdn.microsoft.com/en-us/library/dd942138.aspx">MS-CFB specifications</a>, sector 0 is actually the second sector of the file. You may use -1 as index to write the first sector.</p>
+<h2 id="overwriting-a-stream">Overwriting a stream</h2>
+<p>The write_stream method can overwrite an existing stream in the file. The new stream data must be the exact same size as the existing one. For now, write_stream can only write streams of 4KB or larger (stored in the main FAT).</p>
+<p>For example, you may change text in a MS Word document:</p>
+<pre><code>ole = olefile.OleFileIO('test.doc', write_mode=True)
+data = ole.openstream('WordDocument').read()
+data = data.replace(b'foo', b'bar')
+ole.write_stream('WordDocument', data)
+ole.close()</code></pre>
+<p>(new in v0.40)</p>
+<h2 id="extract-metadata">Extract metadata</h2>
+<p>get_metadata() will check if standard property streams exist, parse all the properties they contain, and return an OleMetadata object with the found properties as attributes (new in v0.24).</p>
+<pre><code>meta = ole.get_metadata()
+print('Author:', meta.author)
+print('Title:', meta.title)
+print('Creation date:', meta.create_time)
+# print all metadata:
+meta.dump()</code></pre>
+<p>Available attributes include:</p>
+<pre><code>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</code></pre>
+<p>See the source code of the OleMetadata class for more information.</p>
+<h2 id="parse-a-property-stream">Parse a property stream</h2>
+<p>get_properties(path) can be used to parse any property stream that is not handled by get_metadata. It returns a dictionary indexed by integers. Each integer is the index of the property, pointing to its value. For example in the standard property stream '05SummaryInformation', the document title is property #2, and the subject is #3.</p>
+<pre><code>p = ole.getproperties('specialprops')</code></pre>
+<p>By default as in the original PIL version, timestamp properties are converted into a number of seconds since Jan 1,1601. With the option convert_time, you can obtain more convenient Python datetime objects (UTC timezone). If some time properties should not be converted (such as total editing time in '05SummaryInformation'), the list of indexes can be passed as no_conversion (new in v0.25):</p>
+<pre><code>p = ole.getproperties('specialprops', convert_time=True, no_conversion=[10])</code></pre>
+<h2 id="close-the-ole-file">Close the OLE file</h2>
+<p>Unless your application is a simple script that terminates after processing an OLE file, do not forget to close each OleFileIO object after parsing to close the file on disk. (new in v0.22)</p>
+<pre><code>ole.close()</code></pre>
+<h2 id="use-olefile-as-a-script-for-testingdebugging">Use olefile as a script for testing/debugging</h2>
+<p>olefile can also be used as a script from the command-line to display the structure of an OLE file and its metadata, for example:</p>
+<pre><code>olefile.py myfile.doc</code></pre>
+<p>You can use the option -c to check that all streams can be read fully, and -d to generate very verbose debugging information.</p>
+<hr />
+<h2 id="olefile-documentation">olefile documentation</h2>
+<ul>
+<li><a href="Home.html">Home</a></li>
+<li><a href="License.html">License</a></li>
+<li><a href="Install.html">Install</a></li>
+<li><a href="Contribute.html">Contribute</a>, Suggest Improvements or Report Issues</li>
+<li><a href="OLE_Overview.html">OLE_Overview</a></li>
+<li><a href="API.html">API</a> and Usage</li>
+</ul>
+</body>
+</html>
diff --git a/.venv/lib/python3.12/site-packages/olefile/doc/API.md b/.venv/lib/python3.12/site-packages/olefile/doc/API.md new file mode 100644 index 00000000..e4a96679 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/olefile/doc/API.md @@ -0,0 +1,313 @@ +How to use olefile - API
+========================
+
+This page is part of the documentation for [olefile](https://bitbucket.org/decalage/olefileio_pl/wiki). It explains
+how to use all its features to parse and write OLE files. For more information about OLE files, see [[OLE_Overview]].
+
+olefile can be used as an independent module or with PIL/Pillow. The main functions and methods are explained below.
+
+For more information, see also the file **olefile.html**, sample code at the end of the module itself, and docstrings within the code.
+
+
+
+Import olefile
+--------------
+
+When the olefile package has been installed, it can be imported in Python applications with this statement:
+
+ :::python
+ import olefile
+
+Before v0.40, olefile was named OleFileIO_PL. To maintain backward compatibility with older applications and samples, a
+simple script is also installed so that the following statement imports olefile as OleFileIO_PL:
+
+ :::python
+ import OleFileIO_PL
+
+As of version 0.30, the code has been changed to be compatible with Python 3.x. As a consequence, compatibility with
+Python 2.5 or older is not provided anymore. However, a copy of OleFileIO_PL v0.26 (with some backported enhancements)
+is available as olefile2.py. When importing the olefile package, it falls back automatically to olefile2 if running on
+Python 2.5 or older. This is implemented in olefile/__init__.py. (new in v0.40)
+
+If you think olefile should stay compatible with Python 2.5 or older, please [contact me](http://decalage.info/contact).
+
+
+## Test if a file is an OLE container
+
+Use **isOleFile** to check if the first bytes of the file contain the Magic for OLE files, before opening it. isOleFile
+returns True if it is an OLE file, False otherwise (new in v0.16).
+
+ :::python
+ assert olefile.isOleFile('myfile.doc')
+
+The argument of isOleFile can be (new in v0.41):
+
+- the path of the file to open on disk (bytes or unicode string smaller than 1536 bytes),
+- or a bytes string containing the file in memory. (bytes string longer than 1535 bytes),
+- or a file-like object (with read and seek methods).
+
+## Open an OLE file from disk
+
+Create an **OleFileIO** object with the file path as parameter:
+
+ :::python
+ ole = olefile.OleFileIO('myfile.doc')
+
+## Open an OLE file from a bytes string
+
+This is useful if the file is already stored in memory as a bytes string.
+
+ :::python
+ ole = olefile.OleFileIO(s)
+
+Note: olefile checks the size of the string provided as argument to determine if it is a file path or the content of an
+OLE file. An OLE file cannot be smaller than 1536 bytes. If the string is larger than 1535 bytes, then it is expected to
+contain an OLE file, otherwise it is expected to be a file path.
+
+(new in v0.41)
+
+
+## Open an OLE file from a file-like object
+
+This is useful if the file is not on disk but only available as a file-like object (with read, seek and tell methods).
+
+ :::python
+ ole = olefile.OleFileIO(f)
+
+If the file-like object does not have seek or tell methods, the easiest solution is to read the file entirely in
+a bytes string before parsing:
+
+ :::python
+ data = f.read()
+ ole = olefile.OleFileIO(data)
+
+
+## How to handle malformed OLE files
+
+By default, the parser is configured to be as robust and permissive as possible, allowing to parse most malformed OLE files. Only fatal errors will raise an exception. It is possible to tell the parser to be more strict in order to raise exceptions for files that do not fully conform to the OLE specifications, using the raise_defect option (new in v0.14):
+
+ :::python
+ ole = olefile.OleFileIO('myfile.doc', raise_defects=olefile.DEFECT_INCORRECT)
+
+When the parsing is done, the list of non-fatal issues detected is available as a list in the parsing_issues attribute of the OleFileIO object (new in 0.25):
+
+ :::python
+ print('Non-fatal issues raised during parsing:')
+ if ole.parsing_issues:
+ for exctype, msg in ole.parsing_issues:
+ print('- %s: %s' % (exctype.__name__, msg))
+ else:
+ print('None')
+
+
+## Open an OLE file in write mode
+
+Before using the write features, the OLE file must be opened in read/write mode:
+
+ :::python
+ ole = olefile.OleFileIO('test.doc', write_mode=True)
+
+(new in v0.40)
+
+The code for write features is new and it has not been thoroughly tested yet. See [issue #6](https://bitbucket.org/decalage/olefileio_pl/issue/6/improve-olefileio_pl-to-write-ole-files) for the roadmap and the implementation status. If you encounter any issue, please send me your [feedback](http://www.decalage.info/en/contact) or [report issues](https://bitbucket.org/decalage/olefileio_pl/issues?status=new&status=open).
+
+
+## Syntax for stream and storage paths
+
+Two different syntaxes are allowed for methods that need or return the path of streams and storages:
+
+1) Either a **list of strings** including all the storages from the root up to the stream/storage name. For example a
+stream called "WordDocument" at the root will have ['WordDocument'] as full path. A stream called "ThisDocument"
+located in the storage "Macros/VBA" will be ['Macros', 'VBA', 'ThisDocument']. This is the original syntax from PIL.
+While hard to read and not very convenient, this syntax works in all cases.
+
+2) Or a **single string with slashes** to separate storage and stream names (similar to the Unix path syntax).
+The previous examples would be 'WordDocument' and 'Macros/VBA/ThisDocument'. This syntax is easier, but may fail if a
+stream or storage name contains a slash (which is normally not allowed, according to the Microsoft specifications [MS-CFB]). (new in v0.15)
+
+Both are case-insensitive.
+
+Switching between the two is easy:
+
+ :::python
+ slash_path = '/'.join(list_path)
+ list_path = slash_path.split('/')
+
+**Encoding**:
+
+- Stream and Storage names are stored in Unicode format in OLE files, which means they may contain special characters
+ (e.g. Greek, Cyrillic, Japanese, etc) that applications must support to avoid exceptions.
+- **On Python 2.x**, all stream and storage paths are handled by olefile in bytes strings, using the **UTF-8 encoding**
+ by default. If you need to use Unicode instead, add the option **path_encoding=None** when creating the OleFileIO
+ object. This is new in v0.42. Olefile was using the Latin-1 encoding until v0.41, therefore special characters were
+ not supported.
+- **On Python 3.x**, all stream and storage paths are handled by olefile in unicode strings, without encoding.
+
+## Get the list of streams
+
+listdir() returns a list of all the streams contained in the OLE file, including those stored in storages.
+Each stream is listed itself as a list, as described above.
+
+ :::python
+ print(ole.listdir())
+
+Sample result:
+
+ :::python
+ [['\x01CompObj'], ['\x05DocumentSummaryInformation'], ['\x05SummaryInformation']
+ , ['1Table'], ['Macros', 'PROJECT'], ['Macros', 'PROJECTwm'], ['Macros', 'VBA',
+ 'Module1'], ['Macros', 'VBA', 'ThisDocument'], ['Macros', 'VBA', '_VBA_PROJECT']
+ , ['Macros', 'VBA', 'dir'], ['ObjectPool'], ['WordDocument']]
+
+As an option it is possible to choose if storages should also be listed, with or without streams (new in v0.26):
+
+ :::python
+ ole.listdir (streams=False, storages=True)
+
+
+## Test if known streams/storages exist:
+
+exists(path) checks if a given stream or storage exists in the OLE file (new in v0.16). The provided path is case-insensitive.
+
+ :::python
+ if ole.exists('worddocument'):
+ print("This is a Word document.")
+ if ole.exists('macros/vba'):
+ print("This document seems to contain VBA macros.")
+
+
+## Read data from a stream
+
+openstream(path) opens a stream as a file-like object. The provided path is case-insensitive.
+
+The following example extracts the "Pictures" stream from a PPT file:
+
+ :::python
+ pics = ole.openstream('Pictures')
+ data = pics.read()
+
+
+## Get information about a stream/storage
+
+Several methods can provide the size, type and timestamps of a given stream/storage:
+
+get_size(path) returns the size of a stream in bytes (new in v0.16):
+
+ :::python
+ s = ole.get_size('WordDocument')
+
+get_type(path) returns the type of a stream/storage, as one of the following constants: STGTY\_STREAM for a stream, STGTY\_STORAGE for a storage, STGTY\_ROOT for the root entry, and False for a non existing path (new in v0.15).
+
+ :::python
+ t = ole.get_type('WordDocument')
+
+get\_ctime(path) and get\_mtime(path) return the creation and modification timestamps of a stream/storage, as a Python datetime object with UTC timezone. Please note that these timestamps are only present if the application that created the OLE file explicitly stored them, which is rarely the case. When not present, these methods return None (new in v0.26).
+
+ :::python
+ c = ole.get_ctime('WordDocument')
+ m = ole.get_mtime('WordDocument')
+
+The root storage is a special case: You can get its creation and modification timestamps using the OleFileIO.root attribute (new in v0.26):
+
+ :::python
+ c = ole.root.getctime()
+ m = ole.root.getmtime()
+
+Note: all these methods are case-insensitive.
+
+## Overwriting a sector
+
+The write_sect method can overwrite any sector of the file. If the provided data is smaller than the sector size (normally 512 bytes, sometimes 4KB), data is padded with null characters. (new in v0.40)
+
+Here is an example:
+
+ :::python
+ ole.write_sect(0x17, b'TEST')
+
+Note: following the [MS-CFB specifications](http://msdn.microsoft.com/en-us/library/dd942138.aspx), sector 0 is actually the second sector of the file. You may use -1 as index to write the first sector.
+
+
+## Overwriting a stream
+
+The write_stream method can overwrite an existing stream in the file. The new stream data must be the exact same size as the existing one. For now, write_stream can only write streams of 4KB or larger (stored in the main FAT).
+
+For example, you may change text in a MS Word document:
+
+ :::python
+ ole = olefile.OleFileIO('test.doc', write_mode=True)
+ data = ole.openstream('WordDocument').read()
+ data = data.replace(b'foo', b'bar')
+ ole.write_stream('WordDocument', data)
+ ole.close()
+
+(new in v0.40)
+
+
+
+## Extract metadata
+
+get_metadata() will check if standard property streams exist, parse all the properties they contain, and return an OleMetadata object with the found properties as attributes (new in v0.24).
+
+ :::python
+ meta = ole.get_metadata()
+ print('Author:', meta.author)
+ print('Title:', meta.title)
+ print('Creation date:', meta.create_time)
+ # print all metadata:
+ meta.dump()
+
+Available attributes include:
+
+ :::text
+ 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
+
+See the source code of the OleMetadata class for more information.
+
+
+## Parse a property stream
+
+get\_properties(path) can be used to parse any property stream that is not handled by get\_metadata. It returns a dictionary indexed by integers. Each integer is the index of the property, pointing to its value. For example in the standard property stream '\x05SummaryInformation', the document title is property #2, and the subject is #3.
+
+ :::python
+ p = ole.getproperties('specialprops')
+
+By default as in the original PIL version, timestamp properties are converted into a number of seconds since Jan 1,1601. With the option convert\_time, you can obtain more convenient Python datetime objects (UTC timezone). If some time properties should not be converted (such as total editing time in '\x05SummaryInformation'), the list of indexes can be passed as no_conversion (new in v0.25):
+
+ :::python
+ p = ole.getproperties('specialprops', convert_time=True, no_conversion=[10])
+
+
+## Close the OLE file
+
+Unless your application is a simple script that terminates after processing an OLE file, do not forget to close each OleFileIO object after parsing to close the file on disk. (new in v0.22)
+
+ :::python
+ ole.close()
+
+## Use olefile as a script for testing/debugging
+
+olefile can also be used as a script from the command-line to display the structure of an OLE file and its metadata, for example:
+
+ :::text
+ olefile.py myfile.doc
+
+You can use the option -c to check that all streams can be read fully, and -d to generate very verbose debugging information.
+
+--------------------------------------------------------------------------
+
+olefile documentation
+---------------------
+
+- [[Home]]
+- [[License]]
+- [[Install]]
+- [[Contribute]], Suggest Improvements or Report Issues
+- [[OLE_Overview]]
+- [[API]] and Usage
diff --git a/.venv/lib/python3.12/site-packages/olefile/doc/Contribute.html b/.venv/lib/python3.12/site-packages/olefile/doc/Contribute.html new file mode 100644 index 00000000..2ae57ca8 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/olefile/doc/Contribute.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <meta name="generator" content="pandoc" />
+ <title></title>
+</head>
+<body>
+<h1 id="how-to-suggest-improvements-report-issues-or-contribute">How to Suggest Improvements, Report Issues or Contribute</h1>
+<p>This is a personal open-source project, developed on my spare time. Any contribution, suggestion, feedback or bug report is welcome.</p>
+<p>To <strong>suggest improvements, report a bug or any issue</strong>, please use the <a href="https://bitbucket.org/decalage/olefileio_pl/issues?status=new&status=open">issue reporting page</a>, providing all the information and files to reproduce the problem.</p>
+<p>If possible please join the debugging output of olefile. For this, launch the following command :</p>
+<pre><code> olefile.py -d -c file >debug.txt </code></pre>
+<p>You may also <a href="http://decalage.info/contact">contact the author</a> directly to <strong>provide feedback</strong>.</p>
+<p>The code is available in <a href="https://bitbucket.org/decalage/olefileio_pl">a Mercurial repository on Bitbucket</a>. You may use it to <strong>submit enhancements</strong> using forks and pull requests.</p>
+<hr />
+<h2 id="olefile-documentation">olefile documentation</h2>
+<ul>
+<li><a href="Home.html">Home</a></li>
+<li><a href="License.html">License</a></li>
+<li><a href="Install.html">Install</a></li>
+<li><a href="Contribute.html">Contribute</a>, Suggest Improvements or Report Issues</li>
+<li><a href="OLE_Overview.html">OLE_Overview</a></li>
+<li><a href="API.html">API</a> and Usage</li>
+</ul>
+</body>
+</html>
diff --git a/.venv/lib/python3.12/site-packages/olefile/doc/Contribute.md b/.venv/lib/python3.12/site-packages/olefile/doc/Contribute.md new file mode 100644 index 00000000..0de1e4b8 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/olefile/doc/Contribute.md @@ -0,0 +1,28 @@ +How to Suggest Improvements, Report Issues or Contribute
+========================================================
+
+This is a personal open-source project, developed on my spare time. Any contribution, suggestion, feedback or bug report is welcome.
+
+To **suggest improvements, report a bug or any issue**, please use the [issue reporting page](https://bitbucket.org/decalage/olefileio_pl/issues?status=new&status=open), providing all the information and files to reproduce the problem.
+
+If possible please join the debugging output of olefile. For this, launch the following command :
+
+ :::text
+ olefile.py -d -c file >debug.txt
+
+
+You may also [contact the author](http://decalage.info/contact) directly to **provide feedback**.
+
+The code is available in [a Mercurial repository on Bitbucket](https://bitbucket.org/decalage/olefileio_pl). You may use it to **submit enhancements** using forks and pull requests.
+
+--------------------------------------------------------------------------
+
+olefile documentation
+---------------------
+
+- [[Home]]
+- [[License]]
+- [[Install]]
+- [[Contribute]], Suggest Improvements or Report Issues
+- [[OLE_Overview]]
+- [[API]] and Usage
diff --git a/.venv/lib/python3.12/site-packages/olefile/doc/Home.html b/.venv/lib/python3.12/site-packages/olefile/doc/Home.html new file mode 100644 index 00000000..57e734d7 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/olefile/doc/Home.html @@ -0,0 +1,62 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <meta name="generator" content="pandoc" />
+ <title></title>
+</head>
+<body>
+<h1 id="olefile-v0.42-documentation">olefile v0.42 documentation</h1>
+<p>This is the home page of the documentation for olefile. The latest version can be found <a href="https://bitbucket.org/decalage/olefileio_pl/wiki">online</a>, otherwise a copy is provided in the doc subfolder of the package.</p>
+<p><a href="http://www.decalage.info/olefile">olefile</a> is a Python package to parse, read and write <a href="http://en.wikipedia.org/wiki/Compound_File_Binary_Format">Microsoft OLE2 files</a> (also called Structured Storage, Compound File Binary Format or Compound Document File Format), such as Microsoft Office 97-2003 documents, Image Composer and FlashPix files, Outlook messages, StickyNotes, several Microscopy file formats, McAfee antivirus quarantine files, etc.</p>
+<p><strong>Quick links:</strong> <a href="http://www.decalage.info/olefile">Home page</a> - <a href="https://bitbucket.org/decalage/olefileio_pl/wiki/Install">Download/Install</a> - <a href="https://bitbucket.org/decalage/olefileio_pl/wiki">Documentation</a> - <a href="https://bitbucket.org/decalage/olefileio_pl/issues?status=new&status=open">Report Issues/Suggestions/Questions</a> - <a href="http://decalage.info/contact">Contact the author</a> - <a href="https://bitbucket.org/decalage/olefileio_pl">Repository</a> - <a href="https://twitter.com/decalage2">Updates on Twitter</a></p>
+<h2 id="documentation-pages">Documentation pages</h2>
+<ul>
+<li><a href="License.html">License</a></li>
+<li><a href="Install.html">Install</a></li>
+<li><a href="Contribute.html">Contribute</a>, Suggest Improvements or Report Issues</li>
+<li><a href="OLE_Overview.html">OLE_Overview</a></li>
+<li><a href="API.html">API</a> and Usage</li>
+</ul>
+<h2 id="features">Features</h2>
+<ul>
+<li>Parse, read and write any OLE file such as Microsoft Office 97-2003 legacy document formats (Word .doc, Excel .xls, PowerPoint .ppt, Visio .vsd, Project .mpp), Image Composer and FlashPix files, Outlook messages, StickyNotes, Zeiss AxioVision ZVI files, Olympus FluoView OIB files, etc</li>
+<li>List all the streams and storages contained in an OLE file</li>
+<li>Open streams as files</li>
+<li>Parse and read property streams, containing metadata of the file</li>
+<li>Portable, pure Python module, no dependency</li>
+</ul>
+<p>olefile can be used as an independent module or with PIL/Pillow.</p>
+<p>olefile is mostly meant for developers. If you are looking for tools to analyze OLE files or to extract data (especially for security purposes such as malware analysis and forensics), then please also check my <a href="http://www.decalage.info/python/oletools">python-oletools</a>, which are built upon olefile and provide a higher-level interface.</p>
+<h2 id="history">History</h2>
+<p>olefile is based on the OleFileIO module from <a href="http://www.pythonware.com/products/pil/index.htm">PIL</a>, the excellent Python Imaging Library, created and maintained by Fredrik Lundh. The olefile API is still compatible with PIL, but since 2005 I have improved the internal implementation significantly, with new features, bugfixes and a more robust design. From 2005 to 2014 the project was called OleFileIO_PL, and in 2014 I changed its name to olefile to celebrate its 9 years and its new write features.</p>
+<p>As far as I know, this module is the most complete and robust Python implementation to read MS OLE2 files, portable on several operating systems. (please tell me if you know other similar Python modules)</p>
+<p>Since 2014 olefile/OleFileIO_PL has been integrated into <a href="http://python-imaging.github.io/">Pillow</a>, the friendly fork of PIL. olefile will continue to be improved as a separate project, and new versions will be merged into Pillow regularly.</p>
+<h2 id="main-improvements-over-the-original-version-of-olefileio-in-pil">Main improvements over the original version of OleFileIO in PIL:</h2>
+<ul>
+<li>Compatible with Python 3.x and 2.6+</li>
+<li>Many bug fixes</li>
+<li>Support for files larger than 6.8MB</li>
+<li>Support for 64 bits platforms and big-endian CPUs</li>
+<li>Robust: many checks to detect malformed files</li>
+<li>Runtime option to choose if malformed files should be parsed or raise exceptions</li>
+<li>Improved API</li>
+<li>Metadata extraction, stream/storage timestamps (e.g. for document forensics)</li>
+<li>Can open file-like objects</li>
+<li>Added setup.py and install.bat to ease installation</li>
+<li>More convenient slash-based syntax for stream paths</li>
+<li>Write features</li>
+</ul>
+<hr />
+<h2 id="olefile-documentation">olefile documentation</h2>
+<ul>
+<li><a href="Home.html">Home</a></li>
+<li><a href="License.html">License</a></li>
+<li><a href="Install.html">Install</a></li>
+<li><a href="Contribute.html">Contribute</a>, Suggest Improvements or Report Issues</li>
+<li><a href="OLE_Overview.html">OLE_Overview</a></li>
+<li><a href="API.html">API</a> and Usage</li>
+</ul>
+</body>
+</html>
diff --git a/.venv/lib/python3.12/site-packages/olefile/doc/Home.md b/.venv/lib/python3.12/site-packages/olefile/doc/Home.md new file mode 100644 index 00000000..4f22e554 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/olefile/doc/Home.md @@ -0,0 +1,94 @@ +olefile v0.42 documentation
+===========================
+
+This is the home page of the documentation for olefile. The latest version can be found
+[online](https://bitbucket.org/decalage/olefileio_pl/wiki), otherwise a copy is provided in the doc subfolder of the package.
+
+[olefile](http://www.decalage.info/olefile) is a Python package to parse, read and write
+[Microsoft OLE2 files](http://en.wikipedia.org/wiki/Compound_File_Binary_Format)
+(also called Structured Storage, Compound File Binary Format or Compound Document File Format), such as Microsoft
+Office 97-2003 documents, Image Composer and FlashPix files, Outlook messages, StickyNotes, several Microscopy file
+formats, McAfee antivirus quarantine files, etc.
+
+
+**Quick links:**
+[Home page](http://www.decalage.info/olefile) -
+[Download/Install](https://bitbucket.org/decalage/olefileio_pl/wiki/Install) -
+[Documentation](https://bitbucket.org/decalage/olefileio_pl/wiki) -
+[Report Issues/Suggestions/Questions](https://bitbucket.org/decalage/olefileio_pl/issues?status=new&status=open) -
+[Contact the author](http://decalage.info/contact) -
+[Repository](https://bitbucket.org/decalage/olefileio_pl) -
+[Updates on Twitter](https://twitter.com/decalage2)
+
+Documentation pages
+-------------------
+
+- [[License]]
+- [[Install]]
+- [[Contribute]], Suggest Improvements or Report Issues
+- [[OLE_Overview]]
+- [[API]] and Usage
+
+
+Features
+--------
+
+- Parse, read and write any OLE file such as Microsoft Office 97-2003 legacy document formats (Word .doc, Excel .xls,
+ PowerPoint .ppt, Visio .vsd, Project .mpp), Image Composer and FlashPix files, Outlook messages, StickyNotes, Zeiss
+ AxioVision ZVI files, Olympus FluoView OIB files, etc
+- List all the streams and storages contained in an OLE file
+- Open streams as files
+- Parse and read property streams, containing metadata of the file
+- Portable, pure Python module, no dependency
+
+olefile can be used as an independent module or with PIL/Pillow.
+
+olefile is mostly meant for developers. If you are looking for tools to analyze OLE files or to extract data
+(especially for security purposes such as malware analysis and forensics), then please also check my
+[python-oletools](http://www.decalage.info/python/oletools), which are built upon olefile and provide a higher-level
+interface.
+
+
+History
+-------
+
+olefile is based on the OleFileIO module from [PIL](http://www.pythonware.com/products/pil/index.htm), the excellent
+Python Imaging Library, created and maintained by Fredrik Lundh. The olefile API is still compatible with PIL, but
+since 2005 I have improved the internal implementation significantly, with new features, bugfixes and a more robust
+design. From 2005 to 2014 the project was called OleFileIO_PL, and in 2014 I changed its name to olefile to celebrate
+its 9 years and its new write features.
+
+As far as I know, this module is the most complete and robust Python implementation to read MS OLE2 files, portable on
+several operating systems. (please tell me if you know other similar Python modules)
+
+Since 2014 olefile/OleFileIO_PL has been integrated into [Pillow](http://python-imaging.github.io/), the friendly fork
+of PIL. olefile will continue to be improved as a separate project, and new versions will be merged into Pillow regularly.
+
+Main improvements over the original version of OleFileIO in PIL:
+----------------------------------------------------------------
+
+- Compatible with Python 3.x and 2.6+
+- Many bug fixes
+- Support for files larger than 6.8MB
+- Support for 64 bits platforms and big-endian CPUs
+- Robust: many checks to detect malformed files
+- Runtime option to choose if malformed files should be parsed or raise exceptions
+- Improved API
+- Metadata extraction, stream/storage timestamps (e.g. for document forensics)
+- Can open file-like objects
+- Added setup.py and install.bat to ease installation
+- More convenient slash-based syntax for stream paths
+- Write features
+
+
+--------------------------------------------------------------------------
+
+olefile documentation
+---------------------
+
+- [[Home]]
+- [[License]]
+- [[Install]]
+- [[Contribute]], Suggest Improvements or Report Issues
+- [[OLE_Overview]]
+- [[API]] and Usage
diff --git a/.venv/lib/python3.12/site-packages/olefile/doc/Install.html b/.venv/lib/python3.12/site-packages/olefile/doc/Install.html new file mode 100644 index 00000000..1560a942 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/olefile/doc/Install.html @@ -0,0 +1,30 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <meta name="generator" content="pandoc" />
+ <title></title>
+</head>
+<body>
+<h1 id="how-to-download-and-install-olefile">How to Download and Install olefile</h1>
+<h2 id="pre-requisites">Pre-requisites</h2>
+<p>olefile requires Python 2.6, 2.7 or 3.x.</p>
+<p>For Python 2.5 and older, olefile falls back to an older version (based on OleFileIO_PL 0.26) which might not contain all the enhancements implemented in olefile.</p>
+<h2 id="download-and-install">Download and Install</h2>
+<p>To use olefile with other Python applications or your own scripts, the simplest solution is to run <strong>pip install olefile</strong> or <strong>easy_install olefile</strong>, to download and install the package in one go. Pip is part of the standard Python distribution since v2.7.9.</p>
+<p>To update olefile if a previous version is already installed, run <strong>pip install -U olefile</strong>.</p>
+<p>Otherwise you may download/extract the <a href="https://bitbucket.org/decalage/olefileio_pl/downloads">zip archive</a> in a temporary directory and run <strong>python setup.py install</strong>.</p>
+<p>On Windows you may simply double-click on <strong>install.bat</strong>.</p>
+<hr />
+<h2 id="olefile-documentation">olefile documentation</h2>
+<ul>
+<li><a href="Home.html">Home</a></li>
+<li><a href="License.html">License</a></li>
+<li><a href="Install.html">Install</a></li>
+<li><a href="Contribute.html">Contribute</a>, Suggest Improvements or Report Issues</li>
+<li><a href="OLE_Overview.html">OLE_Overview</a></li>
+<li><a href="API.html">API</a> and Usage</li>
+</ul>
+</body>
+</html>
diff --git a/.venv/lib/python3.12/site-packages/olefile/doc/Install.md b/.venv/lib/python3.12/site-packages/olefile/doc/Install.md new file mode 100644 index 00000000..6afa6245 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/olefile/doc/Install.md @@ -0,0 +1,37 @@ +How to Download and Install olefile
+===================================
+
+Pre-requisites
+--------------
+
+olefile requires Python 2.6, 2.7 or 3.x.
+
+For Python 2.5 and older, olefile falls back to an older version (based on OleFileIO_PL 0.26) which might not contain
+all the enhancements implemented in olefile.
+
+
+Download and Install
+--------------------
+
+To use olefile with other Python applications or your own scripts, the simplest solution is to run **pip install olefile**
+or **easy_install olefile**, to download and install the package in one go. Pip is part of the standard Python
+distribution since v2.7.9.
+
+To update olefile if a previous version is already installed, run **pip install -U olefile**.
+
+Otherwise you may download/extract the [zip archive](https://bitbucket.org/decalage/olefileio_pl/downloads) in a
+temporary directory and run **python setup.py install**.
+
+On Windows you may simply double-click on **install.bat**.
+
+--------------------------------------------------------------------------
+
+olefile documentation
+---------------------
+
+- [[Home]]
+- [[License]]
+- [[Install]]
+- [[Contribute]], Suggest Improvements or Report Issues
+- [[OLE_Overview]]
+- [[API]] and Usage
diff --git a/.venv/lib/python3.12/site-packages/olefile/doc/License.html b/.venv/lib/python3.12/site-packages/olefile/doc/License.html new file mode 100644 index 00000000..f83c512d --- /dev/null +++ b/.venv/lib/python3.12/site-packages/olefile/doc/License.html @@ -0,0 +1,40 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <meta name="generator" content="pandoc" />
+ <title></title>
+</head>
+<body>
+<h1 id="license-for-olefile">License for olefile</h1>
+<p>olefile (formerly OleFileIO_PL) is copyright (c) 2005-2015 Philippe Lagadec (<a href="http://www.decalage.info">http://www.decalage.info</a>)</p>
+<p>All rights reserved.</p>
+<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
+<ul>
+<li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li>
+<li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</li>
+</ul>
+<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
+<hr />
+<p>olefile is based on source code from the OleFileIO module of the Python Imaging Library (PIL) published by Fredrik Lundh under the following license:</p>
+<p>The Python Imaging Library (PIL) is</p>
+<ul>
+<li>Copyright (c) 1997-2005 by Secret Labs AB</li>
+<li>Copyright (c) 1995-2005 by Fredrik Lundh</li>
+</ul>
+<p>By obtaining, using, and/or copying this software and/or its associated documentation, you agree that you have read, understood, and will comply with the following terms and conditions:</p>
+<p>Permission to use, copy, modify, and distribute this software and its associated documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appears in all copies, and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Secret Labs AB or the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.</p>
+<p>SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</p>
+<hr />
+<h2 id="olefile-documentation">olefile documentation</h2>
+<ul>
+<li><a href="Home.html">Home</a></li>
+<li><a href="License.html">License</a></li>
+<li><a href="Install.html">Install</a></li>
+<li><a href="Contribute.html">Contribute</a>, Suggest Improvements or Report Issues</li>
+<li><a href="OLE_Overview.html">OLE_Overview</a></li>
+<li><a href="API.html">API</a> and Usage</li>
+</ul>
+</body>
+</html>
diff --git a/.venv/lib/python3.12/site-packages/olefile/doc/License.md b/.venv/lib/python3.12/site-packages/olefile/doc/License.md new file mode 100644 index 00000000..28bc4c13 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/olefile/doc/License.md @@ -0,0 +1,54 @@ +License for olefile
+===================
+
+olefile (formerly OleFileIO_PL) is copyright (c) 2005-2015 Philippe Lagadec ([http://www.decalage.info](http://www.decalage.info))
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+----------
+
+olefile is based on source code from the OleFileIO module of the Python Imaging Library (PIL) published by Fredrik Lundh under the following license:
+
+The Python Imaging Library (PIL) is
+
+- Copyright (c) 1997-2005 by Secret Labs AB
+- Copyright (c) 1995-2005 by Fredrik Lundh
+
+By obtaining, using, and/or copying this software and/or its associated documentation, you agree that you have read, understood, and will comply with the following terms and conditions:
+
+Permission to use, copy, modify, and distribute this software and its associated documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appears in all copies, and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Secret Labs AB or the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.
+
+SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+--------------------------------------------------------------------------
+
+olefile documentation
+---------------------
+
+- [[Home]]
+- [[License]]
+- [[Install]]
+- [[Contribute]], Suggest Improvements or Report Issues
+- [[OLE_Overview]]
+- [[API]] and Usage
diff --git a/.venv/lib/python3.12/site-packages/olefile/doc/OLE_Overview.html b/.venv/lib/python3.12/site-packages/olefile/doc/OLE_Overview.html new file mode 100644 index 00000000..ed481201 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/olefile/doc/OLE_Overview.html @@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <meta name="generator" content="pandoc" />
+ <title></title>
+</head>
+<body>
+<h1 id="about-the-structure-of-ole-files">About the structure of OLE files</h1>
+<p>This page is part of the documentation for <a href="https://bitbucket.org/decalage/olefileio_pl/wiki">olefile</a>. It provides a brief overview of the structure of <a href="http://en.wikipedia.org/wiki/Compound_File_Binary_Format">Microsoft OLE2 files (also called Structured Storage, Compound File Binary Format or Compound Document File Format)</a>, such as Microsoft Office 97-2003 documents, Image Composer and FlashPix files, Outlook messages, StickyNotes, several Microscopy file formats, McAfee antivirus quarantine files, etc.</p>
+<p>An OLE file can be seen as a mini file system or a Zip archive: It contains <strong>streams</strong> of data that look like files embedded within the OLE file. Each stream has a name. For example, the main stream of a MS Word document containing its text is named "WordDocument".</p>
+<p>An OLE file can also contain <strong>storages</strong>. A storage is a folder that contains streams or other storages. For example, a MS Word document with VBA macros has a storage called "Macros".</p>
+<p>Special streams can contain <strong>properties</strong>. A property is a specific value that can be used to store information such as the metadata of a document (title, author, creation date, etc). Property stream names usually start with the character '05'.</p>
+<p>For example, a typical MS Word document may look like this:</p>
+<div class="figure">
+<img src="OLE_VBA_sample.png" /><p class="caption"></p>
+</div>
+<p>Go to the <a href="API.html">API</a> page to see how to use all olefile features to parse OLE files.</p>
+<hr />
+<h2 id="olefile-documentation">olefile documentation</h2>
+<ul>
+<li><a href="Home.html">Home</a></li>
+<li><a href="License.html">License</a></li>
+<li><a href="Install.html">Install</a></li>
+<li><a href="Contribute.html">Contribute</a>, Suggest Improvements or Report Issues</li>
+<li><a href="OLE_Overview.html">OLE_Overview</a></li>
+<li><a href="API.html">API</a> and Usage</li>
+</ul>
+</body>
+</html>
diff --git a/.venv/lib/python3.12/site-packages/olefile/doc/OLE_Overview.md b/.venv/lib/python3.12/site-packages/olefile/doc/OLE_Overview.md new file mode 100644 index 00000000..db7fa668 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/olefile/doc/OLE_Overview.md @@ -0,0 +1,29 @@ +About the structure of OLE files
+================================
+
+This page is part of the documentation for [olefile](https://bitbucket.org/decalage/olefileio_pl/wiki). It provides a brief overview of the structure of [Microsoft OLE2 files (also called Structured Storage, Compound File Binary Format or Compound Document File Format)](http://en.wikipedia.org/wiki/Compound_File_Binary_Format), such as Microsoft Office 97-2003 documents, Image Composer and FlashPix files, Outlook messages, StickyNotes, several Microscopy file formats, McAfee antivirus quarantine files, etc.
+
+An OLE file can be seen as a mini file system or a Zip archive: It contains **streams** of data that look like files embedded within the OLE file. Each stream has a name. For example, the main stream of a MS Word document containing its text is named "WordDocument".
+
+An OLE file can also contain **storages**. A storage is a folder that contains streams or other storages. For example, a MS Word document with VBA macros has a storage called "Macros".
+
+Special streams can contain **properties**. A property is a specific value that can be used to store information such as the metadata of a document (title, author, creation date, etc). Property stream names usually start with the character '\x05'.
+
+For example, a typical MS Word document may look like this:
+
+
+
+Go to the [[API]] page to see how to use all olefile features to parse OLE files.
+
+
+--------------------------------------------------------------------------
+
+olefile documentation
+---------------------
+
+- [[Home]]
+- [[License]]
+- [[Install]]
+- [[Contribute]], Suggest Improvements or Report Issues
+- [[OLE_Overview]]
+- [[API]] and Usage
diff --git a/.venv/lib/python3.12/site-packages/olefile/doc/OLE_VBA_sample.png b/.venv/lib/python3.12/site-packages/olefile/doc/OLE_VBA_sample.png Binary files differnew file mode 100644 index 00000000..93f74d5e --- /dev/null +++ b/.venv/lib/python3.12/site-packages/olefile/doc/OLE_VBA_sample.png |