ezUPX
ezPYC
Pyinstller打包的exe文件反编译
安装pyinstxtractor
把exe文件和pyinstxtractor放在一个目录下面
发现
用16进制编辑器(此处为010)打开生产的文件夹下struck文件(与pyc在同一文件夹),复制前面8个字节(由于用PyInstaller打包后,pyc文件的前8个字节会被抹掉,所以最后要自己添加回去。前四个字节为python编译的版本,后四个字节为时间戳。四个字节的magic number、四个字节的timestamp)
替换前pyc文件
打开包名(无后缀名)的文件,把刚才复制的第一行信息添加到首行
添加好信息后,给该文件添加后缀.pyc
反编译时报错
用010打开ezPYC在开头插入字节码,python版本各不相同
Python 2.7: \x03\xf3\x0d\x0a\0\0\0\0
Python 3.0: \x3b\x0c\x0d\x0a\0\0\0\0
Python 3.1: \x4f\x0c\x0d\x0a\0\0\0\0
Python 3.2: \x6c\x0c\x0d\x0a\0\0\0\0
Python 3.3: \x9e\x0c\x0d\x0a\0\0\0\0\0\0\0\0
Python 3.4: \xee\x0c\x0d\x0a\0\0\0\0\0\0\0\0
Python 3.5: \x17\x0d\x0d\x0a\0\0\0\0\0\0\0\0
Python 3.6: \x33\x0d\x0d\x0a\0\0\0\0\0\0\0\0
Python 3.7: \x42\x0d\x0d\x0a\0\0\0\0\0\0\0\0\0\0\0\0
Python 3.8: \x55\x0d\x0d\x0a\0\0\0\0\0\0\0\0\0\0\0\0
Python 3.9: \x61\x0d\x0d\x0a\0\0\0\0\0\0\0\0\0\0\0\0
Python 3.10: \x6f\x0d\x0d\x0a\0\0\0\0\0\0\0\0\0\0\0\0
打开文件夹里的一个.pyc文件取第一行数据用010插入到第一行
.pyc.反编译py
#include<stdio.h>
int main()
{
char flag[] =
{
87, 75, 71, 69, 83, 121, 83, 125, 117, 106, 108, 106, 94, 80, 48,
114, 100, 112, 112, 55, 94, 51, 112, 91, 48, 108, 119, 97, 115,
49, 112, 112, 48, 108, 100, 37, 124, 2};
int c[4] = {1,2,3,4};
int i;
char input[40]={0};
for(i=0;i<40;i++)
{
input[i] = flag[i]^c[i%4] ;
}
puts(input);
return 0;
}