Skip to content

Commit

Permalink
bump major releases and associated small fixups (#157)
Browse files Browse the repository at this point in the history
Co-authored-by: edward <[email protected]>
  • Loading branch information
EdwardLarson and Edward-Larson authored Jan 3, 2023
1 parent 2904851 commit 8ab2a86
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 18 deletions.
4 changes: 4 additions & 0 deletions ofrak_core/ofrak/ofrak_cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import functools
import sys
from abc import ABC, abstractmethod
from argparse import Namespace, ArgumentParser, RawDescriptionHelpFormatter
from inspect import isabstract
Expand Down Expand Up @@ -291,6 +292,9 @@ def __init__(

def parse_and_run(self, args: Sequence[str]):
parsed = self.ofrak_parser.parse_args(args)
if not hasattr(parsed, "func"):
self.ofrak_parser.print_help()
sys.exit(1)
parsed.func(parsed)


Expand Down
9 changes: 6 additions & 3 deletions ofrak_core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def run(self):

setuptools.setup(
name="ofrak",
version="1.0.0",
version="2.0.0",
description="A binary analysis and modification platform",
packages=setuptools.find_packages(exclude=["test_ofrak", "test_ofrak.*"]),
package_data={
Expand All @@ -39,11 +39,13 @@ def run(self):
install_requires=[
"beartype~=0.10.2",
"fdt==0.3.2",
"importlib-metadata>=1.4",
"intervaltree==3.1.0",
"keystone-engine==0.9.2",
"lief==0.12.2",
"ofrak_io",
"ofrak_type",
"ofrak_io~=1.0",
"ofrak_type~=2.0",
"ofrak_patch_maker~=2.0",
"orjson~=3.6.7",
"pefile==2022.5.30",
"pycdlib==1.12.0",
Expand Down Expand Up @@ -74,6 +76,7 @@ def run(self):
"hypothesis-trio",
"trio-asyncio",
"mypy==0.942",
"psutil~=5.9",
"pyelftools==0.29",
"pytest-asyncio==0.19.0",
"pytest-lazy-fixture",
Expand Down
4 changes: 2 additions & 2 deletions ofrak_io/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ def run(self):

setuptools.setup(
name="ofrak_io",
version="1.0.0",
version="1.1.0",
description="Classes useful for general I/O in OFRAK",
packages=setuptools.find_packages(),
package_data={
"ofrak_io": ["py.typed"],
},
install_requires=[
"ofrak_type",
"ofrak_type>=1.0",
],
extras_require={
"test": [
Expand Down
1 change: 1 addition & 0 deletions ofrak_patch_maker/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ofrak_patch_maker/toolchain.conf
4 changes: 2 additions & 2 deletions ofrak_patch_maker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ PIP=pip3
# assembling, compiling, linking, analyzing binaries for each currently supported toolchain.
.PHONY: toolchain_conf
toolchain_conf:
cp toolchain.conf /etc/toolchain.conf
mv toolchain.conf toolchain.conf.bak
cp ofrak_patch_maker/toolchain.conf /etc/toolchain.conf
mv ofrak_patch_maker/toolchain.conf ofrak_patch_maker/toolchain.conf.bak

.PHONY: install
install: toolchain_conf
Expand Down
File renamed without changes.
15 changes: 8 additions & 7 deletions ofrak_patch_maker/ofrak_patch_maker/toolchain/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,21 @@ def get_repository_config(section: str, key: Optional[str] = None):
"""

config = configparser.RawConfigParser()
config_root = "/etc"
config_name = "toolchain.conf"
if platform.system().find("CYGWIN") > -1 or platform.system().find("Windows") > -1:
config_root = "/winetc"
else:
config_root = "/etc"
local_config = os.path.join(os.path.dirname(__file__), os.path.pardir)
config_paths = [config_root, local_config]
try:
local_etc = os.path.join(os.environ["HOME"], "etc")
paths = [local_etc, config_root]
config_paths = [local_etc] + config_paths
except KeyError:
print("unable to find home directory")
paths = [config_root]

if platform.system().find("CYGWIN") > -1 or platform.system().find("Windows") > -1:
config_root = "/winetc"

error_by_config_file: Dict[str, Exception] = dict()
for p in paths:
for p in config_paths:
conf = os.path.join(p, config_name)
if not os.path.exists(conf):
continue
Expand Down
6 changes: 3 additions & 3 deletions ofrak_patch_maker/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ def run(self):

setuptools.setup(
name="ofrak_patch_maker",
version="1.0.0",
version="2.0.0",
description="PatchMaker tool for applying source-code patches to binaries",
packages=setuptools.find_packages(exclude=("ofrak_patch_maker_test",)),
package_data={"ofrak_patch_maker": ["py.typed"]},
install_requires=[
"ofrak",
"ofrak_type",
"ofrak_type~=2.0",
"immutabledict==2.2.0",
"python-magic",
],
Expand Down Expand Up @@ -62,4 +61,5 @@ def run(self):
license="Proprietary",
license_files=["LICENSE"],
cmdclass={"egg_info": egg_info_ex},
include_package_data=True,
)
2 changes: 1 addition & 1 deletion ofrak_type/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def run(self):

setuptools.setup(
name="ofrak_type",
version="1.0.0",
version="2.0.0",
description="Custom classes and types used in OFRAK",
package_data={
"ofrak_type": ["py.typed"],
Expand Down

0 comments on commit 8ab2a86

Please sign in to comment.