Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help #60

Open
wants to merge 80 commits into
base: master
Choose a base branch
from
Open

Help #60

Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
6f9ba71
Untilde algebra.py
Apr 23, 2020
01ccc7e
Remove useless file.
Apr 25, 2020
1c35699
Untildify prettify.py
Apr 25, 2020
b3bf86a
Run black over prettify.
Apr 25, 2020
66be8ab
Remove useless vars.
Apr 25, 2020
8459dd8
Fix small bug.
Apr 25, 2020
5200f48
Remove unused vars.
Apr 25, 2020
3a6e208
Fix some more bugs.
Apr 26, 2020
2f2a7e5
Untildify signatures.py, and fix a bug with .length
Apr 26, 2020
9afbfee
Remove profiler.
Apr 26, 2020
2dd082a
More untilding
Apr 26, 2020
c437d93
Handle timeouts gracefully instead of crashing.
Apr 26, 2020
04d39f8
Untildify whiles
Apr 26, 2020
9a76ad7
Fix small bug, reduce max number of nodes.
Apr 26, 2020
7cf4c72
Move signatures stuff to logging.
May 2, 2020
b9831a2
Moar untilde.
May 2, 2020
ee2aff5
Add simplification.
May 2, 2020
0beac85
Moar untildification.
May 2, 2020
a72ea92
Finish untildification.
May 2, 2020
1973b91
Remove a global variable.
May 2, 2020
e7ad8c6
Simplify the panoramix CLI, don't use cache files etc
May 2, 2020
62701a4
Small fixes.
May 2, 2020
05a2ef7
Small fixes.
May 3, 2020
07de051
Minor cleanups. Add profiling.
May 3, 2020
456fd0a
Small fixes.
May 3, 2020
adddfe1
Minor changes.
May 3, 2020
4771620
Simplify caching and stuff.
May 3, 2020
1f1ff15
Include supplement.db.xz, and move the DB to cache.
May 4, 2020
e0220d7
Remove supp2.db (why was it supposed to be for?)
May 4, 2020
ab14c92
Don't depend on web3 (used only when loading addresses)
May 4, 2020
7136bfe
Add uniswap to addr shortcuts
May 4, 2020
f8a7275
Fix wrong escape code.
May 6, 2020
8859262
Apply https://github.com/eveem-org/panoramix/pull/16
May 8, 2020
7c586a1
Revert "Don't depend on web3 (used only when loading addresses)"
May 8, 2020
ed36e9b
Merge branch 'untilde'
May 8, 2020
5e07e40
Improve readme.
May 8, 2020
d3462a7
Support for reading stdin, better timeout display.
May 8, 2020
b5ca581
Importing https://4byte.directory signature definitions…
May 9, 2020
1da5afb
Fix untilde bug.
May 13, 2020
7b8a9ca
Minor improvements
May 13, 2020
1e844f4
Fix bug.
May 13, 2020
0ecc4f7
Fix small bug.
May 13, 2020
e689e62
Return a dict in the decompilation JSON, not a string with serialized…
May 14, 2020
31fa85a
Check that decompilation.json is actually serializable.
May 14, 2020
76fd1b1
Merge pull request #1 from ytrezq/master
May 16, 2020
06a08d6
Fix symbolic returndatasize.
May 19, 2020
317643d
Proper exception handling, and use a non-Exception for timeouts.
May 23, 2020
0e67328
Fix JSON serialization error.
May 23, 2020
d5c18c3
Defuse a complexity bomb in storage post-processing.
May 24, 2020
c89b5db
Add more Python related stuff to gitignore.
cleanunicorn Jul 1, 2020
d5c7e67
Add installation notes and examples to Readme.
cleanunicorn Jul 1, 2020
a2a4ada
Merge pull request #2 from cleanunicorn/master
Jul 3, 2020
c1b44e3
Add a simplification.
Aug 21, 2020
fdfa0a2
Add logging.
Aug 21, 2020
8994005
Finally make it a proper package.
Aug 22, 2020
c940dd6
Improve readme.
Aug 22, 2020
3525dde
Add setup.py.
Aug 22, 2020
e35347f
Add a manifest file to include the supplement db.
Aug 22, 2020
876a8de
Fix topic name.
Aug 22, 2020
561e1c7
Fix bug where best_score is not used.
Mar 10, 2023
28883b4
Port project to poetry.
Mar 10, 2023
d584f3e
Reformat code.
Mar 10, 2023
a871696
Add flake8 config.
Mar 10, 2023
9366371
Use argparse.
Mar 10, 2023
2e2f828
Fix crash, instead log an error.
Mar 10, 2023
a402af5
Add BASEFEE opcode.
Mar 10, 2023
ee589f8
Support for Solidity Panic codes.
Mar 10, 2023
e0709d1
Rewrite ABI support.
Mar 11, 2023
40edfa0
Small refactorings/cleanups.
Mar 11, 2023
6e393af
small cleanups
Mar 14, 2023
efdf698
Fix package name.
Mar 14, 2023
47a2e69
Fix empty param names.
Mar 14, 2023
440bfc5
Update ABI dump with events.
Mar 16, 2023
0d9651d
Various fixes + bump version.
Mar 16, 2023
91b887d
Small fixes.
Mar 16, 2023
2bcf84c
Update ABI dump.
Mar 16, 2023
d436ac1
Update version.
Mar 16, 2023
62bd775
Improve logs.
Mar 17, 2023
752e79b
Add logging.
Mar 17, 2023
23edd11
Add support for the push0 opcode.
Jun 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 139 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,141 @@
__pycache__
*/__pycache__
cache_code
cache_pabi
cache_pan
__pycache__/
cache
cache_pan
.DS_Store
supplement.db
supp2.db
cache_*

# Byte-compiled / optimized / DLL files
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
graft panoramix/data
40 changes: 37 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,40 @@
This is a fork of: https://github.com/eveem-org/panoramix.git
Panoramix
=========

This is an EVM decompiler.

It's is a fork of the Panoramix original repo that's not maintained actively by its author anymore: https://github.com/eveem-org/panoramix.git

The goal of this fork is to maintain Panoramix in a decent shape, fix some crashes, implement missing opcodes...
I also got rid of the "tilde" syntax that was using a custom python encoding and use vanilla Python instead. And I made it a proper python package that can be imported.
There is also a better support of timeouts, as instead of stopping entirely we will fallback and print whatever we decompiled even if it's not complete.

The code quality is still not great and the software is complex, it's mostly reserved for advanced users.

## Installation

```console
$ pip install panoramix-decompiler
```

## Running

You can specify a web3 provider using the environment variable `WEB3_PROVIDER_URI`. In this case a local provider was set.

```console
$ WEB3_PROVIDER_URI=http://localhost:7545 panoramix 0x0d94D81FD712126E7f320b5B10537D01d6a01563
```

You can also provide the bytecode for decompilation.

```console
$ panoramix 6004600d60003960046000f30011223344
```

## Examples

I have decompiled all of mainnet, and make sure to decompile again on the latest Panoramix version from time to time.

You can access decompilations using Oko: https://oko.palkeo.com/

For now I only plan to implement very minor (but annoying fixes). If something is too complicated to understand or would require
a non-negligible amount of time it won't be fixed.
Here is an example for cryptokitties: https://oko.palkeo.com/0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/code/
1 change: 0 additions & 1 deletion core/__init__.py

This file was deleted.

Loading