This repository has been archived by the owner on Jan 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.c
127 lines (109 loc) · 4.17 KB
/
main.c
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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
unsigned char s1[] =
{
199, 254, 188, 253, 21, 141, 78, 155, 56, 118,
146, 165, 159, 135, 1, 91, 143, 16, 228, 211,
80, 149, 163, 212, 0, 29, 210, 239, 171, 24,
70, 240, 19, 145, 167, 68, 104, 130, 20, 119,
206, 162, 112, 205, 7, 196, 75, 160, 183, 99,
96, 98, 85, 236, 153, 76, 222, 71, 233, 59,
93, 66, 83, 41, 13, 48, 124, 180, 54, 246,
39, 100, 117, 58, 191, 198, 178, 94, 175, 152,
3, 242, 49, 186, 213, 88, 238, 134, 115, 90,
126, 230, 219, 35, 111, 204, 173, 185, 164, 14,
215, 79, 11, 97, 214, 46, 243, 252, 116, 53,
235, 250, 241, 179, 61, 81, 227, 189, 12, 34,
190, 221, 108, 151, 6, 105, 187, 40, 218, 237,
109, 45, 72, 65, 169, 38, 60, 42, 229, 140,
62, 208, 150, 194, 51, 28, 154, 122, 4, 15,
87, 27, 144, 170, 133, 209, 17, 216, 197, 8,
63, 131, 157, 89, 203, 174, 207, 224, 10, 84,
47, 31, 9, 26, 132, 114, 121, 142, 103, 23,
86, 193, 127, 244, 249, 220, 67, 136, 32, 232,
156, 255, 202, 125, 226, 223, 201, 57, 195, 110,
172, 251, 33, 30, 64, 95, 245, 139, 177, 74,
43, 113, 166, 25, 82, 225, 200, 18, 77, 106,
55, 50, 5, 168, 2, 184, 107, 36, 22, 92,
52, 69, 247, 217, 73, 248, 148, 128, 176, 192,
147, 137, 102, 231, 120, 181, 101, 129, 234, 138,
37, 158, 123, 182, 161, 44, 88, 144, 176, 51,
226, 221, 219, 51, 231, 178, 230, 61, 130, 244,
115, 211, 9, 211, 178, 85, 94, 57, 88, 144,
133, 65, 52, 132, 52, 132, 8, 176, 24
};
unsigned char s2[] =
{
88, 144, 176, 51, 226, 221, 219, 51, 231, 178,
230, 61, 130, 244, 115, 211, 9, 211, 178, 85,
94, 57, 88, 144, 133, 65, 52, 132, 52, 132,
8, 176, 24
};
unsigned char map[] =
{
209, 9, 203, 99, 22, 52, 35, 230, 207, 144,
241, 24, 45, 185, 15, 44, 181, 0, 138, 29,
242, 6, 155, 81, 214, 164, 101, 62, 213, 172,
7, 84, 110, 173, 118, 105, 64, 136, 114, 149,
152, 31, 248, 89, 234, 111, 80, 163, 18, 85,
135, 112, 194, 212, 1, 120, 16, 97, 132, 93,
208, 130, 76, 3, 23, 192, 245, 243, 95, 165,
66, 151, 49, 42, 168, 71, 92, 77, 147, 2,
36, 100, 48, 141, 33, 193, 43, 232, 83, 131,
133, 73, 162, 17, 55, 190, 72, 182, 246, 158,
38, 53, 4, 14, 103, 107, 195, 217, 221, 159,
235, 20, 126, 186, 115, 128, 184, 189, 250, 202,
119, 215, 200, 117, 226, 187, 227, 28, 150, 54,
169, 13, 170, 63, 199, 177, 98, 56, 11, 252,
160, 39, 123, 178, 229, 251, 201, 21, 113, 244,
27, 254, 68, 46, 90, 121, 167, 25, 253, 59,
139, 34, 161, 236, 223, 102, 74, 237, 32, 134,
61, 108, 94, 153, 67, 175, 225, 10, 239, 211,
19, 222, 148, 104, 180, 205, 106, 220, 255, 60,
125, 231, 145, 41, 37, 197, 51, 109, 122, 57,
228, 58, 79, 30, 219, 65, 86, 78, 156, 129,
233, 183, 191, 224, 154, 82, 196, 140, 127, 12,
87, 47, 171, 116, 26, 146, 69, 70, 206, 75,
188, 240, 137, 249, 176, 179, 210, 88, 8, 204,
216, 198, 218, 50, 166, 40, 238, 91, 143, 5,
174, 157, 96, 142, 247, 124
};
unsigned char key[] =
{
137, 3, 94, 57, 136, 57, 57, 101, 165, 199,
82, 101, 165, 94, 82, 5, 82, 82, 3, 137,
72, 136, 165, 196, 57, 72, 57, 72, 82, 72,
26, 94, 101, 165, 94, 243, 72, 82, 72, 82,
5, 136, 72, 199, 199, 72, 165, 82, 3, 81,
101, 243, 5, 82, 57, 57, 137, 82, 3, 5,
81, 199, 199, 81, 17
};
char *decryptGiphyApiKey()
{
char *out;
out = malloc(34);
for(int i = 0; i < 33; i++)
out[i] = s1[s2[i]];
out[33] = '\0';
return out;
}
char* decryptSigningKey()
{
char *out;
out = malloc(66);
for(int i = 0; i < 65;i++)
out[i] = map[key[i]];
out[65] = '\0';
return out;
}
int main() {
char *giphy = decryptGiphyApiKey();
char *sign = decryptSigningKey();
printf("Giphy key: %s\n",giphy);
printf("\nNow the Request Signing key %s \n",sign);
printf("\nReddit, i think this should be an easy reverse engineering exercise, not the protection for your beloved app\n");
free(sign);
free(giphy);
return 0;
}