From 211f0ce6301dc200b71c9c8110215dbb3daeba97 Mon Sep 17 00:00:00 2001 From: degrigis Date: Thu, 4 Jan 2024 13:43:46 -0800 Subject: [PATCH 1/7] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b56332d..8b0c96e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # `greed` +[![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/) From 09641c511816f15b7f2a16d866756dd3710052b6 Mon Sep 17 00:00:00 2001 From: degrigis Date: Thu, 4 Jan 2024 13:46:37 -0800 Subject: [PATCH 2/7] sha_resolver added as default plugin Signed-off-by: degrigis --- greed/state.py | 7 ++++++- greed/state_plugins/solver.py | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/greed/state.py b/greed/state.py index 44d50a0..78a3e0b 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 33226e9..52913d3 100644 --- a/greed/state_plugins/solver.py +++ b/greed/state_plugins/solver.py @@ -90,6 +90,8 @@ def pop_all(self): def add_path_constraints(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_constraints(self, constraint): def add_memory_constraints(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 From fd5f456a6d448bfe5752a01351c589b6bacf6be7 Mon Sep 17 00:00:00 2001 From: degrigis Date: Thu, 4 Jan 2024 13:47:37 -0800 Subject: [PATCH 3/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b0c96e..38d890c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# `greed` +# greed [![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/) From 6e7efcd650aa5d839c2e8aeb6c98d6b915e33173 Mon Sep 17 00:00:00 2001 From: degrigis Date: Thu, 4 Jan 2024 13:49:56 -0800 Subject: [PATCH 4/7] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 38d890c..5f542b9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # greed +![Python](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=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/) From 0fb5c419e73cfb02da162f16499c209375d63f91 Mon Sep 17 00:00:00 2001 From: degrigis Date: Thu, 4 Jan 2024 13:50:36 -0800 Subject: [PATCH 5/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f542b9..3daa076 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # greed -![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54) +[![python](https://img.shields.io/badge/Python-3.9-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/) From f3ef27bad338a82bf3b240f35261c6580e9f7f68 Mon Sep 17 00:00:00 2001 From: degrigis Date: Thu, 4 Jan 2024 13:51:04 -0800 Subject: [PATCH 6/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3daa076..16e3811 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # greed -[![python](https://img.shields.io/badge/Python-3.9-3776AB.svg?style=flat&logo=python&logoColor=white)](https://www.python.org) +[![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/) From d10fc9b2d1b1e136354fbb0b15b4bcd288fb7185 Mon Sep 17 00:00:00 2001 From: degrigis Date: Thu, 4 Jan 2024 13:53:26 -0800 Subject: [PATCH 7/7] fixed Signed-off-by: degrigis --- docs/docs/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/docs/index.md b/docs/docs/index.md index d3c6c19..bbc2dee 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -1,8 +1,8 @@ # 🚀 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) -
+
Welcome to greed's documentation! This documentation is intended to be a quick guide to use greed: our symbolic execution engine for EVM smart contract binaries. @@ -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!