| 58 | # Define a background thread object for solving in the background |
| 59 | class Solver(BackgroundTaskThread): |
| 60 | def __init__(self, find, avoid, view): |
| 61 | BackgroundTaskThread.__init__(self, "Solving with angr...", True) |
| 62 | self.find = tuple(find) |
| 63 | self.avoid = tuple(avoid) |
| 64 | self.view = view |
| 65 | |
| 66 | # Write the binary to disk so that the angr API can read it |
| 67 | self.binary = tempfile.NamedTemporaryFile() |
| 68 | self.binary.write(view.file.raw.read(0, len(view.file.raw))) |
| 69 | self.binary.flush() |
| 70 | |
| 71 | def run(self): |
| 72 | # Create an angr project and an explorer with the user's settings |