首页
社区
课程
招聘
[旧帖] [求助]编译后运行错误,求大神指点!感激不尽... 0.00雪花
发表于: 2013-1-3 00:55 1212

[旧帖] [求助]编译后运行错误,求大神指点!感激不尽... 0.00雪花

2013-1-3 00:55
1212
编译后程序无法运行,调试后发现错误出现在<mov eax, dword ptr [esi-4]>这句上,非法内存访问
求大神指点

附件里有我要解码的二进制文件的rar压缩包

程序代码如下:
char* readdir();
char* readfile();
void encode(char *buffer, int len);
char* encode1(char *buffer);
void encode2(char *buffer, char *key);
void encode3(char *buffer);
void rev(char *p);

char pass[] =
{
0x1E, 0x30, 0x38, 0x3C, 0x1A, 0x09, 0x26, 0x0B, 0x19, 0x10, 0x3A, 0x3C, 0x1A, 0x38, 0x26, 0x0B,
0x21, 0x3D, 0x3A, 0x34, 0x11, 0x0C, 0x2E, 0x1A, 0x2F, 0x03, 0x32, 0x36, 0x22, 0x02, 0x2D, 0x1A,
0x14, 0x29, 0x36, 0x16, 0x26, 0x25, 0x2D, 0x32, 0x00, 0x0E, 0x36, 0x07, 0x0B, 0x2B, 0x0D, 0x36,
0x1B, 0x18, 0x27, 0x07, 0x09, 0x16, 0x1D, 0x36, 0x02, 0x37, 0x27, 0x07, 0x14, 0x0A, 0x19, 0x35,
0x07, 0x15, 0x27, 0x0F, 0x14, 0x01, 0x19, 0x35, 0x28, 0x05, 0x0F, 0x0B, 0x0E, 0x34, 0x1B, 0x35,
0x0C, 0x3A, 0x0D, 0x2B, 0x33, 0x10, 0x1B, 0x3D, 0x32, 0x28, 0x0D, 0x3B, 0x10, 0x33, 0x33, 0x2D,
0x24, 0x00, 0x1D, 0x39, 0x3D, 0x0E, 0x32, 0x2D, 0x23, 0x16, 0x19, 0x39, 0x20, 0x25, 0x36, 0x0F,
0x18, 0x07, 0x39, 0x38, 0x2D, 0x11, 0x36, 0x0B, 0x14, 0x27, 0x39, 0x3C, 0x08, 0x1B, 0x26, 0x0B
};
char key1[] =
{
0x00, 0x04, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x04, 0x01, 0x01,
0x04, 0x00, 0x01, 0x01, 0x04, 0x04, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x01, 0x01, 0x04, 0x04, 0x01, 0x01, 0x00, 0x04, 0x00, 0x00,
0x04, 0x04, 0x00, 0x01, 0x04, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00,
0x04, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x04, 0x01, 0x00,
0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x04, 0x04, 0x00, 0x01,
0x04, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x01, 0x04, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x04, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x01, 0x00, 0x04, 0x04, 0x01, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
0x00, 0x04, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00,
0x04, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x04, 0x00, 0x00, 0x01,
0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x01, 0x04, 0x04, 0x01, 0x00,
0x04, 0x04, 0x01, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x04, 0x04, 0x00, 0x01,
0x04, 0x00, 0x00, 0x01, 0x04, 0x04, 0x00, 0x00, 0x04, 0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x01,
0x04, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
0x04, 0x00, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x01
};
char key2[] =
{
0x20, 0x80, 0x10, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x20, 0x80, 0x10, 0x00,
0x00, 0x00, 0x10, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x10, 0x80, 0x20, 0x80, 0x00, 0x80,
0x20, 0x00, 0x00, 0x80, 0x20, 0x80, 0x10, 0x80, 0x00, 0x80, 0x10, 0x80, 0x00, 0x00, 0x00, 0x80,
0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x10, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x10, 0x80,
0x00, 0x80, 0x10, 0x00, 0x20, 0x00, 0x10, 0x00, 0x20, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x20, 0x80, 0x10, 0x00, 0x00, 0x00, 0x10, 0x80,
0x20, 0x00, 0x10, 0x00, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x10, 0x00,
0x20, 0x80, 0x00, 0x00, 0x00, 0x80, 0x10, 0x80, 0x00, 0x00, 0x10, 0x80, 0x20, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x20, 0x80, 0x10, 0x00, 0x20, 0x00, 0x10, 0x80, 0x00, 0x00, 0x10, 0x00,
0x20, 0x80, 0x00, 0x80, 0x00, 0x00, 0x10, 0x80, 0x00, 0x80, 0x10, 0x80, 0x00, 0x80, 0x00, 0x00,
0x00, 0x00, 0x10, 0x80, 0x00, 0x80, 0x00, 0x80, 0x20, 0x00, 0x00, 0x00, 0x20, 0x80, 0x10, 0x80,
0x20, 0x80, 0x10, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0x20, 0x80, 0x00, 0x00, 0x00, 0x80, 0x10, 0x80, 0x00, 0x00, 0x10, 0x00, 0x20, 0x00, 0x00, 0x80,
0x20, 0x00, 0x10, 0x00, 0x20, 0x80, 0x00, 0x80, 0x20, 0x00, 0x00, 0x80, 0x20, 0x00, 0x10, 0x00,
0x00, 0x80, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x20, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x80, 0x20, 0x00, 0x10, 0x80, 0x20, 0x80, 0x10, 0x80, 0x00, 0x80, 0x10, 0x00
};
char key3[] =
{
0x08, 0x02, 0x00, 0x00, 0x00, 0x02, 0x02, 0x08, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x08,
0x00, 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x08, 0x02, 0x02, 0x00, 0x00, 0x02, 0x00, 0x08,
0x08, 0x00, 0x02, 0x00, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00,
0x08, 0x02, 0x02, 0x08, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x08, 0x08, 0x02, 0x00, 0x00,
0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x08, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x08, 0x08, 0x00, 0x02, 0x08, 0x08, 0x02, 0x02, 0x00,
0x08, 0x02, 0x00, 0x08, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x02, 0x00, 0x08,
0x08, 0x00, 0x00, 0x00, 0x08, 0x02, 0x02, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
0x00, 0x02, 0x02, 0x08, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x02, 0x00, 0x08, 0x02, 0x00, 0x00,
0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x02, 0x08, 0x00, 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x08, 0x02, 0x02, 0x08, 0x00, 0x02, 0x00, 0x08,
0x08, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x08,
0x08, 0x02, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x02, 0x02, 0x08,
0x08, 0x00, 0x00, 0x00, 0x08, 0x02, 0x02, 0x00, 0x00, 0x02, 0x02, 0x00, 0x08, 0x00, 0x00, 0x08,
0x00, 0x00, 0x02, 0x08, 0x08, 0x02, 0x00, 0x08, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x08,
0x08, 0x02, 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x08, 0x00, 0x02, 0x02, 0x00
};
char key4[] =
{
0x01, 0x20, 0x80, 0x00, 0x81, 0x20, 0x00, 0x00, 0x81, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x80, 0x20, 0x80, 0x00, 0x81, 0x00, 0x80, 0x00, 0x01, 0x00, 0x80, 0x00, 0x01, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x80, 0x00, 0x00, 0x20, 0x80, 0x00, 0x81, 0x20, 0x80, 0x00,
0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x01, 0x00, 0x80, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x01, 0x20, 0x80, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x01, 0x20, 0x00, 0x00, 0x80, 0x20, 0x00, 0x00,
0x81, 0x00, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, 0x20, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00,
0x00, 0x20, 0x00, 0x00, 0x80, 0x20, 0x80, 0x00, 0x81, 0x20, 0x80, 0x00, 0x81, 0x00, 0x00, 0x00,
0x80, 0x00, 0x80, 0x00, 0x01, 0x00, 0x80, 0x00, 0x00, 0x20, 0x80, 0x00, 0x81, 0x20, 0x80, 0x00,
0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x80, 0x00,
0x80, 0x20, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x81, 0x00, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x20, 0x80, 0x00, 0x81, 0x20, 0x00, 0x00, 0x81, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
0x81, 0x20, 0x80, 0x00, 0x81, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
0x01, 0x00, 0x80, 0x00, 0x01, 0x20, 0x00, 0x00, 0x80, 0x20, 0x80, 0x00, 0x81, 0x00, 0x80, 0x00,
0x01, 0x20, 0x00, 0x00, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x01, 0x20, 0x80, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x20, 0x00, 0x00, 0x80, 0x20, 0x80, 0x00
};
char key5[] =
{
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x02, 0x00, 0x00, 0x08, 0x02, 0x00, 0x01, 0x00, 0x42,
0x00, 0x00, 0x08, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x08, 0x02,
0x00, 0x01, 0x08, 0x40, 0x00, 0x00, 0x08, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x08, 0x40,
0x00, 0x01, 0x00, 0x42, 0x00, 0x00, 0x08, 0x42, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x40,
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x40, 0x00, 0x00, 0x08, 0x40, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x08, 0x42, 0x00, 0x01, 0x08, 0x42, 0x00, 0x01, 0x00, 0x02,
0x00, 0x00, 0x08, 0x42, 0x00, 0x01, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42,
0x00, 0x01, 0x08, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x42, 0x00, 0x01, 0x08, 0x00,
0x00, 0x00, 0x08, 0x00, 0x00, 0x01, 0x00, 0x42, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x08, 0x02, 0x00, 0x01, 0x00, 0x42, 0x00, 0x01, 0x08, 0x40,
0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x08, 0x42, 0x00, 0x01, 0x08, 0x02,
0x00, 0x01, 0x08, 0x40, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x08, 0x42,
0x00, 0x01, 0x08, 0x42, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x01, 0x08, 0x42,
0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x40, 0x00, 0x00, 0x00, 0x42,
0x00, 0x01, 0x08, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x40, 0x00, 0x00, 0x08, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x40, 0x00, 0x01, 0x08, 0x02, 0x00, 0x01, 0x00, 0x40,
};
char key6[] =
{
0x10, 0x00, 0x00, 0x20, 0x00, 0x00, 0x40, 0x20, 0x00, 0x40, 0x00, 0x00, 0x10, 0x40, 0x40, 0x20,
0x00, 0x00, 0x40, 0x20, 0x10, 0x00, 0x00, 0x00, 0x10, 0x40, 0x40, 0x20, 0x00, 0x00, 0x40, 0x00,
0x00, 0x40, 0x00, 0x20, 0x10, 0x40, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x10, 0x00, 0x00, 0x20,
0x10, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x40, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x40, 0x00, 0x10, 0x40, 0x00, 0x20, 0x00, 0x40, 0x00, 0x00,
0x00, 0x40, 0x40, 0x00, 0x10, 0x40, 0x00, 0x20, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x40, 0x20,
0x10, 0x00, 0x40, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40, 0x40, 0x00, 0x00, 0x40, 0x40, 0x20,
0x10, 0x40, 0x00, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x40, 0x40, 0x20, 0x00, 0x00, 0x00, 0x20,
0x00, 0x40, 0x00, 0x20, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x40, 0x20, 0x00, 0x40, 0x40, 0x00,
0x10, 0x40, 0x40, 0x20, 0x00, 0x00, 0x40, 0x00, 0x10, 0x40, 0x00, 0x00, 0x10, 0x00, 0x00, 0x20,
0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x40, 0x00, 0x00,
0x10, 0x00, 0x00, 0x20, 0x10, 0x40, 0x40, 0x20, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x40, 0x20,
0x10, 0x40, 0x40, 0x00, 0x00, 0x40, 0x40, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x40, 0x20,
0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0x10, 0x40, 0x40, 0x00,
0x00, 0x40, 0x00, 0x00, 0x10, 0x00, 0x40, 0x00, 0x10, 0x40, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
0x00, 0x40, 0x40, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x00, 0x40, 0x00, 0x10, 0x40, 0x00, 0x20,
};
char key7[] =
{
0x00, 0x00, 0x20, 0x00, 0x02, 0x00, 0x20, 0x04, 0x02, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00, 0x02, 0x08, 0x00, 0x04, 0x02, 0x08, 0x20, 0x00, 0x00, 0x08, 0x20, 0x04,
0x02, 0x08, 0x20, 0x04, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 0x00, 0x20, 0x04, 0x02, 0x08, 0x00, 0x00,
0x00, 0x08, 0x00, 0x04, 0x02, 0x08, 0x20, 0x00, 0x02, 0x00, 0x20, 0x00, 0x00, 0x08, 0x00, 0x04,
0x02, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20, 0x04, 0x00, 0x08, 0x20, 0x04, 0x02, 0x00, 0x20, 0x00,
0x00, 0x00, 0x20, 0x04, 0x00, 0x08, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x02, 0x08, 0x20, 0x04,
0x00, 0x08, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x20, 0x00,
0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x02, 0x08, 0x00, 0x04,
0x02, 0x08, 0x00, 0x04, 0x02, 0x00, 0x20, 0x04, 0x02, 0x00, 0x20, 0x04, 0x02, 0x00, 0x00, 0x00,
0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x20, 0x00,
0x00, 0x08, 0x20, 0x04, 0x02, 0x08, 0x00, 0x00, 0x02, 0x08, 0x20, 0x00, 0x00, 0x08, 0x20, 0x04,
0x02, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x02, 0x08, 0x20, 0x04, 0x00, 0x00, 0x20, 0x04,
0x00, 0x08, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x08, 0x20, 0x04,
0x00, 0x00, 0x00, 0x00, 0x02, 0x08, 0x20, 0x00, 0x00, 0x00, 0x20, 0x04, 0x00, 0x08, 0x00, 0x00,
0x02, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x20, 0x00,
};
char key8[] =
{
0x40, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x40, 0x10, 0x04, 0x10,
0x00, 0x00, 0x00, 0x10, 0x40, 0x10, 0x00, 0x10, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
0x40, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x10, 0x40, 0x10, 0x04, 0x10, 0x00, 0x10, 0x04, 0x00,
0x00, 0x10, 0x04, 0x10, 0x40, 0x10, 0x04, 0x00, 0x00, 0x10, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x00, 0x00, 0x04, 0x10, 0x40, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x40, 0x10, 0x00, 0x00,
0x00, 0x10, 0x04, 0x00, 0x40, 0x00, 0x04, 0x00, 0x40, 0x00, 0x04, 0x10, 0x00, 0x10, 0x04, 0x10,
0x40, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x04, 0x10,
0x40, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x40, 0x10, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00,
0x40, 0x10, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x10, 0x04, 0x10, 0x00, 0x10, 0x00, 0x00,
0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x04, 0x10, 0x00, 0x10, 0x00, 0x00, 0x40, 0x10, 0x04, 0x00,
0x00, 0x10, 0x00, 0x10, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x10, 0x00, 0x00, 0x04, 0x10,
0x40, 0x00, 0x04, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x04, 0x00, 0x40, 0x10, 0x00, 0x10,
0x00, 0x00, 0x00, 0x00, 0x40, 0x10, 0x04, 0x10, 0x40, 0x00, 0x04, 0x00, 0x40, 0x00, 0x00, 0x10,
0x00, 0x00, 0x04, 0x10, 0x00, 0x10, 0x00, 0x10, 0x40, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
0x40, 0x10, 0x04, 0x10, 0x00, 0x10, 0x04, 0x00, 0x00, 0x10, 0x04, 0x00, 0x40, 0x10, 0x00, 0x00,
0x40, 0x10, 0x00, 0x00, 0x40, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x04, 0x10,
};

