C
C
Coder 14482021-05-02 20:29:24
rar
Coder 1448, 2021-05-02 20:29:24

How to open exe file as archive?

There is an exe file, you need to open it as an archive, replace one file there and save it back. On a computer, all this is perfectly done, but no libraries work in Python.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Coder 1448, 2021-05-03
@wows15

Through the commands of the console rar.exe
What was the solution for me:

"C:\Program Files (x86)\WinRAR\rar.exe" a roadgid_detect.exe flagdata.bin

V
Vindicar, 2021-05-02
@Vindicar

First of all, what is an archive? ZIP? Or RAR? RAR python out of the box does not know how.
Further, a self-extracting archive is an EXE, to which the archive is stupidly appended. If you know what the archive header looks like (in particular , the signature ), then you can scan the file, find the signature, rewind the file pointer to it, and only then give the file to the ZIP object.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question