-
Notifications
You must be signed in to change notification settings - Fork 32
/
setup.py
124 lines (109 loc) · 4.55 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Setuptools scripts."""
from setuptools import setup
import distutils.cmd
import distutils.log
import subprocess
class PyPrepTestsCommand(distutils.cmd.Command):
"""
A custom command to build test sets.
Requires ctypeslib2.
"""
description = 'Run tests and dumps memory'
user_options = []
# # The format is (long option, short option, description).
# ('pylint-rcfile=', None, 'path to Pylint _target_platform file'),
# ]
def initialize_options(self):
"""Set default values for options."""
# # Each user option must be listed here with their default value.
# self.pylint_rcfile = ''
pass
def finalize_options(self):
"""Post-process options."""
# if self.pylint_rcfile:
# assert os.path.exists(self.pylint_rcfile), (
# 'Pylint _target_platform file %s does not exist.' % self.pylint_rcfile)
pass
def run(self):
"""Run command."""
import os
import sys
os.getcwd()
# all dump files are in .tgz
makeCmd = ['make', '-d']
p = subprocess.Popen(makeCmd, stdout=sys.stdout, cwd='test/src/')
#makeCmd = ['make', '-f', 'Makefile.prep']
#p = subprocess.Popen(makeCmd, stdout=sys.stdout, cwd='test/src/')
p.wait()
return p.returncode
setup(name="haystack",
version="0.30",
description="Search C Structures in a process' memory",
long_description=open("README.md").read(),
url="http://packages.python.org/haystack/",
download_url="http://github.com/trolldbois/python-haystack/tree/master",
license="GPL",
classifiers=[
"Topic :: System :: Networking",
"Topic :: Security",
"Environment :: Console",
"Environment :: X11 Applications :: Qt",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Programming Language :: Python",
"Development Status :: 4 - Beta",
#"Development Status :: 5 - Production/Stable",
],
keywords=["memory","analysis","forensics","record","struct","ptrace","reverse","heap"],
author="Loic Jaquemet",
author_email="loic.jaquemet+python@gmail.com",
packages=["haystack",
"haystack.abc",
"haystack.gui",
"haystack.mappings",
"haystack.outputters",
"haystack.reverse",
"haystack.reverse.heuristics",
"haystack.search",
"haystack.allocators",
"haystack.allocators.libc",
"haystack.allocators.win32"],
#package_dir={"haystack.reverse": 'haystack/reverse'},
package_data={"haystack.reverse.heuristics": ['data/words.100'],
"haystack.allocators.win32": ['win7heap.constraints', 'winxpheap.constraints'],
"haystack.allocators.libc": ['libcheap.constraints']},
scripts=["scripts/haystack",
"scripts/haystack-gui",
"scripts/haystack-dump",
"scripts/haystack-reverse",
"scripts/haystack-find-heap.py"],
# reverse: numpy is a dependency for reverse.
# https://github.com/numpy/numpy/issues/2434
# numpy is already installed in travis-ci
## setup_requires=["numpy"],
# search: install requires only pefile, python-ptrace for memory-dump
# reverse: install requires networkx, numpy, Levenshtein for signatures
install_requires=["pefile",
"python-ptrace",
# reverse need these.
#"numpy",
#"networkx",
#"python-Levenshtein"
],
dependency_links=[#"https://github.com/trolldbois/ctypeslib/tarball/dev#egg=ctypeslib2-2.4beta",
"https://github.com/volatilityfoundation/volatility/tarball/master#egg=volatility-trunk",
"https://github.com/google/rekall/tarball/master#egg=rekall-trunk",
"https://github.com/erocarrera/pefile/archive/pefile-1.2.10-139.tar.gz"],
# build_test_requires = ["ctypeslib2>=2.1.3"],
test_suite= "test.alltests",
# https://pythonhosted.org/setuptools/setuptools.html
# prep_test requires ctypeslib2
#tests_require=["volatility"],
# tests_require=["ctypeslib2>2.1.3"],
#entry_points = {'haystack.plugins':['haystack.model:register']},
cmdclass={
'preptests': PyPrepTestsCommand,
},
)