zrax/pycdc ? reverse-engineered prompt
Reverse engineered prompt
Build me a C++ command line tool that can read Python bytecode and turn it back into something human readable.
I want two executables, one that disassembles a .pyc file and prints the bytecode instructions, and another that decompiles a .pyc file back into Python source as best as possible. It should also handle marshalled code objects when I pass in a version, and print normal output to stdout with errors to stderr.
Please make it build with CMake, include the core decompiler and disassembler logic, and add a small test setup so I can verify it works on sample bytecode. If there are tricky Python version differences, do your best to support them and look up current details online if you need to.
Are you gonna build this?
make sure you review the code using coderabbit