forked from Gallopsled/pwntools
-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
92 lines (82 loc) · 3.19 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env python2
import glob
import os
import platform
import sys
from distutils.command.install import INSTALL_SCHEMES
from distutils.sysconfig import get_python_inc
from distutils.util import convert_path
from setuptools import find_packages
from setuptools import setup
# Get all template files
templates = []
for dirpath, dirnames, filenames in os.walk(convert_path('pwnlib/shellcraft/templates')):
for f in filenames:
templates.append(os.path.relpath(os.path.join(dirpath, f), 'pwnlib'))
# This makes binjitsu-LICENSE.txt appear with the package folders
for scheme in INSTALL_SCHEMES.values():
scheme['data'] = scheme['purelib']
# Find all of the console scripts
console_scripts = []
for filename in glob.glob('pwnlib/commandline/*'):
filename = os.path.basename(filename)
filename, ext = os.path.splitext(filename)
if ext != '.py' or '__init__' in filename:
continue
script = '%s=pwnlib.commandline.%s:main' % (filename, filename)
console_scripts.append(script)
install_requires = ['paramiko>=1.15.2',
'argparse',
'mako>=1.0.0',
'pyelftools>=0.2.3',
'capstone',
'ropgadget>=5.3',
'pyserial>=2.7',
'requests>=2.5.1',
'pip>=6.0.8',
'tox>=1.8.1',
'pygments>=2.0']
# This is a hack until somebody ports psutil to OpenBSD
if platform.system() != 'OpenBSD':
install_requires.append('psutil>=2.1.3')
# Check that the user has installed the Python development headers
PythonH = os.path.join(get_python_inc(), 'Python.h')
if not os.path.exists(PythonH):
print >> sys.stderr, "You must install the Python development headers!"
print >> sys.stderr, "$ apt-get install python-dev"
sys.exit(-1)
setup(
name = 'binjitsu',
packages = find_packages(),
version = '2.2.1',
data_files = [('',
['LICENSE-binjitsu.txt',
]),
],
package_data = {
'pwnlib': [
'data/crcsums.txt',
'data/useragents/useragents.txt',
'data/binutils/*',
'data/includes/*.h',
'data/includes/*/*.h',
] + templates,
},
entry_points = {'console_scripts': console_scripts},
scripts = glob.glob("bin/*"),
description = "CTF framework and exploit development library.",
author = "Zach Riggle",
author_email = "zachriggle@gmail.com",
url = 'https://binjit.su',
download_url = "https://binjit.su/tarball/master",
install_requires = install_requires,
license = "Mostly MIT, some GPL/BSD, see LICENSE-binjitsu.txt and LICENSE-pwntools.txt",
classifiers = [
'Topic :: Security',
'Environment :: Console',
'Operating System :: OS Independent',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Intended Audience :: Developers'
]
)