pycdc
pycdc copied to clipboard
Problems installing and running pycdc
Hello. I have a cpython-311.pyc code I'd like to decompile and was very happy to find out about pycdc.
I'm however running into installation problems. make looks fine but there were several XFAIL when I ran make check.
$ make
[ 2%] Generating bytes/python_10.cpp, bytes/python_11.cpp, bytes/python_13.cpp, bytes/python_14.cpp, bytes/python_15.cpp, bytes/python_16.cpp, bytes/python_20.cpp, bytes/python_21.cpp, bytes/python_22.cpp, bytes/python_23.cpp, bytes/python_24.cpp, bytes/python_25.cpp, bytes/python_26.cpp, bytes/python_27.cpp, bytes/python_30.cpp, bytes/python_31.cpp, bytes/python_32.cpp, bytes/python_33.cpp, bytes/python_34.cpp, bytes/python_35.cpp, bytes/python_36.cpp, bytes/python_37.cpp, bytes/python_38.cpp, bytes/python_39.cpp, bytes/python_310.cpp, bytes/python_311.cpp
make[2]: Warning: File 'bytes/python_11.cpp' has modification time 0.049 s in the future
make[2]: warning: Clock skew detected. Your build may be incomplete.
[ 4%] Building CXX object CMakeFiles/pycxx.dir/bytecode.cpp.o
[ 7%] Building CXX object CMakeFiles/pycxx.dir/data.cpp.o
[ 9%] Building CXX object CMakeFiles/pycxx.dir/pyc_code.cpp.o
[ 11%] Building CXX object CMakeFiles/pycxx.dir/pyc_module.cpp.o
[ 14%] Building CXX object CMakeFiles/pycxx.dir/pyc_numeric.cpp.o
[ 16%] Building CXX object CMakeFiles/pycxx.dir/pyc_object.cpp.o
[ 19%] Building CXX object CMakeFiles/pycxx.dir/pyc_sequence.cpp.o
[ 21%] Building CXX object CMakeFiles/pycxx.dir/pyc_string.cpp.o
[ 23%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_10.cpp.o
[ 26%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_11.cpp.o
[ 28%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_13.cpp.o
[ 30%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_14.cpp.o
[ 33%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_15.cpp.o
[ 35%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_16.cpp.o
[ 38%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_20.cpp.o
[ 40%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_21.cpp.o
[ 42%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_22.cpp.o
[ 45%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_23.cpp.o
[ 47%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_24.cpp.o
[ 50%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_25.cpp.o
[ 52%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_26.cpp.o
[ 54%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_27.cpp.o
[ 57%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_30.cpp.o
[ 59%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_31.cpp.o
[ 61%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_32.cpp.o
[ 64%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_33.cpp.o
[ 66%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_34.cpp.o
[ 69%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_35.cpp.o
[ 71%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_36.cpp.o
[ 73%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_37.cpp.o
[ 76%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_38.cpp.o
[ 78%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_39.cpp.o
[ 80%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_310.cpp.o
[ 83%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_311.cpp.o
[ 85%] Linking CXX static library libpycxx.a
[ 85%] Built target pycxx
[ 88%] Building CXX object CMakeFiles/pycdas.dir/pycdas.cpp.o
[ 90%] Linking CXX executable pycdas
[ 90%] Built target pycdas
[ 92%] Building CXX object CMakeFiles/pycdc.dir/pycdc.cpp.o
[ 95%] Building CXX object CMakeFiles/pycdc.dir/ASTree.cpp.o
[ 97%] Building CXX object CMakeFiles/pycdc.dir/ASTNode.cpp.o
[100%] Linking CXX executable pycdc
[100%] Built target pycdc
$ make check
[ 90%] Built target pycxx
[100%] Built target pycdc
*** async_def: PASS (1)
*** async_for: PASS (1)
*** binary_ops: PASS (1)
*** build_const_key_map: PASS (2)
*** chain_assignment: PASS (2)
*** conditional_expressions_py2: PASS (1)
*** conditional_expressions: PASS (2)
*** contains_op: PASS (1)
*** f-string: PASS (1)
*** if_elif_else: PASS (6)
*** is_op: PASS (1)
*** iter_unpack: PASS (1)
*** lambdas_assignment: PASS (1)
*** list_extend: PASS (1)
*** loadbuild_class: PASS (1) + XFAIL (1)
*** load_method: PASS (2)
*** loop_try_except: XFAIL (1)
*** matrix_mult_oper: PASS (1)
*** nan_inf: PASS (2)
*** print_to: PASS (1)
*** private_name: PASS (6)
*** simple_const: PASS (27)
*** test_applyEquiv: PASS (2)
*** test_augmentedAssign: XFAIL (2)
*** test_calls: PASS (5)
*** test_class_method_py3: PASS (2)
*** test_class_method: PASS (2)
*** test_class_py3: XFAIL (1)
*** test_class: PASS (3)
*** test_decorators: XFAIL (1)
*** test_del: PASS (3)
*** test_dict: PASS (1)
*** test_divide_future: PASS (2)
*** test_divide_no_future: PASS (2)
*** test_docstring: PASS (4)
*** test_empty: PASS (6)
*** test_exceptions: XFAIL (4)
*** test_exec: PASS (3)
*** test_expressions: PASS (3)
*** test_extendedImport: PASS (2)
*** test_extendedPrint: PASS (3)
*** test_finally: XFAIL (1)
*** test_for_loop_py3.8: PASS (1)
*** test_functions_py3: PASS (2) + XFAIL (1)
*** test_functions: XFAIL (3)
*** test_globals: PASS (3)
*** test_global: PASS (3)
*** test_import_as: PASS (2)
*** test_import: XFAIL (3)
*** test_integers: PASS (3)
*** test_iterators: PASS (2)
*** test_lambda: XFAIL (3)
*** test_listComprehensions: PASS (1) + XFAIL (2)
*** test_loops2: PASS (1) + XFAIL (1)
*** test_loops: XFAIL (3)
*** test_misc: PASS (3)
*** test_nested_elif: PASS (3)
*** test_nested_ifs: PASS (1)
*** test_nested_scopes: XFAIL (2)
*** test_prettyprint: PASS (3)
*** test_print_to: PASS (3)
*** test_print: PASS (3)
*** test_sets: PASS (1)
*** test_single_stmt: PASS (3)
*** test_slices: PASS (3)
*** test_tuple_params: XFAIL (3)
*** test_tuples: XFAIL (3)
*** test_with: XFAIL (1)
*** test_yield: PASS (2)
*** try_except_finally: PASS (1)
*** unicode_future: PASS (4)
*** unicode_py3: PASS (2)
*** unicode: PASS (2)
*** unpack_assign: PASS (7)
*** unpack_empty: PASS (2)
*** variable_annotations: PASS (1)
*** while_loops2: PASS (1)
*** while_loop: PASS (1)
*** yield_from: PASS (4)
[100%] Built target check
If I run pycdc regardless, I get lots of Unsupported opcode and # WARNING: Decompyle incomplete in the output.
$ ./pycdc/pycdc code.cpython-311.pyc > code.py
Unsupported opcode: POP_JUMP_FORWARD_IF_FALSE
Unsupported opcode: POP_JUMP_FORWARD_IF_FALSE
Unsupported opcode: KW_NAMES
Unsupported opcode: KW_NAMES
Unsupported opcode: POP_JUMP_FORWARD_IF_FALSE
Unsupported opcode: POP_JUMP_FORWARD_IF_FALSE
Unsupported opcode: CALL_FUNCTION_EX
Unsupported opcode: MAKE_CELL
Unsupported opcode: POP_JUMP_FORWARD_IF_NOT_NONE
Unsupported opcode: MAKE_CELL
Unsupported opcode: MAKE_CELL
Unsupported opcode: MAKE_CELL
Unsupported opcode: POP_JUMP_FORWARD_IF_NOT_NONE
Any help appreciated!!
For auto-build you can see this: https://github.com/TheHellTower/decompyle-builds For a Release built and ready-to-use: https://github.com/TheHellTower/decompyle-builds/releases/tag/build-11-Jun-2023-753d42d
Duplicate #452