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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
| #include <cstdio>
#include "defs.h"
unsigned char ida_chars[] =
{
0x26, 0x27, 0xF6, 0x85, 0x97, 0x15, 0xAD, 0x1D, 0xD2, 0x94,
0xDD, 0xC4, 0x76, 0x19, 0x39, 0x31, 0xF1, 0xAD, 0xB5, 0x58,
0xF0, 0x93, 0x97, 0x32, 0x19, 0x2B, 0xD1, 0xC0, 0xFD, 0x16,
0x8E, 0x4E, 0x48, 0x9B, 0x0B, 0xF5, 0x3B, 0x49, 0xA8, 0x63,
0x5D, 0xDE, 0x3F, 0xDF, 0x6D, 0x68, 0xB4, 0x87, 0x9A, 0xAA,
0xCD, 0xDC, 0xF7, 0xC1, 0x44, 0x81, 0x29, 0x08, 0x1B, 0x40,
0x62, 0x38, 0x30, 0x4E, 0x94, 0xD4, 0x11, 0xD0, 0xDE, 0xC4,
0x11, 0x9D, 0x4B, 0x3F, 0x9C, 0x46, 0xBB, 0xEF, 0xC7, 0x54,
0x21, 0x50, 0x2B, 0xD0, 0xEF, 0x5A, 0xF4, 0x09, 0xCF, 0x5F,
0x35, 0x91, 0x94, 0x36, 0x7F, 0x89, 0x70, 0x99, 0xB1, 0x1E,
0x67, 0xCC, 0x11, 0x54, 0x03, 0x7F, 0x9C, 0x03, 0x4A, 0xF6,
0x9B, 0x1E, 0xED, 0x67, 0x77, 0x3B, 0xC2, 0xA4,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, 0xCF, 0xDF,
0x80, 0x74, 0x69, 0x20, 0x5D, 0xBE, 0x8C, 0xAB, 0x5E, 0x11,
0x1A, 0x44, 0x4A, 0xE0, 0x6A, 0xAF, 0x3B, 0x04, 0x7D, 0x79,
0x09, 0xE5, 0x46, 0x0E, 0xEE, 0x9D, 0x36, 0xA8, 0xB1, 0x39,
0xB0, 0xF0, 0x5F, 0x02, 0x60, 0x63, 0xBB, 0xFB, 0xC4, 0xBB,
0x01, 0xF4, 0x8A, 0xDE, 0x3C, 0x06, 0x90, 0x1F, 0x8C, 0x47,
0xC4, 0x04, 0x8E, 0x9D, 0xBF, 0xAD, 0x95, 0x84, 0x68, 0x89,
0x9A, 0x4F, 0xF4, 0x6B, 0x52, 0x73, 0x0D, 0xEC, 0x99, 0x83,
0x61, 0x2F, 0xB3, 0x1B, 0x8F, 0xD8, 0x84, 0x1F, 0x91, 0xA6,
0xBF, 0xBE, 0x63, 0xA0, 0xEE, 0x16, 0xD5, 0x70, 0x73, 0xFC,
0xD9, 0x4E, 0x8E, 0xE0, 0x92, 0xEF, 0x4A, 0xEB, 0xEB, 0xCB,
0x7E, 0xA7
};
unsigned char table[256], inv[256];
void encode()
{
unsigned char Buf1[0x200], v28[0x100];
int m, n, ii, jj, ll, kk, x;
for (m = 0; m < 2; m++)
{
for (n = 0i64; n < 0x10; n++)
{
for (ii = 0i64; ii < 0x100; ii++)
Buf1[m * 0x100 + ii] = table[(unsigned __int8)Buf1[m * 0x100 + ii]];
for (jj = 1i64; jj < 0x11; jj++)
{
for (kk = 0i64; kk < 0x10; kk++)
{
v28[16 * jj - 16 + kk] = ida_chars[kk + 16 * n] * jj;
}
}
for (x = 0i64; x < 0x100; x++)
{
Buf1[m * 0x100 + x] ^= v28[x];
Buf1[m * 0x100 + x] += x;
}
}
}
}
void decode()
{
unsigned char v28[0x100];
for (int m = 1; m >= 0; m--)
{
for (int n = 0x10 - 1; n >= 0; n--)
{
for (int jj = 1i64; jj < 0x11; jj++)
{
for (int kk = 0i64; kk < 0x10; kk++)
{
v28[16 * jj - 16 + kk] = ida_chars[kk + 16 * n] * jj;
}
}
for (int x = 0x100 - 1; x >= 0; x--)
{
endata[m * 0x100 + x] -= x;
endata[m * 0x100 + x] ^= v28[x];
}
for (int i = 0; i < 0x100; i++)
{
endata[m * 0x100 + i] = inv[endata[m * 0x100 + i]];
}
}
}
}
int main()
{
int k, l;
for (k = 0i64; k < 0x10; k += (~k | 1) + (k | 1) + 1)
{
for (l = 0i64; l < 0x10; l = 2 * (l | 1) - ((l & 1) == 0) - ((l | 1) & 0xFFFFFFFFFFFFFFFEui64))
table[16 * k + l] = 2 * (l | (16 * (15 - k))) - (l & ~(16 * (15 - k))) - (~(_BYTE)l & (l | (16 * (15 - k))));
}
for (int i = 0; i < 0x100; i++) inv[table[i]] = i;
//fun();
decode();
for (int i = 0; i < 0x10; i++)
{
printf("\"");
for (int j = 0; j < 0x20; j++)
printf("%02x", endata[i * 0x20 + j]);
printf("\", \n");
}
return 0;
}
|