Location>code7788 >text

AI+Reverse Python 3.9+ Programs

Popularity:263 ℃/2025-02-16 21:57:43

Convert program to pyc file using

  1. download :extremecoders-re/pyinstxtractor: PyInstaller Extractor
  2. Put the code and program in the same directory
  3. Generate pyc file:python software name

Use the pycdc tool to decompile pyc files to obtain source code

  1. Download and compile pycdc:zrax/pycdc: C++ python bytecode disassembler and decompiler
    1. Compile with visual studio+cmake in Windows (not recommended, decompile code completion)
    2. Compile directly using cmake in linux
    3. Use cmake to compile in Windows WSL environment (recommended, less installation, full decompilation code)
  2. Copy the generated program to the pyc file directory
  3. Decompile pyc file: pycdc -o py filename pyc filename
  4. This way, it is best to obtain source code, so you don't need to read it down, but there may be problems with higher versions of python, for example
    1. Unsupported opcode: JUMP_BACKWARD
    2. # WARNING: Decompyle incomplete
  5. If an error occurs, you can continue reading, which may be helpful

Use the pycdas tool to decompile pyc files and obtain assembly code

  1. Compiling pycdc will also generate pycdas, and copy this program to the pyc file directory
  2. Decompile pyc file into assembly code: pycdas -o py filename pyc filename

Use AI tools to decompile assembly code to obtain source code

  1. Copy the assembly code decompiled by pycdas into the ai dialogue. I use deepseek and let it "fix the code" to get the source code
  2. Code compilation and repair: The generated code is still a bit of syntax problem, but the problem is not big and easy to fix. Basically, it will come out after compilation, so you need to modify it manually.

refer to:

  1. Decompile Python 3.11 EXE files using pyxtractor and AI (chatgpt blackboxai)! NEW METHOD 2023/2024 - YouTube