Skip to content

Commit

Permalink
re-generated API doc
Browse files Browse the repository at this point in the history
Signed-off-by: degrigis <[email protected]>
  • Loading branch information
degrigis committed Dec 19, 2023
1 parent c62fad8 commit aaacd3f
Show file tree
Hide file tree
Showing 11 changed files with 328 additions and 91 deletions.
136 changes: 68 additions & 68 deletions docs/docs/modules/greed.TAC.special_ops.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/docs/modules/greed.memory.partial_concrete_storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Initialize the partial concrete storage.

---

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/memory/partial_concrete_storage.py#L72"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/memory/partial_concrete_storage.py#L73"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `add_constraint`

Expand All @@ -78,7 +78,7 @@ Add a constraint to the storage.

---

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/memory/partial_concrete_storage.py#L80"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/memory/partial_concrete_storage.py#L81"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `add_constraints`

Expand All @@ -94,7 +94,7 @@ Add a list of constraints to the storage.

---

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/memory/partial_concrete_storage.py#L154"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/memory/partial_concrete_storage.py#L155"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `copy`

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/modules/greed.project.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

---

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/project.py#L14"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/project.py#L16"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `Project`
This is the main class for creating a greed Project!

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/project.py#L18"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/project.py#L20"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `__init__`

Expand All @@ -35,7 +35,7 @@ __init__(target_dir: str)

---

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/project.py#L57"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/project.py#L67"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `dump_callgraph`

Expand Down
14 changes: 7 additions & 7 deletions docs/docs/modules/greed.sim_manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ __init__(entry_state: SymbolicEVMState, project)

```python
findall(
find: Callable[[SymbolicEVMState], bool] = <function SimulationManager.<lambda> at 0x7fac223da5c0>,
prune: Callable[[SymbolicEVMState], bool] = <function SimulationManager.<lambda> at 0x7fac223da660>
find: Callable[[SymbolicEVMState], bool] = <function SimulationManager.<lambda> at 0x7f79526d6980>,
prune: Callable[[SymbolicEVMState], bool] = <function SimulationManager.<lambda> at 0x7f79526d6a20>
)
```

