Как декомпилировать exe python

от admin

Как декомпилировать exe python

/D/p/c/p/t/EXE2PY-Decompiler [master]× » py37 pyinstxtractor.py «exe/.exe» -1- 20:16:17
pyinstxtractor.py:87: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module’s documentation for alternative uses
import imp
[>] Processing exe/
.exe
[>] Pyinstaller version: 2.1+
[>] Python version: 309
[>] Length of package: 26502589 bytes
[>] Found 1017 files in CArchive
[>] Beginning extraction. please standby
Traceback (most recent call last):
File «pyinstxtractor.py», line 367, in
main()
File «pyinstxtractor.py», line 359, in main
arch.extractFiles()
File «pyinstxtractor.py», line 251, in extractFiles
if not os.path.exists(EXTRACTION_DIR):
File «/usr/lib/python3.7/genericpath.py», line 19, in exists
os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

Recommend Projects

React

A declarative, efficient, and flexible JavaScript library for building user interfaces.

Vue.js

Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

Typescript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

TensorFlow

An Open Source Machine Learning Framework for Everyone

Django

The Web framework for perfectionists with deadlines.

Laravel

A PHP framework for web artisans

Bring data to life with SVG, Canvas and HTML.

Recommend Topics

javascript

JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

Some thing interesting about web. New door for the world.

server

A server is a program made to process requests and deliver data to clients.

Machine learning

Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

Visualization

Some thing interesting about visualization, use data art

Some thing interesting about game, make everyone happy.

Recommend Org

Facebook

We are working to build community through open source technology. NB: members must have two-factor auth.

How to decompile compiled .pyc Python files

How to use uncompyle6 to decompile .pyc files in your directory.

Step 1. Install uncompyle6

uncompyle6

A native Python cross-version decompiler and fragment decompiler. The successor to decompyle, uncompyle, and…

A native Python cross-version decompiler and fragment decompiler. The successor to decompyle, uncompyle, and…

More from Cassandra

Brief notes and tutorials on quantitative cryptocurrency research, and Python and R programming tips for data science

python exe decompile

the driving life sample is packaged in python exe file attempted to decompile to py file.

use pyinstxtractor. py generate pyc files 。

the actual attempt found that direct decompilation would report an error

see ahead using pyinstxtractor. py there is a hint in the decompilation error “not a pyinstaller archive”, the py script used for extraction is called archive_viewer.py( use the archive _viewer.py to install pyinstaller, pass pip install pyinstaller you can install )

methods a 、 use the archive _viewer.py extract the pyc

archive_viewer.py the command

because with pyinstaller after packing ,pyc the first 8 bytes of the file are erased , so add it back yourself at the end.

the first four bytes are the compiled version of python , the last four bytes are timestamps. ( four bytes of magic number、 four byte timestamp )

for a compiled version, look at the struct in the packaged file ,so so again, we’re extracting this struct file

open with the hexadecimal editor struct file before copying it 8 bytes

added to the ii. pyc in the

then use tools to decompile pyc py。

** available uncompyle *.pyc decompile pyc file to get py**

method 2 、 use pyinstxtractor. py extract the pyc

use pyinstxtractor directly. py to extract the exe file pyc error will be reported, need to remove the signature information before using pyinstxtractor.py unlock

first remove the signature from the exe file

check the pyinstaller source code for this ,PyInstaller first, the program will read the last data to identify, if it is in line with the format will be parsed (c/Program Files/Python/Python37/Lib/site-packages/PyInstaller/archive/reader.py)

Читать:
Как залить прошивку в протеусе

MAGIC is where you start identifying at the end of the file.

pyinstaller2.0 it includes magic 24 byte length

pyinstaller2.1 it includes magic 88 byte length

\014\013\012\013\016 is eight into the system , can be converted to hexadecimal view

open using the hexadecimal editor svchost.exe, move forward from the last mei to find a match MAGIC the whole structure.

since mei , select back 88 bytes in length , delete all the rest ( delete the formatted data )。

and then you’re done and you sign.

finally, we use pyinstxtractor directly. py extract it. we also need to fix the header data as before , same way as above.

Name already in use

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

С помощью данной программы можно декомпилировать исполняемые файлы, созданные с помощью pyinstaller или py2exe.

Также возможно декомпилировать отдельные кэш-файлы назад в исходный код python.

Скриншот главного окна приложения

Что нового

Полностью переработан графический интерфейс

Добавлена поддержка DRAG & DROP для LineEdit

Добавлена возможность указывать папку для декомпиляции её содержимого

Значительно переписан код

Фиксы:

Исправлена проблема с декомпиляции кода версии 3.6 старшими версиями python

Добавлена возможность прерывания процесса декомпиляции

Добавлен баннер, появляющийся во время работы декомпилятора

Примечание:

Если не удается декомпилировать одну из библиотек с папки EXE2PY_Pycache переключите флажок «декомпилировать все дополнительные библиотеки» в активное положение и повторите попытку.

Программа может работать на версиях python 3.4, 3.6, 3.7. С её помощью, возможно, декомпилировать программы ранее перечисленных версий python. При этом различие версий не играет никакой роли. (С помощью python версии 3. 4. можно декомпилировать программу, написанную на python 3. 6.).

Как декомпилировать .exe в .py?

В общем, я писал небольшой скрипт для на python. Заказчик потребовал, чтобы был готовый exe, поэтому пришлось использовать Pyinstaller (с py2exe у меня выдавало ошибку). Проект выполнен и я решил переустановить винду. Но потом заказчик попросил переписать скрипт. Исходники я конечно же не забэкапил т.к. думал что к этому проекту уже не вернусь. В итоге, что у меня есть: exe скомпилированный с помощью pyinstaller и исходники старой версии проекта, которые остались на флешке.

Подскажите, можно ли их как-нибудь декомпилировать в .py или мб какое-нибудь другое решение (писать заново — не вариант).

Decompiling py2exe Executables

We had to decompile an executable (.exe) generated with py2exe for Python 3.

py2exe takes a Python program and generates a Windows executable. This .exe file contains the Python bytecode of the program, a Python interpreter and all the necessary modules. The bytecode is stored as a resource inside the .exe file.

unpy2exe will extract the Python bytecode as a pyc file from the .exe file, which can then be decompiled with uncompyle6. Unfortunately, unpy2exe does not support files generated with py2exe for Python 3.

We release our program decompile-py2exe to handle py2exe Python 3 executables. It is simple to use:

20170102-110208

decompile-py2exe takes an executable as argument, extracts the Python bytecode and decompiles it with uncompyle6, all in one step. The executable can also be passed via stdin or inside a (password protected) ZIP file. Be sure to use Python 3 to run decompile-py2exe.

Похожие статьи