-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup.py
54 lines (51 loc) · 1.75 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
from setuptools import setup, find_packages
from distutils.command.build import build
import os
import sys
from setuptools import setup
import subprocess
class Build(build):
"""Customized setuptools build command - builds native unicorn bindings on build."""
def run(self):
subprocess.run(['sudo', 'apt-get', 'update'])
subprocess.run(['sudo', 'apt-get', 'install', '-y', 'automake', 'gnuplot', 'gcc-arm-linux-gnueabihf', "gdb"])
protoc_command = ["make", "-C", "semu_fuzz/emulate/native", "clean", "all"]
if subprocess.call(protoc_command) != 0:
sys.exit(-1)
build.run(self)
def get_all_files(base_path, *dirs):
files = []
for dir in dirs:
for maindir, subdir, file_name_list in os.walk(base_path+'/'+dir):
subdir[:] = [d for d in subdir if not (d == "__pycache__" or "__pycache__" in os.path.join(maindir, d))]
for filename in file_name_list:
if filename == "__pycache__":
continue
apath = os.path.join(maindir, filename)
apath = apath.split('/', 1)[1]
files.append(apath)
return files
setup(
name='semu_fuzz',
version='0.1',
packages=['semu_fuzz'],
install_requires=[
'pyyaml>=6.0',
'angr>9.2.6',
'capstone>=4.0.2',
'unicornafl',
'archinfo',
'pyelftools'
],
entry_points={
'console_scripts': [
'semu-fuzz=semu_fuzz.harness:main',
'semu-fuzz-helper=semu_fuzz.helper.main:main',
]
},
cmdclass = {
'build': Build
},
include_package_data=True,
package_data={'semu_fuzz': get_all_files('semu_fuzz', 'emulate', "configuration", "helper", "log", "fuzz", "handlers")},
)