Skip to content

Commit 286751f

Browse files
committed
feat!: update pdf-triage to send arguments other than plugin to pdfid.py
1 parent cccdead commit 286751f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

scripts/pdf_triage.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""!
2-
@brief Runs PDFiD on a PDF file with the triage plugin. Arguments are [plugin].
2+
@brief Runs PDFiD on a PDF file with the triage plugin.
33
"""
44
from deject.plugins import Deject
55
from pathlib import Path
@@ -8,7 +8,7 @@
88

99
@Deject.plugin
1010
def pdf_image():
11-
"""Runs PDFiD on a PDF file with the triage plugin. Arguments are [plugin]."""
11+
"""Runs PDFiD on a PDF file with the triage plugin."""
1212
script = Path("./scripts/pdf-tools/pdfid.py")
1313
filename = Deject.file_path
1414
if Deject.plugin_args == "False":
@@ -20,14 +20,17 @@ def pdf_image():
2020
)
2121
else:
2222
args = str(Deject.plugin_args)
23-
helpers.bin_exec(helpers, ["python", script, '-p', args, filename])
23+
helpers.bin_exec(
24+
helpers,
25+
["python", script] + args.strip().split(" ") + [filename],
26+
)
2427
return
2528

2629

2730
def help():
2831
print("""
2932
PDF Triage plugin
30-
SYNOPSIS <file> [pdfid plugin]
31-
Uses PDFiD with triage plugin (default)
32-
or runs the named plugin(s) (Separate with comma ',').
33+
SYNOPSIS <file> [arguments]
34+
Uses PDFiD with triage plugin (default). Additional arguments can be passed to PDFiD or additional plugins can be used.
35+
Place additional plugins in ./scripts/pdf-tools/.
3336
""")

0 commit comments

Comments
 (0)