From 0e028487596091afb3ea1035f7f78ef7661c9c6e Mon Sep 17 00:00:00 2001 From: Malfurious Date: Fri, 12 Jan 2024 06:34:38 -0500 Subject: rev: Expose modules' contents through package This is the start of an overarching change meant to simplify sploit library imports. In general, all packages (directories) are intended to export all the classes, methods, and variables of their contained modules. This way users need only import the package, which leads to less verbose import statements (and usually fewer import statements). We would still like to gate objects behind their respective packages, rather than providing the whole world with `from sploit import *` so that users can still have some amount of control over what is brought into their global namespace. Beware: For code internal to sploit, full module imports should probably continue to be used. Otherwise, there is a possibility for circular imports if two modules from two packages cross import. Signed-off-by: Malfurious --- sploit/rev/__init__.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'sploit/rev') diff --git a/sploit/rev/__init__.py b/sploit/rev/__init__.py index 0d0dc9b..42e2f5b 100644 --- a/sploit/rev/__init__.py +++ b/sploit/rev/__init__.py @@ -1,6 +1,4 @@ -from . import ( - elf, - gadget, - ldd, - r2, -) +from .elf import * +from .gadget import * +from .ldd import * +from .r2 import * -- cgit v1.2.3 From ead4ec1340555569e00919891383e05dca839b01 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Fri, 12 Jan 2024 14:28:26 -0500 Subject: util: Promote from module to package We would like to move additional modules under the namespace of "util" to clean up the top-level "sploit" package. To start, the functions from the previous util module are moved. Given the package is named "util" the module is renamed to "cmd" to somewhat match the theme of the contained functions. Per the previous commits, these functions are now exposed via the util package as well. Signed-off-by: Malfurious --- sploit/rev/ldd.py | 2 +- sploit/rev/r2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sploit/rev') diff --git a/sploit/rev/ldd.py b/sploit/rev/ldd.py index 1a28c7c..b5bc564 100644 --- a/sploit/rev/ldd.py +++ b/sploit/rev/ldd.py @@ -1,4 +1,4 @@ -from sploit.util import run_cmd_cached +from sploit.util.cmd import run_cmd_cached from sploit.log import ilog import re diff --git a/sploit/rev/r2.py b/sploit/rev/r2.py index 1be731c..d9dbabd 100644 --- a/sploit/rev/r2.py +++ b/sploit/rev/r2.py @@ -2,7 +2,7 @@ from sploit.arch import arch from sploit.log import ilog from sploit.rev.gadget import Gadget from sploit.symtbl import Symtbl -from sploit.util import run_cmd_cached +from sploit.util.cmd import run_cmd_cached from collections import namedtuple as nt from functools import cache -- cgit v1.2.3 From 074a15310b8bbeeeeb00bf5ab5877c12f1ca1861 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Fri, 12 Jan 2024 16:26:03 -0500 Subject: log: Move to sploit.util package Signed-off-by: Malfurious --- sploit/rev/ldd.py | 2 +- sploit/rev/r2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sploit/rev') diff --git a/sploit/rev/ldd.py b/sploit/rev/ldd.py index b5bc564..b773abf 100644 --- a/sploit/rev/ldd.py +++ b/sploit/rev/ldd.py @@ -1,5 +1,5 @@ from sploit.util.cmd import run_cmd_cached -from sploit.log import ilog +from sploit.util.log import ilog import re from collections import namedtuple as nt diff --git a/sploit/rev/r2.py b/sploit/rev/r2.py index d9dbabd..e81adc9 100644 --- a/sploit/rev/r2.py +++ b/sploit/rev/r2.py @@ -1,8 +1,8 @@ from sploit.arch import arch -from sploit.log import ilog from sploit.rev.gadget import Gadget from sploit.symtbl import Symtbl from sploit.util.cmd import run_cmd_cached +from sploit.util.log import ilog from collections import namedtuple as nt from functools import cache -- cgit v1.2.3