dissect.ole 3.8.dev4__tar.gz → 3.9.dev2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dissect.ole-3.8.dev4/dissect.ole.egg-info → dissect_ole-3.9.dev2}/PKG-INFO +6 -3
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2}/dissect/ole/c_ole.py +2 -3
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2}/dissect/ole/ole.py +27 -19
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2/dissect.ole.egg-info}/PKG-INFO +6 -3
- dissect_ole-3.9.dev2/dissect.ole.egg-info/requires.txt +6 -0
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2}/pyproject.toml +8 -2
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2}/tox.ini +6 -4
- dissect.ole-3.8.dev4/dissect.ole.egg-info/requires.txt +0 -2
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2}/COPYRIGHT +0 -0
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2}/LICENSE +0 -0
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2}/MANIFEST.in +0 -0
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2}/README.md +0 -0
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2}/dissect/ole/__init__.py +0 -0
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2}/dissect/ole/exceptions.py +0 -0
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2}/dissect.ole.egg-info/SOURCES.txt +0 -0
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2}/dissect.ole.egg-info/dependency_links.txt +0 -0
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2}/dissect.ole.egg-info/top_level.txt +0 -0
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2}/setup.cfg +0 -0
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2}/tests/docs/Makefile +0 -0
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2}/tests/docs/conf.py +0 -0
- {dissect.ole-3.8.dev4 → dissect_ole-3.9.dev2}/tests/docs/index.rst +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dissect.ole
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.9.dev2
|
|
4
4
|
Summary: A Dissect module implementing a parser for the Object Linking & Embedding (OLE) format, commonly used by document editors on Windows operating systems
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License: Affero General Public License v3
|
|
@@ -22,8 +22,11 @@ Requires-Python: ~=3.9
|
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
License-File: LICENSE
|
|
24
24
|
License-File: COPYRIGHT
|
|
25
|
-
Requires-Dist: dissect.cstruct<4.
|
|
26
|
-
Requires-Dist: dissect.util<4
|
|
25
|
+
Requires-Dist: dissect.cstruct<5,>=4.dev
|
|
26
|
+
Requires-Dist: dissect.util<4,>=3
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: dissect.cstruct<5.0.dev,>=4.0.dev; extra == "dev"
|
|
29
|
+
Requires-Dist: dissect.util<4.0.dev,>=3.0.dev; extra == "dev"
|
|
27
30
|
|
|
28
31
|
# dissect.ole
|
|
29
32
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from dissect import cstruct
|
|
1
|
+
from dissect.cstruct import cstruct
|
|
2
2
|
|
|
3
3
|
ole_def = """
|
|
4
4
|
typedef short OFFSET;
|
|
@@ -81,8 +81,7 @@ struct StructuredStorageDirectoryEntry { // [offset from start in bytes, leng
|
|
|
81
81
|
DFPROPTYPE _dptPropType; // [07CH,02] Reserved for future use. Must be zero.
|
|
82
82
|
};
|
|
83
83
|
"""
|
|
84
|
-
c_ole = cstruct.
|
|
85
|
-
c_ole.load(ole_def)
|
|
84
|
+
c_ole = cstruct().load(ole_def)
|
|
86
85
|
|
|
87
86
|
SIGNATURE = b"\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1"
|
|
88
87
|
SIGNATURE_BETA = b"\x0e\x11\xfc\x0d\xd0\xcf\x11\xe0"
|
|
@@ -28,7 +28,6 @@ class OLE:
|
|
|
28
28
|
self._difatcache = {}
|
|
29
29
|
self._chaincache = {}
|
|
30
30
|
self._minichaincache = {}
|
|
31
|
-
self._dirlist = {}
|
|
32
31
|
|
|
33
32
|
minifat_buf = self.chain(self.header._sectMiniFatStart).open().read()
|
|
34
33
|
self._minifat = c_ole.uint32[len(minifat_buf) // 4](minifat_buf)
|
|
@@ -38,21 +37,24 @@ class OLE:
|
|
|
38
37
|
self.root = self.directory(0)
|
|
39
38
|
self.ministream = self.root.open()
|
|
40
39
|
|
|
41
|
-
def get(self,
|
|
42
|
-
|
|
43
|
-
try:
|
|
44
|
-
return dirlist[name]
|
|
45
|
-
except KeyError:
|
|
46
|
-
return NotFoundError(name)
|
|
40
|
+
def get(self, path, root=None):
|
|
41
|
+
root = root or self.root
|
|
47
42
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
for entry in self.root.walk():
|
|
51
|
-
self._dirlist[entry.name] = entry
|
|
43
|
+
search_path = path.replace("\\", "/")
|
|
44
|
+
node = root
|
|
52
45
|
|
|
53
|
-
|
|
46
|
+
for part in search_path.split("/"):
|
|
47
|
+
if not part:
|
|
48
|
+
continue
|
|
49
|
+
|
|
50
|
+
for child in node.walk():
|
|
51
|
+
if child.name == part:
|
|
52
|
+
node = child
|
|
53
|
+
break
|
|
54
|
+
else:
|
|
55
|
+
raise NotFoundError(path)
|
|
54
56
|
|
|
55
|
-
|
|
57
|
+
return node
|
|
56
58
|
|
|
57
59
|
def directory(self, sid):
|
|
58
60
|
try:
|
|
@@ -148,29 +150,35 @@ class DirectoryEntry:
|
|
|
148
150
|
else:
|
|
149
151
|
self.chain = ole.chain(self.start, self.size)
|
|
150
152
|
|
|
153
|
+
self._dirlist = {}
|
|
154
|
+
|
|
151
155
|
def __repr__(self):
|
|
152
156
|
return "<DirectoryEntry sid={} name={} type={} size=0x{:x}>".format(self.sid, self.name, self.type, self.size)
|
|
153
157
|
|
|
154
158
|
def open(self):
|
|
155
159
|
return self.chain.open()
|
|
156
160
|
|
|
161
|
+
def listdir(self):
|
|
162
|
+
if not self._dirlist:
|
|
163
|
+
for entry in self.walk():
|
|
164
|
+
self._dirlist[entry.name] = entry
|
|
165
|
+
|
|
166
|
+
return self._dirlist
|
|
167
|
+
|
|
157
168
|
def walk(self):
|
|
158
169
|
if self.has_left_sibling:
|
|
159
170
|
yield self.left_sibling
|
|
160
|
-
|
|
161
|
-
yield child
|
|
171
|
+
yield from self.left_sibling.walk()
|
|
162
172
|
|
|
163
173
|
if self.has_child:
|
|
164
174
|
yield self.child
|
|
165
175
|
|
|
166
176
|
if self.has_right_sibling:
|
|
167
177
|
yield self.right_sibling
|
|
168
|
-
|
|
169
|
-
yield child
|
|
178
|
+
yield from self.right_sibling.walk()
|
|
170
179
|
|
|
171
180
|
if self.has_child:
|
|
172
|
-
|
|
173
|
-
yield child
|
|
181
|
+
yield from self.child.walk()
|
|
174
182
|
|
|
175
183
|
@property
|
|
176
184
|
def child(self):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dissect.ole
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.9.dev2
|
|
4
4
|
Summary: A Dissect module implementing a parser for the Object Linking & Embedding (OLE) format, commonly used by document editors on Windows operating systems
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License: Affero General Public License v3
|
|
@@ -22,8 +22,11 @@ Requires-Python: ~=3.9
|
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
License-File: LICENSE
|
|
24
24
|
License-File: COPYRIGHT
|
|
25
|
-
Requires-Dist: dissect.cstruct<4.
|
|
26
|
-
Requires-Dist: dissect.util<4
|
|
25
|
+
Requires-Dist: dissect.cstruct<5,>=4.dev
|
|
26
|
+
Requires-Dist: dissect.util<4,>=3
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: dissect.cstruct<5.0.dev,>=4.0.dev; extra == "dev"
|
|
29
|
+
Requires-Dist: dissect.util<4.0.dev,>=3.0.dev; extra == "dev"
|
|
27
30
|
|
|
28
31
|
# dissect.ole
|
|
29
32
|
|
|
@@ -25,8 +25,8 @@ classifiers = [
|
|
|
25
25
|
"Topic :: Utilities",
|
|
26
26
|
]
|
|
27
27
|
dependencies = [
|
|
28
|
-
"dissect.cstruct>=
|
|
29
|
-
"dissect.util>=3
|
|
28
|
+
"dissect.cstruct>=4.dev,<5",
|
|
29
|
+
"dissect.util>=3,<4",
|
|
30
30
|
]
|
|
31
31
|
dynamic = ["version"]
|
|
32
32
|
|
|
@@ -35,6 +35,12 @@ homepage = "https://dissect.tools"
|
|
|
35
35
|
documentation = "https://docs.dissect.tools/en/latest/projects/dissect.ole"
|
|
36
36
|
repository = "https://github.com/fox-it/dissect.ole"
|
|
37
37
|
|
|
38
|
+
[project.optional-dependencies]
|
|
39
|
+
dev = [
|
|
40
|
+
"dissect.cstruct>=4.0.dev,<5.0.dev",
|
|
41
|
+
"dissect.util>=3.0.dev,<4.0.dev",
|
|
42
|
+
]
|
|
43
|
+
|
|
38
44
|
[tool.black]
|
|
39
45
|
line-length = 120
|
|
40
46
|
|
|
@@ -5,12 +5,14 @@ envlist = lint
|
|
|
5
5
|
# locally installed tox to have a minimum version 3.3.0. This means the names
|
|
6
6
|
# of the configuration options are still according to the tox 3.x syntax.
|
|
7
7
|
minversion = 4.4.3
|
|
8
|
-
# This version of virtualenv will install setuptools version
|
|
9
|
-
#
|
|
10
|
-
# pyproject.toml file (PEP-517/PEP-518/PEP-621)
|
|
11
|
-
|
|
8
|
+
# This version of virtualenv will install setuptools version 68.2.2 and pip
|
|
9
|
+
# 23.3.1. These versions fully support python projects defined only through a
|
|
10
|
+
# pyproject.toml file (PEP-517/PEP-518/PEP-621). This pip version also support
|
|
11
|
+
# the proper version resolving with (sub-)dependencies defining dev extra's.
|
|
12
|
+
requires = virtualenv>=20.24.6
|
|
12
13
|
|
|
13
14
|
[testenv]
|
|
15
|
+
extras = dev
|
|
14
16
|
deps =
|
|
15
17
|
pytest
|
|
16
18
|
pytest-cov
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|