polyfile-weave 0.5.5__py3-none-any.whl → 0.5.7__py3-none-any.whl
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.
Potentially problematic release.
This version of polyfile-weave might be problematic. Click here for more details.
- polyfile/pdf.py +83 -9
- polyfile/polyfile.py +11 -4
- {polyfile_weave-0.5.5.dist-info → polyfile_weave-0.5.7.dist-info}/METADATA +2 -2
- {polyfile_weave-0.5.5.dist-info → polyfile_weave-0.5.7.dist-info}/RECORD +8 -8
- {polyfile_weave-0.5.5.dist-info → polyfile_weave-0.5.7.dist-info}/WHEEL +0 -0
- {polyfile_weave-0.5.5.dist-info → polyfile_weave-0.5.7.dist-info}/entry_points.txt +0 -0
- {polyfile_weave-0.5.5.dist-info → polyfile_weave-0.5.7.dist-info}/licenses/LICENSE +0 -0
- {polyfile_weave-0.5.5.dist-info → polyfile_weave-0.5.7.dist-info}/top_level.txt +0 -0
polyfile/pdf.py
CHANGED
|
@@ -5,19 +5,93 @@ import zlib
|
|
|
5
5
|
from pdfminer.ascii85 import ascii85decode, asciihexdecode
|
|
6
6
|
from pdfminer.ccitt import ccittfaxdecode
|
|
7
7
|
from pdfminer.lzw import lzwdecode
|
|
8
|
-
from pdfminer.pdfparser import PDFSyntaxError
|
|
9
|
-
from pdfminer.pdftypes import PDFNotImplementedError
|
|
10
8
|
from pdfminer.runlength import rldecode
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
|
|
10
|
+
# Core parser and exceptions that remain stable
|
|
11
|
+
from pdfminer.pdfparser import PDFSyntaxError
|
|
12
|
+
from pdfminer.pdfparser import PDFParser as PDFMinerParser
|
|
13
|
+
|
|
14
|
+
# PDFStream and PDFObjRef moved from pdfminer.pdfparser -> pdfminer.pdftypes
|
|
15
|
+
try:
|
|
16
|
+
from pdfminer.pdftypes import PDFStream, PDFObjRef # new location
|
|
17
|
+
except Exception: # pragma: no cover - fallback for older pdfminer
|
|
18
|
+
from pdfminer.pdfparser import PDFStream, PDFObjRef # old location
|
|
19
|
+
|
|
20
|
+
# psparser symbols; KWD moved from pdfdocument -> psparser
|
|
21
|
+
from pdfminer.psparser import (
|
|
22
|
+
ExtraT,
|
|
23
|
+
PSBaseParserToken,
|
|
24
|
+
PSKeyword,
|
|
25
|
+
PSObject,
|
|
26
|
+
PSLiteral,
|
|
27
|
+
PSStackEntry,
|
|
28
|
+
PSSyntaxError,
|
|
29
|
+
)
|
|
30
|
+
try:
|
|
31
|
+
from pdfminer.psparser import KWD # new location
|
|
32
|
+
except Exception: # pragma: no cover
|
|
33
|
+
# old location
|
|
34
|
+
from pdfminer.pdfdocument import KWD
|
|
35
|
+
|
|
36
|
+
# PSEOF moved from pdfdocument -> psexceptions
|
|
37
|
+
try:
|
|
38
|
+
from pdfminer.psexceptions import PSEOF # new location
|
|
39
|
+
except Exception: # pragma: no cover
|
|
40
|
+
from pdfminer.pdfdocument import PSEOF # old location
|
|
41
|
+
|
|
42
|
+
# dict_value moved from pdfdocument -> pdftypes
|
|
43
|
+
try:
|
|
44
|
+
from pdfminer.pdftypes import dict_value # new location
|
|
45
|
+
except Exception: # pragma: no cover
|
|
46
|
+
from pdfminer.pdfdocument import dict_value # old location
|
|
47
|
+
|
|
48
|
+
# DecipherCallable moved to pdftypes
|
|
49
|
+
try:
|
|
50
|
+
from pdfminer.pdftypes import DecipherCallable # new location
|
|
51
|
+
except Exception: # pragma: no cover
|
|
52
|
+
from pdfminer.pdfdocument import DecipherCallable # old location
|
|
53
|
+
|
|
54
|
+
# PDFObjectNotFound moved to pdfexceptions
|
|
55
|
+
try:
|
|
56
|
+
from pdfminer.pdfexceptions import PDFObjectNotFound # new location
|
|
57
|
+
except Exception: # pragma: no cover
|
|
58
|
+
from pdfminer.pdfdocument import PDFObjectNotFound # old location
|
|
59
|
+
|
|
60
|
+
# Keep other pdfdocument items that still exist there
|
|
13
61
|
from pdfminer.pdfdocument import (
|
|
14
|
-
PDFDocument,
|
|
15
|
-
|
|
62
|
+
PDFDocument,
|
|
63
|
+
PDFXRef,
|
|
64
|
+
PDFNoValidXRef,
|
|
65
|
+
LITERAL_XREF,
|
|
66
|
+
LITERAL_OBJSTM,
|
|
67
|
+
LITERAL_CATALOG,
|
|
16
68
|
)
|
|
69
|
+
|
|
70
|
+
# LIT moved from pdftypes -> psparser
|
|
71
|
+
try:
|
|
72
|
+
from pdfminer.psparser import LIT # new location
|
|
73
|
+
except Exception: # pragma: no cover
|
|
74
|
+
from pdfminer.pdftypes import LIT # old location
|
|
75
|
+
|
|
76
|
+
# apply_png_predictor moved from pdftypes -> utils
|
|
77
|
+
try:
|
|
78
|
+
from pdfminer.utils import apply_png_predictor # new location
|
|
79
|
+
except Exception: # pragma: no cover
|
|
80
|
+
from pdfminer.pdftypes import apply_png_predictor # old location
|
|
81
|
+
|
|
82
|
+
# Remaining pdftypes symbols
|
|
17
83
|
from pdfminer.pdftypes import (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
84
|
+
PDFNotImplementedError,
|
|
85
|
+
LITERALS_FLATE_DECODE,
|
|
86
|
+
LITERALS_ASCIIHEX_DECODE,
|
|
87
|
+
LITERALS_CCITTFAX_DECODE,
|
|
88
|
+
LITERALS_RUNLENGTH_DECODE,
|
|
89
|
+
LITERAL_CRYPT,
|
|
90
|
+
LITERALS_LZW_DECODE,
|
|
91
|
+
LITERALS_DCT_DECODE,
|
|
92
|
+
LITERALS_JBIG2_DECODE,
|
|
93
|
+
LITERALS_ASCII85_DECODE,
|
|
94
|
+
int_value,
|
|
21
95
|
)
|
|
22
96
|
|
|
23
97
|
from .fileutils import FileStream
|
polyfile/polyfile.py
CHANGED
|
@@ -15,12 +15,19 @@ from . import logger
|
|
|
15
15
|
from .magic import MagicMatcher, Match as MagicMatch, MatchContext, TestResult
|
|
16
16
|
|
|
17
17
|
if sys.version_info >= (3, 10):
|
|
18
|
-
from importlib.metadata import version
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
from importlib.metadata import version, PackageNotFoundError
|
|
19
|
+
try:
|
|
20
|
+
__version__: str = version("polyfile_weave")
|
|
21
|
+
except PackageNotFoundError:
|
|
22
|
+
# Fallback for local, editable, or source-only usage without installed metadata
|
|
23
|
+
__version__ = "0.0.0-dev"
|
|
24
|
+
del version, PackageNotFoundError
|
|
21
25
|
else:
|
|
22
26
|
import pkg_resources
|
|
23
|
-
|
|
27
|
+
try:
|
|
28
|
+
__version__ = pkg_resources.require("polyfile_weave")[0].version
|
|
29
|
+
except Exception:
|
|
30
|
+
__version__ = "0.0.0-dev"
|
|
24
31
|
del pkg_resources
|
|
25
32
|
mod_year = localtime(Path(__file__).stat().st_mtime).tm_year
|
|
26
33
|
__copyright__: str = f"Copyright ©{mod_year} Trail of Bits"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: polyfile-weave
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.7
|
|
4
4
|
Summary: A utility to recursively map the structure of a file.
|
|
5
5
|
Home-page: https://github.com/zbirenbaum/polyfile-weave
|
|
6
6
|
Author: Trail of Bits
|
|
@@ -24,7 +24,7 @@ Requires-Dist: intervaltree>=2.4.0
|
|
|
24
24
|
Requires-Dist: jinja2>=2.1.0
|
|
25
25
|
Requires-Dist: kaitaistruct~=0.10
|
|
26
26
|
Requires-Dist: networkx>=2.6.3
|
|
27
|
-
Requires-Dist: pdfminer.six<=
|
|
27
|
+
Requires-Dist: pdfminer.six<=20250506,>=20220524
|
|
28
28
|
Requires-Dist: Pillow>=5.0.0
|
|
29
29
|
Requires-Dist: pyreadline3; platform_system == "Windows"
|
|
30
30
|
Requires-Dist: pyyaml>=3.13
|
|
@@ -14,9 +14,9 @@ polyfile/logger.py,sha256=i2JYOYTQX4TQPYXeHx9JQ3r9VKfSy6E8CIjUMdcREBo,3979
|
|
|
14
14
|
polyfile/magic.py,sha256=271GCWrfgFIs0FRNIrCwsVc4LQXX1SXa9kHWJPyPkZM,117748
|
|
15
15
|
polyfile/nes.py,sha256=I_yvW1iboEbPy4RP15eYVk9CVnKjwCQnchR6ahrd5tc,3933
|
|
16
16
|
polyfile/nitf.py,sha256=1GbylAnWEV6OgkblEjIsnSM0XRd3uoa3ZF-ra_E_81M,589
|
|
17
|
-
polyfile/pdf.py,sha256=
|
|
17
|
+
polyfile/pdf.py,sha256=cCB1EnuGZvsHV64QtGWLRYqp01-lG0n9LWlopHlJUss,48817
|
|
18
18
|
polyfile/pickles.py,sha256=4QElNrwW_kcmmKVvDT66KSVu7IUzplmvh6Nkqa_AWTg,1932
|
|
19
|
-
polyfile/polyfile.py,sha256=
|
|
19
|
+
polyfile/polyfile.py,sha256=g-Rmt7b2PlvSiVmOC1q-7WWA_w3xE_ReKRBE-XSRvSY,15009
|
|
20
20
|
polyfile/profiling.py,sha256=rnJDZQo9qWdBwOkGBbcn85jEOuMA8HZDHR1fyEHvKvM,3694
|
|
21
21
|
polyfile/repl.py,sha256=xnI9mnX3GpsWAqLhgij9Wk8WCBcO_khFJa0bDX_nJtk,24132
|
|
22
22
|
polyfile/search.py,sha256=cRixN3aAXQUifFLopTcXAwN_IKdcwVEAzAk7slwb5Eo,9837
|
|
@@ -572,14 +572,14 @@ polyfile/templates/hexdump.css,sha256=UyvMxUcPwO8FLZofGfsuD7OLxseSaAXtdE5ZgqJnl-
|
|
|
572
572
|
polyfile/templates/hexdump.js,sha256=mg-wAVj9FR8-h1FDNlFGh5QSdOSGb-Boefj8OZ9TiYs,22917
|
|
573
573
|
polyfile/templates/jquery-3.4.1.min.js,sha256=CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo,88145
|
|
574
574
|
polyfile/templates/template.html,sha256=x_njCp9XFPmeealSBgcn0onDcMkkpGR0hrgUWXPFElo,4226
|
|
575
|
-
polyfile_weave-0.5.
|
|
575
|
+
polyfile_weave-0.5.7.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
576
576
|
polymerge/__init__.py,sha256=nBpeA5mhu-ZtHRp4AtT5TRucLakHz8_ZC-kgmtmaHO0,28
|
|
577
577
|
polymerge/__main__.py,sha256=n5M3RPFcFN30bn0HF0BeR2t6qIQh7WchIEifcpOVDcw,13261
|
|
578
578
|
polymerge/cfg.py,sha256=8Tq0VkaxARZuXSDLdB5ljSpPffL_5WnGrKzUQymfygs,4293
|
|
579
579
|
polymerge/polymerge.py,sha256=Kz_KqpA7jGzbsIzUiN9WUYa-KtS3Kdi7rkB8Wy40eBI,8357
|
|
580
580
|
polymerge/polytracker.py,sha256=MoeiXDDfHOUy8kuylba6po6v-xRhwRCOsf8rR7aYk8o,6866
|
|
581
|
-
polyfile_weave-0.5.
|
|
582
|
-
polyfile_weave-0.5.
|
|
583
|
-
polyfile_weave-0.5.
|
|
584
|
-
polyfile_weave-0.5.
|
|
585
|
-
polyfile_weave-0.5.
|
|
581
|
+
polyfile_weave-0.5.7.dist-info/METADATA,sha256=x4S6mkqVFVAv20yjUXegbyGeVOcdcGDzQ5Izh7qm2I4,7588
|
|
582
|
+
polyfile_weave-0.5.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
583
|
+
polyfile_weave-0.5.7.dist-info/entry_points.txt,sha256=aYTDT8rTusiriW6Gla03D8akWAtEgG3bKAoeIXW4AMU,52
|
|
584
|
+
polyfile_weave-0.5.7.dist-info/top_level.txt,sha256=FXJ-FLNEQcq_ZX7bp4aQq3hSAC1KoLFCb019q2D3XQQ,19
|
|
585
|
+
polyfile_weave-0.5.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|