How to convert python marshal to original code?

408 Views Asked by At

Is there a way to return a code written in the form of a marshal to its original form, I have this code written in marshal syntax:

from marshal import loads                       
exec(loads(b'c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\xf3\x1c\x00\x00\x00\x97\x00\x02\x00e\x00d\x00\xa6\x01\x00\x00\xab\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00d\x01S\x00)\x02z\x0bhello worldN)\x01\xda\x05print\xa9\x00\xf3\x00\x00\x00\x00\xfa\x08<string>\xfa\x08<module>r\x05\x00\x00\x00\x01\x00\x00\x00s\x1b\x00\x00\x00\xf0\x03\x01\x01\x01\xd8\x00\x05\x80\x05\x80m\xd1\x00\x14\xd4\x00\x14\xd0\x00\x14\xd0\x00\x14\xd0\x00\x14r\x03\x00\x00\x00'))

that's code of print("hello world") in python3.11, is there any way to return it to a clear form?

I tried to convert the marshal code to pyc file using

python -m py_compile "myFile.py" 

and then decompiling it using pycdc tool but its failed to give me original source code.

0

There are 0 best solutions below