extremecoders-re / bytecode_simplifier

A generic deobfuscator for PjOrion obfuscated python scripts
https://0xec.blogspot.com/2017/07/deobfuscating-pjorion-using-bytecode.html
103 stars 36 forks source link

TypeError #10

Open chenyichie opened 2 years ago

chenyichie commented 2 years ago

I'm using wsl 22.04, and run "python3 main.py --ifile=main.pyc --ofile=mainfixed.pyc", then get this error:

INFO:main:Opening file main.pyc Traceback (most recent call last): File "/home/user/bytecode_simplifier/main.py", line 72, in process(args.ifile, args.ofile) File "/home/user/bytecode_simplifier/main.py", line 52, in process if not header.startswith('\x03\xF3\x0D\x0A'): TypeError: startswith first arg must be bytes or a tuple of bytes, not str

I'm using python3, is this a python2 project?

extremecoders-re commented 2 years ago

Yes this is a Python 2 project. PjOrion is Python 2 as I'm aware. No idea about the recent versions of PjOrion though.

chenyichie commented 2 years ago

So, is this error related to python2?

extremecoders-re commented 2 years ago

You have to use Python 2 to run the project. Won't work with Python 3.

The error is related to difference between bytes and strings in between Python 2 & 3.