forked from volatilityfoundation/volatility
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
97 lines (87 loc) · 3.52 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
#!/usr/bin/env python
# Volatility
#
# Authors:
# AAron Walters <awalters@4tphi.net>
# Mike Auty <mike.auty@gmail.com>
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Volatility is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Volatility. If not, see <http://www.gnu.org/licenses/>.
#
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import volatility.constants
import sys
import os
py2exe_available = True
try:
import py2exe #pylint: disable-msg=W0611,F0401
except ImportError:
py2exe_available = False
def find_files(topdirs, py = False):
"""Lists all python files under any topdir from the topdirs lists.
Returns an appropriate list for data_files,
with source and destination directories the same"""
ret = []
for topdir in topdirs:
for r, _ds, fs in os.walk(topdir):
ret.append((r, [ os.path.join(r, f) for f in fs if (f.endswith('.py') or not py)]))
return ret
opts = {}
opts['name'] = "volatility"
opts['version'] = volatility.constants.VERSION
opts['description'] = "Volatility -- Volatile memory framework"
opts['author'] = "AAron Walters"
opts['author_email'] = "awalters@4tphi.net"
opts['url'] = "http://www.volatilityfoundation.org"
opts['license'] = "GPL"
opts['scripts'] = ["vol.py"]
opts['packages'] = ["volatility",
"volatility.win32",
"volatility.renderers",
"volatility.plugins",
"volatility.plugins.addrspaces",
"volatility.plugins.overlays",
"volatility.plugins.overlays.windows",
"volatility.plugins.overlays.linux",
"volatility.plugins.overlays.mac",
"volatility.plugins.gui",
"volatility.plugins.gui.vtypes",
"volatility.plugins.linux",
"volatility.plugins.registry",
"volatility.plugins.malware",
"volatility.plugins.mac"]
opts['data_files'] = find_files(['contrib'], py = True) + find_files(['tools'])
if py2exe_available:
py2exe_distdir = 'dist/py2exe'
opts['console'] = [{ 'script': 'vol.py',
'icon_resources': [(1, 'resources/volatility.ico')]
}]
# Optimize must be 1 for plugins that use docstring for the help value,
# otherwise the help gets optimized out
opts['options'] = {'py2exe':{'optimize': 1,
'dist_dir': py2exe_distdir,
'packages': opts['packages'] + ['socket', 'ctypes', 'Crypto.Cipher', 'urllib', 'distorm3', 'yara', 'xml.etree.ElementTree'],
# This, along with zipfile = None, ensures a single binary
'bundle_files': 1,
}
}
opts['zipfile'] = None
distrib = setup(**opts) #pylint: disable-msg=W0142
if 'py2exe' in sys.argv:
# Any py2exe specific files or things that need doing can go in here
pass