int _tmain(int argc, _TCHAR* argv[])
{
    char *p;
    char *t;
    p = readfile();
    encode(p + 0x30, 0x20);
    encode(p + 0x50, 0x20);
    encode(p + 0x70, 0x10);
    encode(p + 0x80, 0x10);
    encode(p + 0x80, 0x10);
    encode(p + 0x8, 0x28);
    encode(p + 0xA4, 0x10);
    encode(p + 0xE4, 0x10);
    return 0;
}

char* readdir()
{
    //读取注册表,获取安装路径
    char *dir;
    dir = new char[1024];
    DWORD dwType = REG_SZ;
    DWORD dwLength = 1024;
    HKEY rp;
    int l;
    int f;
    if (RegOpenKeyA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Classes\\ecp\\", &rp) != ERROR_SUCCESS)
    {
        MessageBoxA(0, "打开注册表错误", "提示", 0);
        ExitProcess(0);
    }
    l = sizeof(dir);
    if (RegQueryValueExA(rp, "URL Protocol", 0, &dwType, (LPBYTE)dir, &dwLength) != ERROR_SUCCESS)
    {
        MessageBoxA(0, "读取注册表错误", "提示", 0);
        ExitProcess(0);
    }
    l = strlen(dir);
    f = 3;
    while (f)
    {
        l--;
        if (dir[l] == '\\')
        {
            f--;
        }
        dir[l] = 0;
    }
    strcat(dir, "\\bin\\Credit");
    return dir;
}

char* readfile()
{
    char* buffer;
    buffer = new char[0x168c];
    FILE *fp;
    fp = fopen(readdir(), "rb");
    if (!fp)
    {
        MessageBoxA(0, "读取文件出错", "提示", 0);
        ExitProcess(0);
    }
    fread(buffer, sizeof(char), 0x168c, fp);
    fclose(fp);
    return buffer;
}

void encode(char *buffer, int len)
{
    char *p;
    while (len)
    {
        p = encode1(buffer);
        encode2(buffer, p);
        encode3(buffer);
        len = len - 8;
        buffer = buffer + 8;
    }
}

char* encode1(char *buffer)
{
    char *p;
    p = new char[8];
    p[0] = buffer[3];
    p[1] = buffer[2];
    p[2] = buffer[1];
    p[3] = buffer[0];
    p[4] = buffer[7];
    p[5] = buffer[6];
    p[6] = buffer[5];
    p[7] = buffer[4];
    return p;
}

void encode3(char *buffer)
{
    char *p;
    p = buffer;
    char t;
    t = p[0];
    p[0] = p[3];
    p[3] = t;
    t = p[1];
    p[1] = p[2];
    p[2] = t;
    p = p + 4;
    t = p[0];
    p[0] = p[3];
    p[3] = t;
    t = p[1];
    p[1] = p[2];
    p[2] = t;
}

void encode2(char *buffer, char *key)
{
    __asm
    {
        lea eax, pass
        push eax
        lea eax, key
        push eax
        lea eax, buffer
        push eax
        mov ecx, dword ptr [esp+8]
        push ebx
        push ebp
        push esi
        mov eax, dword ptr [ecx]
        mov edx, dword ptr [ecx+4]
        mov ecx, eax
        mov esi, edx
        shr ecx, 4
        and ecx, 0x0F0F0F0F
        and esi, 0x0F0F0F0F
        xor ecx, esi
        push edi
        xor edx, ecx
        mov dword ptr [esp+0x10], 8
        shl ecx, 4
        xor eax, ecx
        mov esi, edx
        mov ecx, eax
        and esi, 0x0FFFF
        shr ecx, 0x10
        xor ecx, esi
        xor edx, ecx
        shl ecx, 0x10
        xor eax, ecx
        mov ecx, edx
        shr ecx, 2
        mov esi, eax
        and ecx, 0x33333333
        and esi, 0x33333333
        xor ecx, esi
        xor eax, ecx
        shl ecx, 2
        xor edx, ecx
        mov esi, eax
        mov ecx, edx
        and esi, 0x0FF00FF
        shr ecx, 8
        and ecx, 0x0FF00FF
        xor ecx, esi
        mov esi, dword ptr [esp+0x1C]
        xor eax, ecx
        shl ecx, 8
        xor edx, ecx
        mov ecx, edx
        add edx, edx
        shr ecx, 0x1F
        or ecx, edx
        mov edx, ecx
        xor edx, eax
        and edx, 0xAAAAAAAA
        xor eax, edx
        xor ecx, edx
        mov edx, eax
        add eax, eax
        shr edx, 0x1F
        or edx, eax
        L058:
        mov ebx, dword ptr [esi]
        mov eax, ecx
        mov edi, ecx
        add esi, 4
        shl eax, 0x1C
        shr edi, 4
        or eax, edi
        add esi, 4
        xor eax, ebx
        add esi, 4
        mov ebx, eax
        mov edi, eax
        shr ebx, 0x10
        and ebx, 0x3F
        add esi, 4
        shr edi, 0x18
        push eax
        lea eax, key3
        mov ebp, dword ptr [ebx*4+eax]
        pop eax
        mov ebx, eax
        and edi, 0x3F
        and eax, 0x3F
        shr ebx, 8
        push eax
        lea eax, key1
        mov edi, dword ptr [edi*4+eax]
        pop eax
        and ebx, 0x3F
        or edi, ebp
        push eax
        lea eax, key5
        mov ebp, dword ptr [ebx*4+eax]
        pop eax
        push ecx
        lea ecx, key7
        mov ebx, dword ptr [eax*4+ecx]
        pop ecx
        mov eax, dword ptr [esi-4]
        or edi, ebp
        xor eax, ecx
        or edi, ebx
        mov ebx, eax
        mov ebp, eax
        shr ebx, 0x18
        and ebx, 0x3F
        shr ebp, 0x10
        push eax
        lea eax, key2
        mov ebx, dword ptr [ebx*4+eax]
        pop eax
        and ebp, 0x3F
        push eax
        lea eax, key4
        or ebx, dword ptr [ebp*4+eax]
        pop eax
        mov ebp, eax
        shr ebp, 8
        and ebp, 0x3F
        and eax, 0x3F
        push eax
        lea eax, key6
        or ebx, dword ptr [ebp*4+eax]
        pop eax
        push ecx
        lea ecx, key8
        mov ebp, dword ptr [eax*4+ecx]
        pop ecx
        or ebx, ebp
        or ebx, edi
        xor edx, ebx
        mov ebx, dword ptr [esi-8]
        mov eax, edx
        mov edi, edx
        shl eax, 0x1C
        shr edi, 4
        or eax, edi
        xor eax, ebx
        mov ebx, eax
        mov edi, eax
        shr ebx, 0x10
        and ebx, 0x3F
        shr edi, 0x18
        push ecx
        lea ecx, key3
        mov ebp, dword ptr [ebx*4+ecx]
        pop ecx
        mov ebx, eax
        and edi, 0x3F
        and eax, 0x3F
        shr ebx, 8
        push ecx
        lea ecx, key1
        mov edi, dword ptr [edi*4+ecx]
        pop ecx
        and ebx, 0x3F
        or edi, ebp
        push ecx
        lea ecx, key5
        mov ebp, dword ptr [ebx*4+ecx]
        lea ecx, key7
        mov ebx, dword ptr [eax*4+ecx]
        pop ecx
        mov eax, dword ptr [esi-4]
        or edi, ebp
        xor eax, edx
        or edi, ebx
        mov ebx, eax
        mov ebp, eax
        shr ebx, 0x18
        and ebx, 0x3F
        shr ebp, 0x10
        push ecx
        lea ecx, key2
        mov ebx, dword ptr [ebx*4+ecx]
        and ebp, 0x3F
        lea ecx, key4
        or ebx, dword ptr [ebp*4+ecx]
        mov ebp, eax
        and eax, 0x3F
        shr ebp, 8
        and ebp, 0x3F
        lea ecx, key6
        or ebx, dword ptr [ebp*4+ecx]
        lea ecx, key8
        mov ebp, dword ptr [eax*4+ecx]
        pop ecx
        mov eax, dword ptr [esp+0x10]
        or ebx, ebp
        or ebx, edi
        xor ecx, ebx
        dec eax
        mov dword ptr [esp+10], eax
        jnz L058
        mov eax, ecx
        pop edi
        shl eax, 0x1F
        shr ecx, 1
        or eax, ecx
        mov ecx, eax
        xor ecx, edx
        and ecx, 0xAAAAAAAA
        xor edx, ecx
        xor eax, ecx
        mov ecx, edx
        mov esi, eax
        shl ecx, 0x1F
        shr edx, 1
        or ecx, edx
        and esi, 0x0FF00FF
        mov edx, ecx
        shr edx, 8
        and edx, 0x0FF00FF
        xor edx, esi
        xor eax, edx
        shl edx, 8
        xor ecx, edx
        mov esi, eax
        mov edx, ecx
        and esi, 0x33333333
        shr edx, 2
        and edx, 0x33333333
        xor edx, esi
        xor eax, edx
        shl edx, 2
        xor ecx, edx
        mov edx, eax
        mov esi, ecx
        shr edx, 0x10
        and esi, 0x0FFFF
        xor edx, esi
        xor ecx, edx
        shl edx, 0x10
        xor eax, edx
        mov esi, ecx
        mov edx, eax
        and esi, 0x0F0F0F0F
        shr edx, 4
        and edx, 0x0F0F0F0F
        xor edx, esi
        mov esi, edx
        shl esi, 4
        xor esi, eax
        mov eax, dword ptr [esp+0x14]
        xor edx, ecx
        mov dword ptr [eax], esi
        pop esi
        pop ebp
        mov dword ptr [eax+4], edx
        pop ebx
        pop ecx
    }
}

[培训]科锐逆向工程师培训第53期2025年7月8日开班!

上传的附件:
收藏
免费 0
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回