Skip to content

Commit 29de4c5

Browse files
committed
Add pyinstaller hook
This allows to create single-file exploits without the need to have python installed. You still need to have external binutils for asm/disasm. Closes Gallopsled#2086
1 parent b73e74f commit 29de4c5

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import os
2+
3+
def get_hook_dirs():
4+
return [os.path.dirname(__file__)]
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
2+
3+
hiddenimports = [
4+
"pwnlib.atexception",
5+
"pwnlib.pep237",
6+
"pwnlib.update",
7+
"pwnlib.useragents",
8+
]
9+
hiddenimports += collect_submodules("pwnlib.constants")
10+
11+
datas = collect_data_files("pwnlib.data")
12+
datas += collect_data_files("pwnlib.shellcraft", subdir="templates")

pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,6 @@ include-package-data = false
6868

6969
[tool.setuptools.packages.find]
7070
namespaces = false
71+
72+
[project.entry-points.pyinstaller40]
73+
hook-dirs = "pwnlib.internal.pyinstaller:get_hook_dirs"

0 commit comments

Comments
 (0)