Skip to main content

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

Release files for deopy 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deopy 0.0.7
File Size Uploaded
deopy-0.0.7.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for deopy 0.0.7
File Interpreter ABI Platform
deopy-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 8.9 kB

Release files / deopy-0.0.7.tar.gz

Download URL deopy-0.0.7.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
03116016d8d4b8912399f85543d33ba2c3ffe0c2ddff973b5b6aa08310d68848
BLAKE2b-256 checksum
How to use checksums
23838a7624818ae61694ba3722cc39324aad3903790a0df7fee8054064b7e39e
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / deopy-0.0.7-py3-none-any.whl

Download URL deopy-0.0.7-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75dc7329a1699bda18fbb8dd0098388c2801bf479c78bffe205e1f2946792532
BLAKE2b-256 checksum
How to use checksums
16b95d824b5cf773aacbc02efca02aa54d7c55d4d8e6904fee9f76bc5b4dca93
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

1 release file

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page