Remove stray whitespace
This commit is contained in:
parent
86d0fac206
commit
8ede1e2ddc
@ -191,7 +191,7 @@ class DeepState(object):
|
|||||||
"""Find the test case descriptors."""
|
"""Find the test case descriptors."""
|
||||||
tests = []
|
tests = []
|
||||||
info_ea, _ = self.read_uintptr_t(self.context['apis']['LastTestInfo'])
|
info_ea, _ = self.read_uintptr_t(self.context['apis']['LastTestInfo'])
|
||||||
|
|
||||||
while info_ea:
|
while info_ea:
|
||||||
test, info_ea = self._read_test_info(info_ea)
|
test, info_ea = self._read_test_info(info_ea)
|
||||||
if test:
|
if test:
|
||||||
@ -219,7 +219,7 @@ class DeepState(object):
|
|||||||
self.context['log'] = []
|
self.context['log'] = []
|
||||||
for level in LOG_LEVEL_TO_LOGGER:
|
for level in LOG_LEVEL_TO_LOGGER:
|
||||||
self.context['stream_{}'.format(level)] = []
|
self.context['stream_{}'.format(level)] = []
|
||||||
|
|
||||||
self.context['info'] = info
|
self.context['info'] = info
|
||||||
self.log_message(LOG_LEVEL_INFO, "Running {} from {}({})".format(
|
self.log_message(LOG_LEVEL_INFO, "Running {} from {}({})".format(
|
||||||
info.name, info.file_name, info.line_number))
|
info.name, info.file_name, info.line_number))
|
||||||
@ -294,7 +294,7 @@ class DeepState(object):
|
|||||||
val = struct.unpack(unpack_str, data)[0]
|
val = struct.unpack(unpack_str, data)[0]
|
||||||
else:
|
else:
|
||||||
assert val_type == int
|
assert val_type == int
|
||||||
|
|
||||||
# TODO(pag): I am pretty sure that this is wrong for big-endian.
|
# TODO(pag): I am pretty sure that this is wrong for big-endian.
|
||||||
data = struct.pack('BBBBBBBB', *val_bytes)
|
data = struct.pack('BBBBBBBB', *val_bytes)
|
||||||
val = struct.unpack(unpack_str, data[:struct.calcsize(unpack_str)])[0]
|
val = struct.unpack(unpack_str, data[:struct.calcsize(unpack_str)])[0]
|
||||||
@ -340,7 +340,7 @@ class DeepState(object):
|
|||||||
info = self.context['info']
|
info = self.context['info']
|
||||||
apis = self.context['apis']
|
apis = self.context['apis']
|
||||||
input_length, _ = self.read_uint32_t(apis['InputIndex'])
|
input_length, _ = self.read_uint32_t(apis['InputIndex'])
|
||||||
|
|
||||||
symbols = self.context['symbols']
|
symbols = self.context['symbols']
|
||||||
|
|
||||||
# Check to see if the test case actually read too many 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
|
"""Notify the symbolic executor that this test has been abandoned due to
|
||||||
some critical error and stop executing the current state."""
|
some critical error and stop executing the current state."""
|
||||||
self.context['abandoned'] = True
|
self.context['abandoned'] = True
|
||||||
|
|
||||||
def api_min_uint(self, arg):
|
def api_min_uint(self, arg):
|
||||||
"""Implements the `DeepState_MinUInt` API function, which returns the
|
"""Implements the `DeepState_MinUInt` API function, which returns the
|
||||||
minimum satisfiable value for `arg`."""
|
minimum satisfiable value for `arg`."""
|
||||||
@ -417,7 +417,7 @@ class DeepState(object):
|
|||||||
self.abandon_test()
|
self.abandon_test()
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
||||||
constraint = arg != 0
|
constraint = arg != 0
|
||||||
if not self.add_constraint(constraint):
|
if not self.add_constraint(constraint):
|
||||||
expr, _ = self.read_c_string(expr_ea, concretize=False)
|
expr, _ = self.read_c_string(expr_ea, concretize=False)
|
||||||
@ -500,7 +500,7 @@ class DeepState(object):
|
|||||||
ea = self.concretize(ea, constrain=True)
|
ea = self.concretize(ea, constrain=True)
|
||||||
assert level in LOG_LEVEL_TO_LOGGER
|
assert level in LOG_LEVEL_TO_LOGGER
|
||||||
self.log_message(level, self.read_c_string(ea, concretize=False)[0])
|
self.log_message(level, self.read_c_string(ea, concretize=False)[0])
|
||||||
|
|
||||||
if level == LOG_LEVEL_FATAL:
|
if level == LOG_LEVEL_FATAL:
|
||||||
self.api_fail()
|
self.api_fail()
|
||||||
elif level == LOG_LEVEL_ERROR:
|
elif level == LOG_LEVEL_ERROR:
|
||||||
@ -551,7 +551,7 @@ class DeepState(object):
|
|||||||
str_ea = self.concretize(str_ea, constrain=True)
|
str_ea = self.concretize(str_ea, constrain=True)
|
||||||
format_str = self.read_c_string(format_ea)[0]
|
format_str = self.read_c_string(format_ea)[0]
|
||||||
print_str = self.read_c_string(str_ea, concretize=False)[0]
|
print_str = self.read_c_string(str_ea, concretize=False)[0]
|
||||||
|
|
||||||
stream_id = 'stream_{}'.format(level)
|
stream_id = 'stream_{}'.format(level)
|
||||||
stream = list(self.context[stream_id])
|
stream = list(self.context[stream_id])
|
||||||
stream.append((str, format_str, None, print_str))
|
stream.append((str, format_str, None, print_str))
|
||||||
|
|||||||
@ -265,7 +265,7 @@ def do_run_test(project, test, apis, run_state):
|
|||||||
mc = DeepAngr(state=test_state)
|
mc = DeepAngr(state=test_state)
|
||||||
mc.begin_test(test)
|
mc.begin_test(test)
|
||||||
del mc
|
del mc
|
||||||
|
|
||||||
errored = []
|
errored = []
|
||||||
test_manager = angr.SimulationManager(
|
test_manager = angr.SimulationManager(
|
||||||
project=project,
|
project=project,
|
||||||
|
|||||||
@ -272,7 +272,7 @@ def do_run_test(state, apis, test):
|
|||||||
mc = DeepManticore(state)
|
mc = DeepManticore(state)
|
||||||
mc.begin_test(test)
|
mc.begin_test(test)
|
||||||
del mc
|
del mc
|
||||||
|
|
||||||
m.add_hook(apis['IsSymbolicUInt'], hook(hook_IsSymbolicUInt))
|
m.add_hook(apis['IsSymbolicUInt'], hook(hook_IsSymbolicUInt))
|
||||||
m.add_hook(apis['ConcretizeData'], hook(hook_ConcretizeData))
|
m.add_hook(apis['ConcretizeData'], hook(hook_ConcretizeData))
|
||||||
m.add_hook(apis['ConcretizeCStr'], hook(hook_ConcretizeCStr))
|
m.add_hook(apis['ConcretizeCStr'], hook(hook_ConcretizeCStr))
|
||||||
@ -308,7 +308,7 @@ def run_tests(args, state, apis):
|
|||||||
results = []
|
results = []
|
||||||
mc = DeepManticore(state)
|
mc = DeepManticore(state)
|
||||||
tests = mc.find_test_cases()
|
tests = mc.find_test_cases()
|
||||||
|
|
||||||
L.info("Running {} tests across {} workers".format(
|
L.info("Running {} tests across {} workers".format(
|
||||||
len(tests), args.num_workers))
|
len(tests), args.num_workers))
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ def main():
|
|||||||
|
|
||||||
m.verbosity(1)
|
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_type = 'not elf'
|
||||||
m._binary_obj = m._initial_state.platform.elf
|
m._binary_obj = m._initial_state.platform.elf
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ def main():
|
|||||||
if not ea_of_api_table:
|
if not ea_of_api_table:
|
||||||
L.critical("Could not find API table in binary `{}`".format(args.binary))
|
L.critical("Could not find API table in binary `{}`".format(args.binary))
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
apis = mc.read_api_table(ea_of_api_table)
|
apis = mc.read_api_table(ea_of_api_table)
|
||||||
del mc
|
del mc
|
||||||
m.add_hook(setup_ea, lambda state: run_tests(args, state, apis))
|
m.add_hook(setup_ea, lambda state: run_tests(args, state, apis))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user