Expand All @@ -134,7 +134,7 @@ Run the simulation manager, until the `find` condition of all the ET is met.
move(
from_stash: str,
to_stash: str,
filter_func: Callable[[SymbolicEVMState], bool] = <function SimulationManager.<lambda> at 0x7fac223da020>
filter_func: Callable[[SymbolicEVMState], bool] = <function SimulationManager.<lambda> at 0x7f79526d63e0>
)
```

Expand All @@ -154,8 +154,8 @@ Move all the states that meet the filter_func condition from from_stash to to_st

```python
run(
find: Callable[[SymbolicEVMState], bool] = <function SimulationManager.<lambda> at 0x7fac223da3e0>,
prune: Callable[[SymbolicEVMState], bool] = <function SimulationManager.<lambda> at 0x7fac223da480>,
find: Callable[[SymbolicEVMState], bool] = <function SimulationManager.<lambda> at 0x7f79526d67a0>,
prune: Callable[[SymbolicEVMState], bool] = <function SimulationManager.<lambda> at 0x7f79526d6840>,
find_all=False
)
```
Expand Down Expand Up @@ -220,8 +220,8 @@ Step a single state (calculate its successors)

```python
step(
find: Callable[[SymbolicEVMState], bool] = <function SimulationManager.<lambda> at 0x7fac223da160>,
prune: Callable[[SymbolicEVMState], bool] = <function SimulationManager.<lambda> at 0x7fac223da200>
find: Callable[[SymbolicEVMState], bool] = <function SimulationManager.<lambda> at 0x7f79526d6520>,
prune: Callable[[SymbolicEVMState], bool] = <function SimulationManager.<lambda> at 0x7f79526d65c0>
)
```

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/modules/greed.state.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ This method adds a constraint to the state.

---

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state.py#L310"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state.py#L315"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `copy`

Expand Down Expand Up @@ -121,7 +121,7 @@ This method returns the non fallthrough pc of the current state.

---

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state.py#L301"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state.py#L306"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `register_plugin`

Expand All @@ -133,7 +133,7 @@ This method registers a plugin to the state.

---

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state.py#L349"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state.py#L354"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `reset`

Expand Down
8 changes: 5 additions & 3 deletions docs/docs/modules/greed.state_plugins.inspect.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ __init__(breakpoints_stmt_ids=None, breakpoints_stmt=None)

---

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state_plugins/inspect.py#L52"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state_plugins/inspect.py#L59"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `copy`

Expand All @@ -49,7 +49,7 @@ Deep copy this state plugin.

---

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state_plugins/inspect.py#L37"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state_plugins/inspect.py#L44"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `stop_at_stmt`

Expand Down Expand Up @@ -80,9 +80,11 @@ Stop at a statement with a given ID (i.e., PC)
**Args:**

- <b>`stmt_id`</b>: The ID of the statement to stop at.
- <b>`func`</b>: The function to call when the breakpoint is hit (default: ipdb.set_trace())
- <b>`func`</b>: The function to call when the breakpoint is hit.
- <b>`when`</b>: Whether to stop before or after the statement.

The default function if none is provided is: ''' def justStop(simgr, state): log.warning("💥 Triggered breakpoint at {}".format(state.pc)) import ipdb; ipdb.set_trace() '''




Expand Down
132 changes: 132 additions & 0 deletions docs/docs/modules/greed.state_plugins.sha_resolver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<!-- markdownlint-disable -->

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state_plugins/sha_resolver.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

# <kbd>module</kbd> `greed.state_plugins.sha_resolver`






---

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state_plugins/sha_resolver.py#L9"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `ShaSolution`




<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state_plugins/sha_resolver.py#L10"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `__init__`

```python
__init__(symbol_name, argOffset, argSize, inputBuffer, shaResult)
```









---

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state_plugins/sha_resolver.py#L21"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `ShaResolver`
A plugin that finds solutions for the observed sha3 operations in a SimState.

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state_plugins/sha_resolver.py#L27"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `__init__`

```python
__init__(breakpoints_stmt_ids=None, breakpoints_stmt=None)
```








---

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state_plugins/sha_resolver.py#L33"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `clear_sha_frame`

```python
clear_sha_frame()
```





---

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state_plugins/sha_resolver.py#L30"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `clear_solutions`

```python
clear_solutions()
```





---

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state_plugins/sha_resolver.py#L133"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `copy`

```python
copy()
```

Deep copy this state plugin.

---

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state_plugins/sha_resolver.py#L38"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `fix_shas`

```python
fix_shas()
```





---

<a href="https://github.com/ucsb-seclab/greed/tree/main/greed/state_plugins/sha_resolver.py#L128"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `get_keccak256`

```python
get_keccak256(input_buffer, sha_size)
```








---

_This file was automatically generated via [lazydocs](https://github.com/ml-tooling/lazydocs)._
4 changes: 2 additions & 2 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ nav:
- greed.state_plugins.globals: modules/greed.state_plugins.globals.md
- greed.state_plugins.inspect: modules/greed.state_plugins.inspect.md
- greed.state_plugins.plugin: modules/greed.state_plugins.plugin.md
- greed.state_plugins.sha_resolver: modules/greed.state_plugins.sha_resolver.md
- greed.state_plugins.solver: modules/greed.state_plugins.solver.md
- greed.utils.encoding: modules/greed.utils.encoding.md
- greed.utils.exceptions: modules/greed.utils.exceptions.md
- greed.utils.extra: modules/greed.utils.extra.md
- greed.utils.files: modules/greed.utils.files.md



4 changes: 2 additions & 2 deletions docs/utils/apidoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def list_submodules(package_name):
modules_entry += f"- {submodule}: modules/{submodule}.md\n "


with open("../mkdocs.yml", "r") as f:
with open("./mkdocs_base.yml", "r") as f:
lines = f.readlines()

new_lines = []
Expand All @@ -44,6 +44,6 @@ def list_submodules(package_name):
line = line.replace("<AUTOMATICALLY_GENERATED>", modules_entry)
new_lines.append(line)

with open("../mkdocs_new.yml", "w") as f:
with open("./mkdocs_new.yml", "w") as f:
f.writelines(new_lines)

31 changes: 31 additions & 0 deletions docs/utils/mkdocs_base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
site_name: greed - A symbolic execution engine for EVM smart contract binaries
theme:
name: readthedocs
features:
- navigation.instant
- navigation.tabs
markdown_extensions:
- tables
- mkdocs-click
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- admonition
- pymdownx.details
- pymdownx.superfences

nav:
- Home: index.md
- QuickStart: quickstart.md
- Core Concepts: core.md
- Advanced Topics: advanced.md
- Options: options.md
- Examples: examples.md
- Credits: credits.md
- FAQ: faq.md
- Modules:
<AUTOMATICALLY_GENERATED>
Loading

0 comments on commit aaacd3f

Please sign in to comment.