| 1 |
|
| 2 |
|
| 3 |
import os |
| 4 |
|
| 5 |
from setuptools import setup |
| 6 |
|
| 7 |
package_name = "ROPGadget" |
| 8 |
package_dir = "ropgadget" |
| 9 |
package_description = "This tool lets you search your gadgets on your binaries to facilitate your ROP exploitation." |
| 10 |
long_description = """ |
| 11 |
ROPgadget supports ELF, PE, Mach-O, and Raw formats on x86, x64, ARM, ARM64, PowerPC, SPARC, MIPS, RISC-V 64, and RISC-V Compressed architectures. |
| 12 |
https://github.com/JonathanSalwan/ROPgadget |
| 13 |
""".strip() |
| 14 |
|
| 15 |
|
| 16 |
def fullsplit(path, result=None): |
| 17 |
""" |
| 18 |
Split a pathname into components (the opposite of os.path.join) in a |
| 19 |
platform-neutral way. |
| 20 |
""" |
| 21 |
if result is None: |
| 22 |
result = [] |
| 23 |
head, tail = os.path.split(path) |
| 24 |
if head == '': |
| 25 |
return [tail] + result |
| 26 |
if head == path: |
| 27 |
return result |
| 28 |
return fullsplit(head, [tail] + result) |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
packages, data_files = [], [] |
| 34 |
root_dir = os.path.dirname(__file__) |
| 35 |
if root_dir != '': |
| 36 |
os.chdir(root_dir) |
| 37 |
|
| 38 |
for dirpath, dirnames, filenames in os.walk(package_dir): |
| 39 |
|
| 40 |
for i, dirname in enumerate(dirnames): |
| 41 |
if dirname.startswith('.'): |
| 42 |
del dirnames[i] |
| 43 |
if '__init__.py' in filenames: |
| 44 |
packages.append('.'.join(fullsplit(dirpath))) |
| 45 |
elif filenames: |
| 46 |
data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]]) |
| 47 |
|
| 48 |
version = "7.7" |
| 49 |
|
| 50 |
setup( |
| 51 |
name = package_name, |
| 52 |
version = version, |
| 53 |
description = package_description, |
| 54 |
long_description = long_description, |
| 55 |
packages = packages, |
| 56 |
license = "BSD", |
| 57 |
author = "Jonathan Salwan", |
| 58 |
author_email = "[email protected]", |
| 59 |
url = "https://github.com/JonathanSalwan/ROPgadget", |
| 60 |
scripts = ['scripts/ROPgadget'], |
| 61 |
install_requires = ['capstone>=5.0.1'], |
| 62 |
classifiers = [ |
| 63 |
'Topic :: Security', |
| 64 |
'Environment :: Console', |
| 65 |
'Operating System :: OS Independent', |
| 66 |
'License :: OSI Approved :: BSD License', |
| 67 |
'Programming Language :: Python :: 2.7', |
| 68 |
'Programming Language :: Python :: 3', |
| 69 |
'Intended Audience :: Developers', |
| 70 |
], |
| 71 |
) |