Hello, I am morimolymoly!
Today, I am going to introduce how to treat disassembly code of Python with ChatGPT!
You can create single application from Python sources with PyInstaller.
This simple code is going to be a EXE file.
EXE out from Pyinstaller behaves same as script one!
You can extract pyc(Python compiled file) with pyinstxtractor
Extracted files are here.
Most interesting one is main.pyc.
Hex editor reveals this is not human readable file.
We need decompiler or disassembler.
pycdc has decompiler and disassembler both!
However, decompiler sometimes emits garbage code.
Some CTFs has challenge of PyInstaller and sometimes it was made by new version of Python and pycdc does not work.
We have to look at disassembly code!
Here is a disassembly code!
This is simple script so easy to understand but sometimes you encounter complex script, you need another power./
Prompt is “Tell me about this python decompilation”
Result is here!
Finally, ChatGPT decompiled this disaseembly code!
Another prompt “What is decompiled code for this main.pyc?”