diff --git a/.gitignore b/.gitignore index abfbc72..895e1c6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.pyc *.swp *.egg-info +build/* +dist/* diff --git a/README.md b/README.md index 86db9bd..718ee00 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,5 @@ True >>> pov.dump_c('leak.c') # they can be dumped just like Rex POVs too >>> pov.dump_binary('leak.pov') ``` + +`pip install .` or `python setup.py install` should install it correctly. diff --git a/colorguard/colorguard.py b/colorguard/colorguard.py index 1150aa0..758eed2 100644 --- a/colorguard/colorguard.py +++ b/colorguard/colorguard.py @@ -16,8 +16,8 @@ from rex.exploit.cgc import CGCExploit -from .harvester import Harvester from .pov import ColorguardExploit, ColorguardNaiveExploit, ColorguardNaiveHexExploit, ColorguardNaiveAtoiExploit +from .harvester import Harvester l = logging.getLogger("colorguard.ColorGuard") diff --git a/setup.py b/setup.py index 9aefac5..7c14634 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,38 @@ -from distutils.core import setup -import subprocess +import os + +PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) + +try: + from setuptools import setup + from setuptools import find_packages + packages = find_packages() +except ImportError: + from distutils.core import setup + packages = [] + for root, _, filenames in os.walk(PROJECT_DIR): + if '__init__' in filenames: + packages.append(root) + +from distutils.command.build import build as _build + +def build(_build): + def run(self): + _build.run(self) + +cmd_class = {'build' : build} setup( name='colorguard', version='0.01', - packages=['colorguard'], + packages=packages, + cmd_class = cmd_class, install_requires=[ 'rex', 'povsim', 'tracer', 'angr' ], + package_data={'colorguard': ['__init__.py', 'colorguard.py','pov/*', + 'pov/c_templates/*', 'harvester/*'], + }, )