prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  ClaripyZeroDivisionError without actual zero
  When stepping through a BB with symbolic registers, 
  division by symbolic register causes state.step() to fail with ClaripyZeroDivisionError.
  
  Example binary [MALWARE!!!]: https://www.dropbox.com/s/n9drwyle246ai86/E022DE72CCE8129BD5AC8A0675996318?dl=0
  
  
  Example code:
  
  ```
  # coding=utf-8
  import angr
  p = angr.Project('E022DE72CCE8129BD5AC8A0675996318', load_options={"auto_load_libs": False})
  rebase_delta = p.loader.main_object.image_base_delta
  start_state = p.factory.blank_state(addr=rebase_delta + 0x4470)
  start_state.step()
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `angr/concretization_strategies/__init__.py`
  Content:
  ```
  1 class SimConcretizationStrategy(object):
  2     """
  3     Concretization strategies control the resolution of symbolic memory indices
  4     in SimuVEX. By subclassing this class and setting it as a concretization strategy
  5     (on state.memory.read_strategies and state.memory.write_strategies), SimuVEX's
  6     memory index concretization behavior can be modified.
  7     """
  8 
  9     def __init__(self, filter=None, exact=True): #pylint:disable=redefined-builtin
  10         """
  11         Initializes the base SimConcretizationStrategy.
  12 
  13         :param filter: A function, taking arguments of (SimMemory, claripy.AST) that determins
  14                        if this strategy can handle resolving the provided AST.
  15         :param exact: A flag (default: True) that determines if the convenience resolution
  16                       functions provided by this class use exact or approximate resolution.
  17         """
  18         self._exact = exact
  19         self._filter = filter
  20 
  21     def _min(self, memory, addr, **kwargs):
  22         """
  23         Gets the minimum solution of an address.
  24         """
  25         return memory.state.se.min(addr, exact=kwargs.pop('exact', self._exact), **kwargs)
  26 
  27     def _max(self, memory, addr, **kwargs):
  28         """
  29         Gets the maximum solution of an address.
  30         """
  31         return memory.state.se.max(addr, exact=kwargs.pop('exact', self._exact), **kwargs)
  32 
  33     def _any(self, memory, addr, **kwargs):
  34         """
  35         Gets any solution of an address.
  36         """
  37         return memory.state.se.eval(addr, exact=kwargs.pop('exact', self._exact), **kwargs)
  38 
  39     def _eval(self, memory, addr, n, **kwargs):
  40         """
  41         Gets n solutions for an address.
  42         """
  43         return memory.state.se.eval_upto(addr, n, exact=kwargs.pop('exact', self._exact), **kwargs)
  44 
  45     def _range(self, memory, addr, **kwargs):
  46         """
  47         Gets the (min, max) range of solutions for an address.
  48         """
  49         return (self._min(memory, addr, **kwargs), self._max(memory, addr, **kwargs))
  50 
  51     def concretize(self, memory, addr):
  52         """
  53         Concretizes the address into a list of values.
  54         If this strategy cannot handle this address, returns None.
  55         """
  56         if self._filter is None or self._filter(memory, addr):
  57             return self._concretize(memory, addr)
  58 
  59     def _concretize(self, memory, addr):
  60         """
  61         Should be implemented by child classes to handle concretization.
  62         """
  63         raise NotImplementedError()
  64 
  65     def copy(self):
  66         """
  67         Returns a copy of the strategy, if there is data that should be kept separate between
  68         states. If not, returns self.
  69         """
  70         return self
  71 
  72     def merge(self, others):
  73         """
  74         Merges this strategy with others (if there is data that should be kept separate between
  75         states. If not, is a no-op.
  76         """
  77         pass
  78 
  79 from .any import SimConcretizationStrategyAny
  80 from .controlled_data import SimConcretizationStrategyControlledData
  81 from .eval import SimConcretizationStrategyEval
  82 from .max import SimConcretizationStrategyMax
  83 from .nonzero import SimConcretizationStrategyNonzero
  84 from .nonzero_range import SimConcretizationStrategyNonzeroRange
  85 from .norepeats import SimConcretizationStrategyNorepeats
  86 from .norepeats_range import SimConcretizationStrategyNorepeatsRange
  87 from .range import SimConcretizationStrategyRange
  88 from .single import SimConcretizationStrategySingle
  89 from .solutions import SimConcretizationStrategySolutions
  90
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/angr/concretization_strategies/__init__.py b/angr/concretization_strategies/__init__.py
  --- a/angr/concretization_strategies/__init__.py
  +++ b/angr/concretization_strategies/__init__.py
  @@ -1,3 +1,5 @@
  +import claripy
  +
   class SimConcretizationStrategy(object):
       """
       Concretization strategies control the resolution of symbolic memory indices
  @@ -18,29 +20,41 @@
           self._exact = exact
           self._filter = filter
   
  +    @staticmethod
  +    def _tweak(addr, kwargs):
  +        """
  +        Utility method used from in here that adds a bogus constraint to extra_constraints making it so that the addr
  +        expression can actually be evaluated in all cases
  +        """
  +        kwargs['extra_constraints'] = kwargs.get('extra_constraints', ()) + (addr == claripy.BVS('TEMP', len(addr)),)
  +
       def _min(self, memory, addr, **kwargs):
           """
           Gets the minimum solution of an address.
           """
  -        return memory.state.se.min(addr, exact=kwargs.pop('exact', self._exact), **kwargs)
  +        self._tweak(addr, kwargs)
  +        return memory.state.solver.min(addr, exact=kwargs.pop('exact', self._exact), **kwargs)
   
       def _max(self, memory, addr, **kwargs):
           """
           Gets the maximum solution of an address.
           """
  -        return memory.state.se.max(addr, exact=kwargs.pop('exact', self._exact), **kwargs)
  +        self._tweak(addr, kwargs)
  +        return memory.state.solver.max(addr, exact=kwargs.pop('exact', self._exact), **kwargs)
   
       def _any(self, memory, addr, **kwargs):
           """
           Gets any solution of an address.
           """
  -        return memory.state.se.eval(addr, exact=kwargs.pop('exact', self._exact), **kwargs)
  +        self._tweak(addr, kwargs)
  +        return memory.state.solver.eval(addr, exact=kwargs.pop('exact', self._exact), **kwargs)
   
       def _eval(self, memory, addr, n, **kwargs):
           """
           Gets n solutions for an address.
           """
  -        return memory.state.se.eval_upto(addr, n, exact=kwargs.pop('exact', self._exact), **kwargs)
  +        self._tweak(addr, kwargs)
  +        return memory.state.solver.eval_upto(addr, n, exact=kwargs.pop('exact', self._exact), **kwargs)
   
       def _range(self, memory, addr, **kwargs):
           """
  
