G
G
Grandma Luda2021-06-29 20:42:22
Python
Grandma Luda, 2021-06-29 20:42:22

Can't print the bytecode of an .exe file?

I want to print it so that my second program is like an installer and can install one file from which the byte code is needed.

a = open("G:/socket/ani.exe","rb")
b = a.read()
print(b)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Developer, 2021-06-29
@samodum

Well, everything is correct. You are trying to print non-printable characters.
To do this, they came up with hexadecimal codes.
Convert bytes to HEX and enjoy

import binascii
filename = 'test.dat'
with open(filename, 'rb') as f:
    content = f.read()
print(binascii.hexlify(content))

M
Maxim Siomin, 2021-06-29
@MaxSiominDev

https://www.google.com/search?q=%D0%BF%D0%B5%D1%80...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question