Penulis masih mencoba untuk melakukan hal ini, bagi yang ingin mencoba, untuk sementara dapat membaca referensi dibawah ini. Sebagai informasi, .pyc yang saya miliki "sepertinya" dikompilasi menggunakan python 2.7
Laskar@OpenThinkLabs:$python -m unpyclib.application -Dq table.pyc
__doc__ = 'Generic table model'
------
File "/usr/local/lib/python2.7/dist-packages/unpyclib/decompile.py", line 1062, in codeDecompile
stack, curIndent)
File "/usr/local/lib/python2.7/dist-packages/unpyclib/decompile.py", line 193, in _POP_TOP
r += ind(curIndent) + str(o) + '\n'
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/dist-packages/unpyclib/application.py", line 242, in <module>
start()
File "/usr/local/lib/python2.7/dist-packages/unpyclib/application.py", line 225, in start
print decompiler.decompile(),
File "/usr/local/lib/python2.7/dist-packages/unpyclib/decompile.py", line 1102, in decompile
flowGraph.DFADecompile(self)
File "/usr/local/lib/python2.7/dist-packages/unpyclib/structure.py", line 807, in DFADecompile
mode='conditional')
File "/usr/local/lib/python2.7/dist-packages/unpyclib/decompile.py", line 1078, in codeDecompile
traceback.print_tb(sys.exc_info()[2]) + \
TypeError: cannot concatenate 'str' and 'NoneType' objects
Berhasil! :) [Update : HASIL TIDAK SEMPURNA]
Jika ingin decompile satu file :
Laskar@OpenThinkLabs: $ uncompyle2 -o tmp/ table.pyc
Jika ingin docompile seluruh file :
Laskar@OpenThinkLabs: $ uncompyle2 -o tmp/ *
working directory, adalah direktori tempat file .pyc berada.
Untuk informasi lebih lanjut tentang cara menggunakan uncompyle, tinggal jalankan perintah
Laskar@OpenThinkLabs: $ uncompyle2 -h
Setelah mencoba menggunakan fupy [4] hasilnya sempurna, tidak ada potongan kode yang hilang, jika menggunakan uncompyle2, ditemukan beberapa potongan kode yang hilang, sehingga jika dikompilasi ulang outputnya tidak akan sama.
Is it possible to decompile a compiled .pyc file into a .py file?, http://stackoverflow.com/questions/5287253/is-it-possible-to-decompile-a-compiled-pyc-file-into-a-py-file
Free Python decompiler that is not an online service?, http://stackoverflow.com/questions/48211/free-python-decompiler-that-is-not-an-online-service
uncompyle2, https://github.com/wibiti/uncompyle2