From af0b8022581f016bd3f45e1d088e95c85308ed5f Mon Sep 17 00:00:00 2001 From: Maximilian Lindner <46794237+SR4ven@users.noreply.github.com> Date: Sun, 24 Sep 2023 16:55:53 +0200 Subject: [PATCH] Reformat with current black version (#686) --- boofuzz/pgraph/cluster.py | 1 - boofuzz/primitives/float.py | 1 - boofuzz/primitives/from_file.py | 1 - boofuzz/sessions.py | 1 - boofuzz/utils/crash_binning.py | 10 +++++----- boofuzz/utils/debugger_thread_pydbg.py | 2 +- boofuzz/utils/debugger_thread_simple.py | 2 +- request_definitions/hp.py | 1 - utils/ida_fuzz_library_extender.py | 3 --- utils/pdml_parser.py | 1 - 10 files changed, 7 insertions(+), 16 deletions(-) diff --git a/boofuzz/pgraph/cluster.py b/boofuzz/pgraph/cluster.py index 2da7c71a..c08573dc 100644 --- a/boofuzz/pgraph/cluster.py +++ b/boofuzz/pgraph/cluster.py @@ -15,7 +15,6 @@ class Cluster: - id = None nodes = [] diff --git a/boofuzz/primitives/float.py b/boofuzz/primitives/float.py index 435afc4f..4c131f8f 100644 --- a/boofuzz/primitives/float.py +++ b/boofuzz/primitives/float.py @@ -41,7 +41,6 @@ def __init__( *args, **kwargs ): - super(Float, self).__init__(name=name, default_value=str(default_value), *args, **kwargs) self.s_format = s_format diff --git a/boofuzz/primitives/from_file.py b/boofuzz/primitives/from_file.py index 85be585f..4a587c3d 100644 --- a/boofuzz/primitives/from_file.py +++ b/boofuzz/primitives/from_file.py @@ -24,7 +24,6 @@ class FromFile(BasePrimitive): """ def __init__(self, name=None, default_value=b"", filename=None, max_len=0, *args, **kwargs): - super(FromFile, self).__init__(name=name, default_value=default_value, *args, **kwargs) self._filename = filename diff --git a/boofuzz/sessions.py b/boofuzz/sessions.py index 0a1c7059..32cf83f4 100644 --- a/boofuzz/sessions.py +++ b/boofuzz/sessions.py @@ -861,7 +861,6 @@ def _check_for_passively_detected_failures(self, target, failure_already_detecte self._fuzz_data_logger.log_pass("No crash detected.") else: for monitor in set(target.monitors) - set(finished_monitors): - synopsis = monitor.get_crash_synopsis() if len(synopsis) > 0: self._fuzz_data_logger.log_fail( diff --git a/boofuzz/utils/crash_binning.py b/boofuzz/utils/crash_binning.py index 4a0837c7..1c570be4 100644 --- a/boofuzz/utils/crash_binning.py +++ b/boofuzz/utils/crash_binning.py @@ -159,7 +159,7 @@ def crash_synopsis(self, crash=None): synopsis += crash.context_dump synopsis += "\ndisasm around:\n" - for (ea, inst) in crash.disasm_around: + for ea, inst in crash.disasm_around: synopsis += "\t0x%08x %s\n" % (ea, inst) if len(crash.stack_unwind): @@ -169,7 +169,7 @@ def crash_synopsis(self, crash=None): if len(crash.seh_unwind): synopsis += "\nSEH unwind:\n" - for (addr, handler, handler_str) in crash.seh_unwind: + for addr, handler, handler_str in crash.seh_unwind: synopsis += "\t%08x -> %s\n" % (addr, handler_str) return synopsis + "\n" @@ -215,7 +215,7 @@ def import_file(self, file_name): self.bins = {} bin_dict = json.load(open(file_name, "rb")) - for (crash_address, bin_list) in bin_dict.items(): + for crash_address, bin_list in bin_dict.items(): self.bins[crash_address] = [] for single_bin in bin_list: tmp = CrashBinStruct() @@ -252,7 +252,7 @@ def last_crash_synopsis(self): synopsis += self.last_crash.context_dump synopsis += "\ndisasm around:\n" - for (ea, inst) in self.last_crash.disasm_around: + for ea, inst in self.last_crash.disasm_around: synopsis += "\t0x%08x %s\n" % (ea, inst) if len(self.last_crash.stack_unwind): @@ -262,7 +262,7 @@ def last_crash_synopsis(self): if len(self.last_crash.seh_unwind): synopsis += "\nSEH unwind:\n" - for (addr, handler, handler_str) in self.last_crash.seh_unwind: + for addr, handler, handler_str in self.last_crash.seh_unwind: try: disasm = self.pydbg.disasm(handler) except Exception: diff --git a/boofuzz/utils/debugger_thread_pydbg.py b/boofuzz/utils/debugger_thread_pydbg.py index 0d414208..83ea331f 100644 --- a/boofuzz/utils/debugger_thread_pydbg.py +++ b/boofuzz/utils/debugger_thread_pydbg.py @@ -157,7 +157,7 @@ def _scan_proc_names_blocking(self): return pid def _scan_proc_names_once(self): - for (pid, name) in self.dbg.enumerate_processes(): + for pid, name in self.dbg.enumerate_processes(): if name.lower() == self.proc_name.lower() and pid != self.ignore_pid: return pid return None diff --git a/boofuzz/utils/debugger_thread_simple.py b/boofuzz/utils/debugger_thread_simple.py index e067f312..3b1080eb 100644 --- a/boofuzz/utils/debugger_thread_simple.py +++ b/boofuzz/utils/debugger_thread_simple.py @@ -194,7 +194,7 @@ def watch(self): """ self.pid = None while not self.pid: - for (pid, name) in _enumerate_processes(): + for pid, name in _enumerate_processes(): # ignore the optionally specified PID. if pid == self.ignore_pid: continue diff --git a/request_definitions/hp.py b/request_definitions/hp.py index 4fd8824e..6976fbc3 100644 --- a/request_definitions/hp.py +++ b/request_definitions/hp.py @@ -30,7 +30,6 @@ def unicode_ftw(val): s_block_end() if s_block_start("packet_2"): - # unicode byte order marker s_static("\xfe\xff") diff --git a/utils/ida_fuzz_library_extender.py b/utils/ida_fuzz_library_extender.py index 40745da0..bb29b1e5 100644 --- a/utils/ida_fuzz_library_extender.py +++ b/utils/ida_fuzz_library_extender.py @@ -69,7 +69,6 @@ def find_ints(start_address): # loop heads for head in Heads(start_address, SegEnd(start_address)): - # if it's code, check for cmp instruction if isCode(GetFlags(head)): mnem = GetMnem(head) @@ -100,7 +99,6 @@ def find_strings(start_address): xref_start = import_ea xref_cur = DfirstB(xref_start) while xref_cur != BADADDR: - # print("Found call to ", import_name) string_arg = get_arguments(xref_cur) @@ -119,7 +117,6 @@ def find_strings(start_address): lib_name = GetFunctionName(function_ea) if len(lib_name) > 1 and "cmp" in lib_name: - # found one, now find xrefs to it and grab arguments xref_start = function_ea xref_cur = RfirstB(xref_start) diff --git a/utils/pdml_parser.py b/utils/pdml_parser.py index fc8db7e1..2e86d307 100644 --- a/utils/pdml_parser.py +++ b/utils/pdml_parser.py @@ -20,7 +20,6 @@ def startElement(self, name, attributes): # if parsing flag is set, we're past tcp if self.start_parsing: - if not name == "field": print("Found payload with name %s" % attributes["name"]) elif name == "field":