diff --git a/README.md b/README.md index b56332d..16e3811 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ -# `greed` +# greed +[![python](https://img.shields.io/badge/Python-3.11+-3776AB.svg?style=flat&logo=python&logoColor=white)](https://www.python.org) +[![License](https://img.shields.io/github/license/Ileriayo/markdown-badges?style=flat)]([https://pypi.org/project/ethpwn/](https://raw.githubusercontent.com/ethpwn/ethpwn/main/LICENSE)) +[![Docs](https://img.shields.io/badge/Documentation-gh_pages)](https://ucsb-seclab.github.io/greed/) diff --git a/docs/docs/index.md b/docs/docs/index.md index 2fb38cd..3a234eb 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -1,5 +1,5 @@ # 🚀 Welcome to greed's documentation! -[![License](https://img.shields.io/github/license/Ileriayo/markdown-badges?style=for-the-badge)](https://github.com/ucsb-seclab/greed/blob/main/LICENSE) [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/ucsb-seclab/greed) ![Python3](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54) +[![License](https://img.shields.io/github/license/Ileriayo/markdown-badges?style=for-the-badge)](https://github.com/ucsb-seclab/greed/blob/main/LICENSE.md) [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/ucsb-seclab/greed) ![Python3](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)
@@ -28,4 +28,4 @@ Some of the folks developing greed are also angr's contributor, thus, many of th year={2024} } - Thanks! \ No newline at end of file + Thanks! diff --git a/greed/state.py b/greed/state.py index 19131c6..cea78d8 100644 --- a/greed/state.py +++ b/greed/state.py @@ -5,7 +5,7 @@ from greed import options as opt from greed.memory import LambdaMemory, PartialConcreteStorage from greed.solver.shortcuts import * -from greed.state_plugins import SimStatePlugin, SimStateSolver, SimStateGlobals, SimStateInspect +from greed.state_plugins import SimStatePlugin, SimStateSolver, SimStateGlobals, SimStateInspect, ShaResolver from greed.utils.exceptions import VMNoSuccessors, VMUnexpectedSuccessors from greed.utils.exceptions import VMSymbolicError from greed.utils.extra import UUIDGenerator @@ -295,6 +295,11 @@ def _register_default_plugins(self): """ self.register_plugin("solver", SimStateSolver()) self.register_plugin("globals", SimStateGlobals()) + + sha_resolver = ShaResolver() + self.register_plugin("sha_resolver",sha_resolver) + sha_resolver.set_state(self) + if opt.STATE_INSPECT: self.register_plugin("inspect", SimStateInspect()) diff --git a/greed/state_plugins/solver.py b/greed/state_plugins/solver.py index 5f10ded..af3cad7 100644 --- a/greed/state_plugins/solver.py +++ b/greed/state_plugins/solver.py @@ -90,6 +90,8 @@ def pop_all(self): def add_path_constraint(self, constraint): """ Add a path constraint to the state (at the current frame level). + Args: + constraint: The constraint to add. """ self._path_constraints[self._curr_frame_level].add(constraint) self._add_assertion(constraint) @@ -97,6 +99,8 @@ def add_path_constraint(self, constraint): def add_memory_constraint(self, constraint): """ Add a memory constraint to the state (at the current frame level). + Args: + constraint: The constraint to add. """ self._memory_constraints[self._curr_frame_level].add(constraint) self._add_assertion(constraint) @@ -115,6 +119,7 @@ def simplify(self): if not self.state.solver.is_formula_sat(NotEqual(reg_val, reg_val_sol)): self.state.registers[reg_var] = reg_val_sol self.state.registers[reg_var].is_simplified = True + @property def timed_out(self): return self._solver.timed_out