A python library that helps you de-obfuscate/decrypt obfuscated python code
Project description
Deopy
Short description
A python library that helps you de-obfuscate/decrypt obfuscated python code
WARNING! Read Before Using
This library uses a lot of exec to reverse the code which is also dangerous and can be easily exploited. Do not run it with code you don't trust. You are the only one responsible if something bad happens to your marchine.
How to install?
You can either install the latest from source
pip install git+https://github.com/painor/deopy.git
or from pip
pip install deopy
How to use
Deopy offers a lot of different deobfuscation techniques and can even detect them.
from deopy import Deopy
import logging
# tells you more information like how many times it was deobfuscated
logging.basicConfig(level=logging.INFO)
# The obfusated code. needs to be a string
data = """
import marshal as m
data = m.loads(b'\xe3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00@\x00\x00\x00s\x1a\x00\x00\x00e\x00d\x00\x83\x01D\x00]\x0cZ\x01e\x02e\x01\x83\x01\x01\x00q\x08d\x01S\x00)\x02\xe9d\x00\x00\x00N)\x03\xda\x05range\xda\x01i\xda\x05print\xa9\x00r\x05\x00\x00\x00r\x05\x00\x00\x00\xda\x06string\xda\x08<module>\x01\x00\x00\x00s\x02\x00\x00\x00\x0c\x01')
exec(data)
"""
# instantiate the class
d = Deopy(verbose=True)
# We know that the technique that is used was marshal.
# so we can call it directly
print(d.decrypt_marshal(data))
Deopy also offers d.auto_decrypt(data)
which will try to decrypt the data until it no longer can. This is useful for code that is obfuscated multiple times
Long description
with the rise of popularity of python a lot of people are starting to release their code in an obfuscated way which is dangerous as they could contain malicious code in them. The goal of this library is to reverse the automated obfuscators out there.
Issues
Currently, the library can only reverse very specific obfuscation methods (that can break in the future). If you found a new method please open either a PR or an issue.
Contributing
There isn't any code of conduct up yet since it's still a fairly smpall library but commenting your code is heavily encouraged for future contributors
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file deopy-0.0.7.tar.gz
.
File metadata
- Download URL: deopy-0.0.7.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03116016d8d4b8912399f85543d33ba2c3ffe0c2ddff973b5b6aa08310d68848 |
|
MD5 | 8500e7578fca8ed4e24c2f5e69013820 |
|
BLAKE2b-256 | 23838a7624818ae61694ba3722cc39324aad3903790a0df7fee8054064b7e39e |
File details
Details for the file deopy-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: deopy-0.0.7-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75dc7329a1699bda18fbb8dd0098388c2801bf479c78bffe205e1f2946792532 |
|
MD5 | 5b7fb92b49e1c641977d880ff9b19aef |
|
BLAKE2b-256 | 16b95d824b5cf773aacbc02efca02aa54d7c55d4d8e6904fee9f76bc5b4dca93 |