-
Notifications
You must be signed in to change notification settings - Fork 2
/
step3
113 lines (107 loc) · 4.54 KB
/
step3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#include <stdio.h>
int Check_Basic_(char *input, char * step4_Bin, char * self);
unsigned char step3[] =
"\x55\x48\x89\xE5\x48\x83\xEC\x50\x48\x89\x7D\xC8\x48\x89\x75\xC0"
"\x48\x89\x55\xB8\x48\xC7\x45\xE0\x00\x00\x00\x00\x48\x8D\x45\xE0"
"\x48\x89\x45\xF8\xC7\x45\xF4\x00\x00\x00\x00\x48\xB8\x40\x56\x35"
"\x63\x4A\x46\x3D\x4F\x48\x89\x45\xD0\x66\xC7\x45\xD8\x25\x00\xE9"
"\xAD\x00\x00\x00\x48\x8B\x45\xF8\x48\x8D\x50\x01\x48\x89\x55\xF8"
"\x48\x8B\x55\xC8\x0F\xB6\x12\xC0\xFA\x02\x83\xC2\x30\x88\x10\x48"
"\x8B\x45\xF8\x48\x8D\x50\x01\x48\x89\x55\xF8\x48\x8B\x55\xC8\x0F"
"\xB6\x12\x0F\xBE\xD2\xC1\xE2\x04\x89\xD1\x83\xE1\x30\x48\x8B\x55"
"\xC8\x48\x83\xC2\x01\x0F\xB6\x12\xC0\xFA\x04\x01\xCA\x83\xC2\x30"
"\x88\x10\x48\x8B\x45\xF8\x48\x8D\x50\x01\x48\x89\x55\xF8\x48\x8B"
"\x55\xC8\x48\x83\xC2\x01\x0F\xB6\x12\x0F\xBE\xD2\xC1\xE2\x02\x89"
"\xD1\x83\xE1\x3C\x48\x8B\x55\xC8\x48\x83\xC2\x02\x0F\xB6\x12\xC0"
"\xFA\x06\x01\xCA\x83\xC2\x30\x88\x10\x48\x8B\x45\xF8\x48\x8D\x50"
"\x01\x48\x89\x55\xF8\x48\x8B\x55\xC8\x48\x83\xC2\x02\x0F\xB6\x12"
"\x83\xE2\x3F\x83\xC2\x30\x88\x10\x48\x83\x45\xC8\x03\x83\x45\xF4"
"\x01\x83\x7D\xF4\x01\x0F\x8E\x49\xFF\xFF\xFF\xC7\x45\xF4\x00\x00"
"\x00\x00\xEB\x23\x8B\x45\xF4\x48\x98\x0F\xB6\x54\x05\xE0\x8B\x45"
"\xF4\x48\x98\x0F\xB6\x44\x05\xD0\x38\xC2\x74\x07\xB8\x00\x00\x00"
"\x00\xEB\x65\x83\x45\xF4\x01\x83\x7D\xF4\x07\x7E\xD7\x48\x8B\x45"
"\xC0\x48\x89\x45\xE8\xC7\x45\xF4\x00\x00\x00\x00\xEB\x26\x8B\x45"
"\xF4\x48\x63\xD0\x48\x8B\x45\xC0\x48\x01\xD0\x8B\x55\xF4\x48\x63"
"\xCA\x48\x8B\x55\xC0\x48\x01\xCA\x0F\xB6\x12\x83\xF2\x23\x88\x10"
"\x83\x45\xF4\x01\x81\x7D\xF4\x08\x01\x00\x00\x7E\xD1\x48\x8B\x45"
"\xB8\x48\x8D\x88\x8a\x01\x00\x00\x48\x8B\x55\xC8\x48\x8B\x45\xE8"
"\x48\x89\xCE\x48\x89\xD7\xFF\xD0\xC9\xC3"
//char step5_after[] =
"\x65\x2e\xd6\xb7\x0d\xd6\x4d\x8e\x98\x17\xb5\x6f\x00\x56\x6f\x94"
"\x00\xab\x30\x2e\xd4\x17\xad\x50\x86\x76\x50\xe4\x00\xaf\x08\xa4"
"\x2a\x12\x0d\xd4\x75\x8e\x17\xd1\x85\x5e\x3f\xd0\x4f\x5d\xf3\x1a"
"\xc1\x5e\x9d\x27\x68\x17\xbb\x23\xb7\x1a\xc6\x9f\x32\x69\xe9\x42"
"\x4a\xe9\x75\x94\x67\x90\x30\x45\x78\xed\x1a\xba\x0d\xdc\xf0\x65"
"\x50\xe4\x55\x50\x86\x23\xac\x6a\x87\x2a\x37\xde\x5e\x52\x45\x5f"
"\xdb\x63\xe7\x52\x45\x5f\x30\x3b\x9c";
char step4_xor_0x23[] =
"\x76\x6b\xaa\xc6\x6b\xa0\xcf\x13\x6b\xaa\x5e\xfb\x6b\xaa\x56\xf3"
"\xe4\x66\xdf\x23\x23\x23\x23\xe4\x66\xdb\x23\x23\x23\x23\xe4\x66"
"\xc3\x31\x54\xc7\x17\x45\xe4\x66\xc7\x66\xc7\xe5\x66\xc5\x23\xc8"
"\x78\xa8\x66\xdf\x6b\x40\xf3\x6b\xa8\x66\xfb\x6b\x22\xf3\x2c\x95"
"\x23\xa0\xc3\x2c\xab\x66\xd4\xa8\x66\xdf\x6b\x40\xf3\x6b\xa8\x66"
"\xfb\x6b\x22\xf3\x2c\x95\x23\xe3\xdb\x27\xab\x66\xd5\xe3\x46\xd4"
"\x27\x2c\x95\x66\xd5\x2b\x66\xd4\x2c\x95\x66\xd4\xa0\xd3\x32\xab"
"\x66\xd5\xa8\x66\xdf\x6b\xbb\x2c\x95\x67\x26\xc3\x19\x66\xd5\x57"
"\x24\x9b\x23\x23\x23\x23\xc8\x5c\xa0\x66\xdf\x22\xa0\x5e\xdf\x26"
"\x5d\xbc\xe4\x66\xdf\x23\x23\x23\x23\xe4\x66\xdb\x23\x23\x23\x23"
"\xc8\x65\xa0\x5e\xdb\x25\x56\x24\xe4\x66\xdb\x23\x23\x23\x23\xa8"
"\x66\xdf\x6b\x40\xf3\x6b\xa8\x66\xf3\x6b\x22\xf3\xa8\x76\xdf\x6b"
"\x40\xe9\x6b\xa8\x76\xf3\x6b\x22\xe9\x2c\x95\x11\xa8\x76\xdb\x6b"
"\x40\xe9\x6b\xa8\x76\xfb\x6b\x22\xe9\x2c\x95\x31\x12\xd1\xab\x33"
"\xa0\x66\xdf\x22\xa0\x66\xdb\x22\xa0\x5e\xdf\x4b\x5d\x97\x6b\xa8"
"\x66\xf3\x6b\xaa\x66\xcb\x6b\xa8\x66\xfb\x6b\xae\x73\x25\x6b\xa8"
"\x66\xcb\x6b\xaa\xf4\xdc\xf3\xea\xe0";
int main()
{
char input[100];
int (*Check_0f_RE_ )(char*, char *, char *);
Check_0f_RE_ = (int(*)(char *,char *, char *))step3;
int result = 0;
scanf("%s",input);
printf("Step3: %s \n",input);
result = Check_0f_RE_(input,step4_xor_0x23,step3);
if(result == 0)
{
printf("NO\n");
}
else if(result == 1)
{
printf("OK\n");
}
else
{
printf("error!!!\n");
}
printf("===end===");
return 0;
}
int Check_Basic_(char *input, char * step4_Bin, char * self)
{
char point[8] = {0};
char * result = point;
int i = 0;
const char cmp[] = "@V5cJF=O%";
int (*_step4_ )(char*, char *);
for(;i < 2; i ++)
{
*result++ = 0x30 + (input[0] >> 2);
*result++ = 0x30 + (((input[0] & 0x03) << 4) + (input[1] >> 4));
*result++ = 0x30 + (((input[1] & 0x0f) << 2) + (input[2] >> 6));
*result++ = 0x30 + (input[2] & 0x3f);
input += 3;
}
for(i = 0; i < 8; i ++)
{
if(point[i]!=cmp[i])
{
return 0;
}
}
_step4_ = (int(*)(char *,char *))step4_Bin;
for(i = 0; i < 265 ; i ++)
{
step4_Bin[i] = step4_Bin[i] ^ 0x23;
}
return _step4_(input,self+0x1a3);
}