Skip to content

Commit

Permalink
Merge pull request #19 from quarkslab/refactor/restructure-scripts
Browse files Browse the repository at this point in the history
Refactor/restructure scripts
  • Loading branch information
cnheitman authored Aug 12, 2024
2 parents bfbc206 + b537ad7 commit 641b573
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
8 changes: 4 additions & 4 deletions bin/pastisd
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ from libpastis import ClientAgent
from libpastis.types import FuzzingEngine

try:
import hfwrapper
from hfwrapper import Honggfuzz
import pastishonggfuzz
from pastishonggfuzz import Honggfuzz
if os.environ.get("HFUZZ_PATH") is None:
raise ImportError("HFUZZ_PATH not set")
HONGGFUZZ_AVAILABLE = True
except ImportError:
hfwrapper, Honggfuzz = None, None
pastishonggfuzz, Honggfuzz = None, None
HONGGFUZZ_AVAILABLE = False
try:
import pastistritondse
Expand Down Expand Up @@ -77,7 +77,7 @@ def main(host=PASTIS_MASTER):

engines = []
if HONGGFUZZ_AVAILABLE:
engines.append((FuzzingEngine.HONGGFUZZ, hfwrapper.__version__))
engines.append((FuzzingEngine.HONGGFUZZ, pastishonggfuzz.__version__))
else:
logging.warning("Honggfuzz is not available (cannot import it)")
if PASTISTRITONDSE_AVAILABLE:
Expand Down
7 changes: 4 additions & 3 deletions bin/pastis-benchmark → pastisbenchmark/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3

# built-in imports
import shutil

Expand Down Expand Up @@ -389,6 +387,9 @@ def history(workspace: str):
plotter.show_delta_history(campaign)


if __name__ == "__main__":
def main():
cli()


if __name__ == "__main__":
main()
2 changes: 0 additions & 2 deletions bin/pastis-broker → pastisbroker/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3

# built-in imports
import click
import sys
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@
test_suite="",
entry_points={
"console_scripts": [
"pastis-benchmark = pastisbenchmark.__main__:main",
"pastis-broker = pastisbroker.__main__:main",
"pastis-aflpp = pastisaflpp.__main__:main",
"pastis-honggfuzz = pastishonggfuzz.__main__:main",
"pastis-tritondse = pastistritondse.__main__:main"
]
},
scripts=[
'bin/pastis-broker',
'bin/pastis-benchmark',
'bin/pastisd',
]
)

0 comments on commit 641b573

Please sign in to comment.