python字节码

结构: 源码行号 | 指令在函数中的偏移 | 指令符号 | 指令参数 | 实际参数值

32.12. dis - Disassembler for Python bytecode - Python 2.7.18 documentation

dis函数编译出来 利用dis 函数得到对应的 反编译代码 要利用对应版本python

通常 pycdc 的效果更好

pyc

Uncompyle6

**安装指令**:pip install uncompyle6

一般利用 Uncompyle6 对 .pyc 文件进行反编译 得到python文件

有能通过修改 .pyc文件 hex文件从而实现 Uncompyle6 不能反编译

在代码位置添加 跳转指令 在修改文件 header 头的大小结构,从而让 Uncompyle6 不能反编译

Pycdc ⭐⭐⭐

git clone <https://github.com/zrax/pycdc.git>
cd pycdc
cmake CMakeList.txt
make  # 生成 pycdc 转为 py文件  pycdas 转为python 字节码

还有一种 pycdc

PYC Disassembler: ./pycdas [PATH TO PYC FILE]

PYC Decompiler: ./pycdc [PATH TO PYC FILE]