From 8ede1e2ddcf1b5544a7e0cd3354e11688e235aab Mon Sep 17 00:00:00 2001 From: Joe Ranweiler Date: Tue, 13 Feb 2018 15:20:59 -0800 Subject: [PATCH] Remove stray whitespace --- bin/deepstate/common.py | 16 ++++++++-------- bin/deepstate/main_angr.py | 2 +- bin/deepstate/main_manticore.py | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bin/deepstate/common.py b/bin/deepstate/common.py index cb9a88c..f118da3 100644 --- a/bin/deepstate/common.py +++ b/bin/deepstate/common.py @@ -191,7 +191,7 @@ class DeepState(object): """Find the test case descriptors.""" tests = [] info_ea, _ = self.read_uintptr_t(self.context['apis']['LastTestInfo']) - + while info_ea: test, info_ea = self._read_test_info(info_ea) if test: @@ -219,7 +219,7 @@ class DeepState(object): self.context['log'] = [] for level in LOG_LEVEL_TO_LOGGER: self.context['stream_{}'.format(level)] = [] - + self.context['info'] = info self.log_message(LOG_LEVEL_INFO, "Running {} from {}({})".format( info.name, info.file_name, info.line_number)) @@ -294,7 +294,7 @@ class DeepState(object): val = struct.unpack(unpack_str, data)[0] else: assert val_type == int - + # TODO(pag): I am pretty sure that this is wrong for big-endian. data = struct.pack('BBBBBBBB', *val_bytes) val = struct.unpack(unpack_str, data[:struct.calcsize(unpack_str)])[0] @@ -340,7 +340,7 @@ class DeepState(object): info = self.context['info'] apis = self.context['apis'] input_length, _ = self.read_uint32_t(apis['InputIndex']) - + symbols = self.context['symbols'] # Check to see if the test case actually read too many symbols. @@ -384,7 +384,7 @@ class DeepState(object): """Notify the symbolic executor that this test has been abandoned due to some critical error and stop executing the current state.""" self.context['abandoned'] = True - + def api_min_uint(self, arg): """Implements the `DeepState_MinUInt` API function, which returns the minimum satisfiable value for `arg`.""" @@ -417,7 +417,7 @@ class DeepState(object): self.abandon_test() else: return - + constraint = arg != 0 if not self.add_constraint(constraint): expr, _ = self.read_c_string(expr_ea, concretize=False) @@ -500,7 +500,7 @@ class DeepState(object): ea = self.concretize(ea, constrain=True) assert level in LOG_LEVEL_TO_LOGGER self.log_message(level, self.read_c_string(ea, concretize=False)[0]) - + if level == LOG_LEVEL_FATAL: self.api_fail() elif level == LOG_LEVEL_ERROR: @@ -551,7 +551,7 @@ class DeepState(object): str_ea = self.concretize(str_ea, constrain=True) format_str = self.read_c_string(format_ea)[0] print_str = self.read_c_string(str_ea, concretize=False)[0] - + stream_id = 'stream_{}'.format(level) stream = list(self.context[stream_id]) stream.append((str, format_str, None, print_str)) diff --git a/bin/deepstate/main_angr.py b/bin/deepstate/main_angr.py index 30bf579..bcac38c 100644 --- a/bin/deepstate/main_angr.py +++ b/bin/deepstate/main_angr.py @@ -265,7 +265,7 @@ def do_run_test(project, test, apis, run_state): mc = DeepAngr(state=test_state) mc.begin_test(test) del mc - + errored = [] test_manager = angr.SimulationManager( project=project, diff --git a/bin/deepstate/main_manticore.py b/bin/deepstate/main_manticore.py index d53eadf..05b3f68 100644 --- a/bin/deepstate/main_manticore.py +++ b/bin/deepstate/main_manticore.py @@ -272,7 +272,7 @@ def do_run_test(state, apis, test): mc = DeepManticore(state) mc.begin_test(test) del mc - + m.add_hook(apis['IsSymbolicUInt'], hook(hook_IsSymbolicUInt)) m.add_hook(apis['ConcretizeData'], hook(hook_ConcretizeData)) m.add_hook(apis['ConcretizeCStr'], hook(hook_ConcretizeCStr)) @@ -308,7 +308,7 @@ def run_tests(args, state, apis): results = [] mc = DeepManticore(state) tests = mc.find_test_cases() - + L.info("Running {} tests across {} workers".format( len(tests), args.num_workers)) @@ -334,7 +334,7 @@ def main(): m.verbosity(1) - # Hack to get around current broken _get_symbol_address + # Hack to get around current broken _get_symbol_address m._binary_type = 'not elf' m._binary_obj = m._initial_state.platform.elf @@ -352,7 +352,7 @@ def main(): if not ea_of_api_table: L.critical("Could not find API table in binary `{}`".format(args.binary)) return 1 - + apis = mc.read_api_table(ea_of_api_table) del mc m.add_hook(setup_ea, lambda state: run_tests(args, state, apis))