From 5d51b4fe0bb41bc9e86c5775de35a9aef023fec5 Mon Sep 17 00:00:00 2001 From: Theofilos Augoustis Date: Mon, 27 Nov 2023 13:22:01 +0100 Subject: Implement symbolic state comparison algorithm This is the first draft of a `compare` algorithm that uses recorded symbolic transformations. Is currently based on angr, so it's probably going to be reworked to work with states generated by Miasm. Co-authored-by: Theofilos Augoustis Co-authored-by: Nicola Crivellin --- snapshot.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'snapshot.py') diff --git a/snapshot.py b/snapshot.py index 01c6446..3170649 100644 --- a/snapshot.py +++ b/snapshot.py @@ -38,3 +38,12 @@ class ProgramState: def __repr__(self): return repr(self.regs) + +class SnapshotSymbolResolver(SymbolResolver): + def __init__(self, snapshot: ProgramState): + self._state = snapshot + + def resolve(self, symbol: str): + if symbol not in self._state.arch.regnames: + raise SymbolResolveError(symbol, 'Symbol is not a register name.') + return self._state.read(symbol) -- cgit 1.4.1