angr / angr/rex

Installation guide

Offen
#120 1 Kommentar 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement needs-triage
Vorherrschende Sprache
Python
Sterne
653
Forks
105
Ø Merge
4 T. 20 Std.
Gemergte PRs (30 T.)
1

Beschreibung

### Description

Hello, to get this installed I had to do the following:

Add the following lines to pyproject.toml:
```
[tool.poetry.dependencies]
python = "^3.10"
```
First run
```
$ poetry add git+https://github.com/mechaphish/compilerex.git git+https://github.com/mechaphish/povsim.git
```

Only theese gives issues with tracer, I assume the wrong tracer package is installed so we need to do:
```
poetry add git+https://github.com/angr/tracer.git
```

Addionally shellphis_qemu does not specify the requirement `setuptools` so we need to add it ourselves.

(Otherwise shellphis gives this)
```
/shellphish_qemu/__init__.py", line 2, in
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

....
raise ImportError("Unable to import shellphish_qemu, which is required by QEMURunner. Please install it before proceeding.") from e
ImportError: Unable to import shellphish_qemu, which is required by QEMURunner. Please install it before proceeding.

```

I.e add setuptools
```
poetry add setuptools
```

And then run
`$ poetry install`

Finally the archr package we get is the wrong version, so we need to use the git version:
```
poetry add git+https://github.com/angr/archr.git
```

At this point we can import rex, but not use it as we are missing 'keystone-engine'

```
poetry add keystone-engine
```

The final pyproject.toml for me became
```
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.poetry.dependencies]
python = "^3.10"

[project]
name = "rex"
version = "0.02"
dependencies = [
"angr",
"archr @ git+https://github.com/angr/archr.git",
"angrop",
"jinja2",
"povsim @ git+https://github.com/mechaphish/povsim.git",
"compilerex @ git+https://github.com/mechaphish/compilerex.git",
"pwntools",
"flaky",
"tracer @ git+https://github.com/angr/tracer.git",
"setuptools (>=80.9.0,<81.0.0)",
"keystone-engine (>=0.9.2,<0.10.0)",
]

[tool.setuptools.package-data]
"rex.scripter.templates" = ["*.j2"]
```

Finally after all this we seem to be able to import rex and run the simple test:
```
import archr
import rex
t = archr.targets.LocalTarget("./target")
with open('./input','rb') as f:
data = f.read()

crash = rex.Crash(t, data)
```
The fact that my test on my binary & input ends up in a desync error is out of scope for this issue.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.