D
D
Daniil Shevkunov2021-10-27 10:48:20
Python
Daniil Shevkunov, 2021-10-27 10:48:20

How to open exe file for reading through python?

exe file can be opened in a text editor in this form
61790356e6726573792000.png
And how to open it in python in the same form?
When you try to open it through with open, an error of non-decodable bytes appears.
If you simply rename it to txt, it has a hexadecimal encoding that is not supported by python.
If you open it in byte reading mode, you get this look (of the first line):
6179042f42f3b345972266.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2021-10-27
@danila763

Open in byte reading mode, every N=1,2,4 bytes translate into hexadecimal system.
The only question is why? You won't see the exe structure that way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question