SUCTF2019_hardcpp

[SUCTF2019]hardcpp

ollvm混淆,去混淆后

image-20230322192248478

题目上面给了提示

image-20230322192340754

这串16进制MD5解密后就是#

写脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
unsigned char input[22];
unsigned char enc[20] = {
0xF3, 0x2E, 0x18, 0x36, 0xE1, 0x4C, 0x22, 0xD1, 0xF9, 0x8C, 0x40, 0x76, 0xF4, 0x0E, 0x00, 0x05,
0xA3, 0x90, 0x0E, 0xA5
};
input[0] = '#';
for(int i = 1; i < 21; i++) {
unsigned char x = ((input[i-1] ^ 18) * 3) + 2;
unsigned char y = enc[i-1] ^ x;
y = y - (input[i-1] % 7);
input[i] = y ^ 0;
}
for(int i = 0; i < 21; i++) {
printf("%c", input[i]);
}
return 0;
}

flag{mY-CurR1ed_Fns}