Skip to content

Latest commit

 

History

History
49 lines (32 loc) · 1.53 KB

README.md

File metadata and controls

49 lines (32 loc) · 1.53 KB

SourceRestorer

SourceRestorer is a tool designed to recover lost code from .pye files encrypted using SOURCEdefender. It provides a means to decrypt and analyze otherwise unreadable Python source code, which can be particularly useful in several scenarios such as:

  • Malware analysis: Analyzing potentially harmful code without having access to its original sources
  • Forensic investigation of unknown code: Gaining insights into third-party scripts with no available documentation
  • Code recovery: Restoring your own code when you've accidentally lost the original source files

It has been tested with version 11.0 of the library.

How does it work?

SOURCEdefender uses TgCrypto and msgpack under the hood. We simply need to wrap the tgcrypto.ctr256_decrypt function so that it prints the decrypted code.

Finally, we make it return an empty value instead. This last step is performed to ensure no harmful code is ever executed.

Usage

Firstly, you should install the original SOURCEdefender library:

pip install -r requirements.txt

To use the program place the encrypted file in the same directory as the script, then simply call it by passing the file name as the only parameter:

python sourcerestorer.py input.pye

The code will be printed out on screen.

License

This software is released in the public domain under The Unlicense. It comes without warrant of any kind and no support will be provided.