I am trying to use uncompyle6 to decompile a .pyc
code. I even tried --verify
option. It says
Successfully decompiled file
but the output only contains strings like \xe0\xb3\x0bh\x90
.
What should I do?
Reverse Engineering Stack Exchange is a question and answer site for researchers and developers who explore the principles of a system through analysis of its structure, function, and operation. It only takes a minute to sign up.
Sign up to join this communitySomething is wrong with your input .pyc
file — probably it isn't a valid Python bytecode file (obtained from a valid .py
source file).
\xe0
, \xb3
, \x0b
, \x90
are hexadecimal codes for bytes which have no printable ASCII representation — mainly above 0x7F
(127 decimal), but also the control character \x0b (VT - Vertical Tabulation).
(The letter h
after \xb3
is an ASCII character.)
It's standard Python output for non-ASCII characters in binary sequence types (bytes / bytearrays / memoryview):
>>> bytes((33, 50, 65, 97)) # ASCII chars
b'!2Aa'
>>> bytes((224, 179, 11, 144)) # non-ASCII (4 of "your" 5 bytes)
b'\xe0\xb3\x0b\x90'
The same for your byte sequence with non-ASCII and ASCII codes
(now for a change in hexadecimal):
>>> bytes((0xe0, 0xb3, 0x0b, 0x68, 0x90)) # "your" byte sequence
b'\xe0\xb3\x0bh\x90'
.pyc
file (obtained from your own valid.py
file) to be sure that the output in your question is not a consequence of the invalid.pyc
file.