From ab0abf7f72ad2b80dab37a7b1c912650bcc1a02c Mon Sep 17 00:00:00 2001 From: Mark Mossberg Date: Fri, 3 Mar 2017 18:22:04 -0500 Subject: [PATCH] Refactor `new_symbolic_value` (#48) * Use default params instead of dict, add taint * Update docstring --- manticore/core/executor.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/manticore/core/executor.py b/manticore/core/executor.py index 6c10a19..b03f1e6 100644 --- a/manticore/core/executor.py +++ b/manticore/core/executor.py @@ -200,22 +200,21 @@ class State(object): return expr - def new_symbolic_value(self, nbits, **options): + def new_symbolic_value(self, nbits, label='val', taint=frozenset()): '''Create and return a symbolic value that is |nbits| bits wide. Assign the value to a register or write it into the address space to introduce it into the program state. Args: nbits - The bitwidth of the value returned. - options - Options to set on the returned expression. Valid options: - label -- The label to assign to the value. + label - The label to assign to the value. + taint - A tuple or frozenset of values to use as taint identifiers. Returns: Expression representing the value. ''' assert nbits in (1, 4, 8, 16, 32, 64, 128, 256) - name = options.get('label', 'val') - expr = self.constraints.new_bitvec(nbits, name=name) + expr = self.constraints.new_bitvec(nbits, name=label, taint=taint) self.input_symbols.append(expr) return expr