verification_info: {"golden_diff": "diff --git a/angr/concretization_strategies/__init__.py b/angr/concretization_strategies/__init__.py\n--- a/angr/concretization_strategies/__init__.py\n+++ b/angr/concretization_strategies/__init__.py\n@@ -1,3 +1,5 @@\n+import claripy\n+\n class SimConcretizationStrategy(object):\n     \"\"\"\n     Concretization strategies control the resolution of symbolic memory indices\n@@ -18,29 +20,41 @@\n         self._exact = exact\n         self._filter = filter\n \n+    @staticmethod\n+    def _tweak(addr, kwargs):\n+        \"\"\"\n+        Utility method used from in here that adds a bogus constraint to extra_constraints making it so that the addr\n+        expression can actually be evaluated in all cases\n+        \"\"\"\n+        kwargs['extra_constraints'] = kwargs.get('extra_constraints', ()) + (addr == claripy.BVS('TEMP', len(addr)),)\n+\n     def _min(self, memory, addr, **kwargs):\n         \"\"\"\n         Gets the minimum solution of an address.\n         \"\"\"\n-        return memory.state.se.min(addr, exact=kwargs.pop('exact', self._exact), **kwargs)\n+        self._tweak(addr, kwargs)\n+        return memory.state.solver.min(addr, exact=kwargs.pop('exact', self._exact), **kwargs)\n \n     def _max(self, memory, addr, **kwargs):\n         \"\"\"\n         Gets the maximum solution of an address.\n         \"\"\"\n-        return memory.state.se.max(addr, exact=kwargs.pop('exact', self._exact), **kwargs)\n+        self._tweak(addr, kwargs)\n+        return memory.state.solver.max(addr, exact=kwargs.pop('exact', self._exact), **kwargs)\n \n     def _any(self, memory, addr, **kwargs):\n         \"\"\"\n         Gets any solution of an address.\n         \"\"\"\n-        return memory.state.se.eval(addr, exact=kwargs.pop('exact', self._exact), **kwargs)\n+        self._tweak(addr, kwargs)\n+        return memory.state.solver.eval(addr, exact=kwargs.pop('exact', self._exact), **kwargs)\n \n     def _eval(self, memory, addr, n, **kwargs):\n         \"\"\"\n         Gets n solutions for an address.\n         \"\"\"\n-        return memory.state.se.eval_upto(addr, n, exact=kwargs.pop('exact', self._exact), **kwargs)\n+        self._tweak(addr, kwargs)\n+        return memory.state.solver.eval_upto(addr, n, exact=kwargs.pop('exact', self._exact), **kwargs)\n \n     def _range(self, memory, addr, **kwargs):\n         \"\"\"\n", "issue": "ClaripyZeroDivisionError without actual zero\nWhen stepping through a BB with symbolic registers, \r\ndivision by symbolic register causes state.step() to fail with ClaripyZeroDivisionError.\r\n\r\nExample binary [MALWARE!!!]: https://www.dropbox.com/s/n9drwyle246ai86/E022DE72CCE8129BD5AC8A0675996318?dl=0\r\n\r\n\r\nExample code:\r\n\r\n```\r\n# coding=utf-8\r\nimport angr\r\np = angr.Project('E022DE72CCE8129BD5AC8A0675996318', load_options={\"auto_load_libs\": False})\r\nrebase_delta = p.loader.main_object.image_base_delta\r\nstart_state = p.factory.blank_state(addr=rebase_delta + 0x4470)\r\nstart_state.step()\r\n```\n", "before_files": [{"content": "class SimConcretizationStrategy(object):\n    \"\"\"\n    Concretization strategies control the resolution of symbolic memory indices\n    in SimuVEX. By subclassing this class and setting it as a concretization strategy\n    (on state.memory.read_strategies and state.memory.write_strategies), SimuVEX's\n    memory index concretization behavior can be modified.\n    \"\"\"\n\n    def __init__(self, filter=None, exact=True): #pylint:disable=redefined-builtin\n        \"\"\"\n        Initializes the base SimConcretizationStrategy.\n\n        :param filter: A function, taking arguments of (SimMemory, claripy.AST) that determins\n                       if this strategy can handle resolving the provided AST.\n        :param exact: A flag (default: True) that determines if the convenience resolution\n                      functions provided by this class use exact or approximate resolution.\n        \"\"\"\n        self._exact = exact\n        self._filter = filter\n\n    def _min(self, memory, addr, **kwargs):\n        \"\"\"\n        Gets the minimum solution of an address.\n        \"\"\"\n        return memory.state.se.min(addr, exact=kwargs.pop('exact', self._exact), **kwargs)\n\n    def _max(self, memory, addr, **kwargs):\n        \"\"\"\n        Gets the maximum solution of an address.\n        \"\"\"\n        return memory.state.se.max(addr, exact=kwargs.pop('exact', self._exact), **kwargs)\n\n    def _any(self, memory, addr, **kwargs):\n        \"\"\"\n        Gets any solution of an address.\n        \"\"\"\n        return memory.state.se.eval(addr, exact=kwargs.pop('exact', self._exact), **kwargs)\n\n    def _eval(self, memory, addr, n, **kwargs):\n        \"\"\"\n        Gets n solutions for an address.\n        \"\"\"\n        return memory.state.se.eval_upto(addr, n, exact=kwargs.pop('exact', self._exact), **kwargs)\n\n    def _range(self, memory, addr, **kwargs):\n        \"\"\"\n        Gets the (min, max) range of solutions for an address.\n        \"\"\"\n        return (self._min(memory, addr, **kwargs), self._max(memory, addr, **kwargs))\n\n    def concretize(self, memory, addr):\n        \"\"\"\n        Concretizes the address into a list of values.\n        If this strategy cannot handle this address, returns None.\n        \"\"\"\n        if self._filter is None or self._filter(memory, addr):\n            return self._concretize(memory, addr)\n\n    def _concretize(self, memory, addr):\n        \"\"\"\n        Should be implemented by child classes to handle concretization.\n        \"\"\"\n        raise NotImplementedError()\n\n    def copy(self):\n        \"\"\"\n        Returns a copy of the strategy, if there is data that should be kept separate between\n        states. If not, returns self.\n        \"\"\"\n        return self\n\n    def merge(self, others):\n        \"\"\"\n        Merges this strategy with others (if there is data that should be kept separate between\n        states. If not, is a no-op.\n        \"\"\"\n        pass\n\nfrom .any import SimConcretizationStrategyAny\nfrom .controlled_data import SimConcretizationStrategyControlledData\nfrom .eval import SimConcretizationStrategyEval\nfrom .max import SimConcretizationStrategyMax\nfrom .nonzero import SimConcretizationStrategyNonzero\nfrom .nonzero_range import SimConcretizationStrategyNonzeroRange\nfrom .norepeats import SimConcretizationStrategyNorepeats\nfrom .norepeats_range import SimConcretizationStrategyNorepeatsRange\nfrom .range import SimConcretizationStrategyRange\nfrom .single import SimConcretizationStrategySingle\nfrom .solutions import SimConcretizationStrategySolutions\n", "path": "angr/concretization_strategies/__init__.py"}], "after_files": [{"content": "import claripy\n\nclass SimConcretizationStrategy(object):\n    \"\"\"\n    Concretization strategies control the resolution of symbolic memory indices\n    in SimuVEX. By subclassing this class and setting it as a concretization strategy\n    (on state.memory.read_strategies and state.memory.write_strategies), SimuVEX's\n    memory index concretization behavior can be modified.\n    \"\"\"\n\n    def __init__(self, filter=None, exact=True): #pylint:disable=redefined-builtin\n        \"\"\"\n        Initializes the base SimConcretizationStrategy.\n\n        :param filter: A function, taking arguments of (SimMemory, claripy.AST) that determins\n                       if this strategy can handle resolving the provided AST.\n        :param exact: A flag (default: True) that determines if the convenience resolution\n                      functions provided by this class use exact or approximate resolution.\n        \"\"\"\n        self._exact = exact\n        self._filter = filter\n\n    @staticmethod\n    def _tweak(addr, kwargs):\n        \"\"\"\n        Utility method used from in here that adds a bogus constraint to extra_constraints making it so that the addr\n        expression can actually be evaluated in all cases\n        \"\"\"\n        kwargs['extra_constraints'] = kwargs.get('extra_constraints', ()) + (addr == claripy.BVS('TEMP', len(addr)),)\n\n    def _min(self, memory, addr, **kwargs):\n        \"\"\"\n        Gets the minimum solution of an address.\n        \"\"\"\n        self._tweak(addr, kwargs)\n        return memory.state.solver.min(addr, exact=kwargs.pop('exact', self._exact), **kwargs)\n\n    def _max(self, memory, addr, **kwargs):\n        \"\"\"\n        Gets the maximum solution of an address.\n        \"\"\"\n        self._tweak(addr, kwargs)\n        return memory.state.solver.max(addr, exact=kwargs.pop('exact', self._exact), **kwargs)\n\n    def _any(self, memory, addr, **kwargs):\n        \"\"\"\n        Gets any solution of an address.\n        \"\"\"\n        self._tweak(addr, kwargs)\n        return memory.state.solver.eval(addr, exact=kwargs.pop('exact', self._exact), **kwargs)\n\n    def _eval(self, memory, addr, n, **kwargs):\n        \"\"\"\n        Gets n solutions for an address.\n        \"\"\"\n        self._tweak(addr, kwargs)\n        return memory.state.solver.eval_upto(addr, n, exact=kwargs.pop('exact', self._exact), **kwargs)\n\n    def _range(self, memory, addr, **kwargs):\n        \"\"\"\n        Gets the (min, max) range of solutions for an address.\n        \"\"\"\n        return (self._min(memory, addr, **kwargs), self._max(memory, addr, **kwargs))\n\n    def concretize(self, memory, addr):\n        \"\"\"\n        Concretizes the address into a list of values.\n        If this strategy cannot handle this address, returns None.\n        \"\"\"\n        if self._filter is None or self._filter(memory, addr):\n            return self._concretize(memory, addr)\n\n    def _concretize(self, memory, addr):\n        \"\"\"\n        Should be implemented by child classes to handle concretization.\n        \"\"\"\n        raise NotImplementedError()\n\n    def copy(self):\n        \"\"\"\n        Returns a copy of the strategy, if there is data that should be kept separate between\n        states. If not, returns self.\n        \"\"\"\n        return self\n\n    def merge(self, others):\n        \"\"\"\n        Merges this strategy with others (if there is data that should be kept separate between\n        states. If not, is a no-op.\n        \"\"\"\n        pass\n\nfrom .any import SimConcretizationStrategyAny\nfrom .controlled_data import SimConcretizationStrategyControlledData\nfrom .eval import SimConcretizationStrategyEval\nfrom .max import SimConcretizationStrategyMax\nfrom .nonzero import SimConcretizationStrategyNonzero\nfrom .nonzero_range import SimConcretizationStrategyNonzeroRange\nfrom .norepeats import SimConcretizationStrategyNorepeats\nfrom .norepeats_range import SimConcretizationStrategyNorepeatsRange\nfrom .range import SimConcretizationStrategyRange\nfrom .single import SimConcretizationStrategySingle\nfrom .solutions import SimConcretizationStrategySolutions\n", "path": "angr/concretization_strategies/__init__.py"}]}