From 63bb72b41a224e04cdd06e2bf4ac6a441d494efe Mon Sep 17 00:00:00 2001 From: Helvio Junior Date: Wed, 12 Apr 2023 09:32:43 -0300 Subject: [PATCH] Code cave size --- shellcodetester/args.py | 8 ++++++++ shellcodetester/config.py | 2 ++ 2 files changed, 10 insertions(+) diff --git a/shellcodetester/args.py b/shellcodetester/args.py index c3719cc..e1d71d5 100644 --- a/shellcodetester/args.py +++ b/shellcodetester/args.py @@ -70,6 +70,14 @@ def _add_custom_args(self, custom): type=str, help=Color.s('List of bad chars to highlight (ex: {G}\\x00\\x0a{W}, default: {G}\\0x00{W})')) + custom.add_argument('--cave-size', + action='store', + dest='cave_size', + metavar='[size]', + type=int, + default=1024, + help=Color.s('Code cave size (default: {G}1024{W})')) + custom.add_argument('--fill-with-nop', action='store_true', default=False, diff --git a/shellcodetester/config.py b/shellcodetester/config.py index e37352d..0c0cce7 100644 --- a/shellcodetester/config.py +++ b/shellcodetester/config.py @@ -119,10 +119,12 @@ def load_from_arguments(): if args.out_file: Configuration.out_file = args.out_file + Configuration.cave_size = int(args.cave_size) Configuration.breakpoint = args.breakpoint Configuration.fill = args.fill Configuration.transform_format = Transform.parse_format(args.transform_format) + Logger.pl(' {C}code cave size:{O} %s{W}' % Configuration.cave_size) Logger.pl(' {C}transform format:{O} %s{W}' % (Transform.get_name(Configuration.transform_format))) if len(Configuration.bad_chars) > 0: