-
-
【原创】第六题 WP
-
发表于: 2019-6-27 19:00 5715
-
F5 直接拉起
const char *base64code = "tuvwxTUlmnopqrs7YZabcdefghij8yz0123456VWXkABCDEFGHIJKLMNOPQRS9+/"; const char *code = "!NGV%,$h1f4S3%2P(hkQ94=="; using namespace std; inline int charEncrypt(int data) { int dataa; dataa = base64code[data]; if (dataa > '@' && dataa <= 'Z') return 0x9B - dataa; if (dataa > 0x60 && dataa <= 'z') return dataa - 64; if (dataa > '/' && dataa <= '9') return dataa + 50; if (dataa == '+') return 'w'; if (dataa == '/') dataa = 'y'; return dataa; } void OnDecodeStart(const char *code) { unsigned short i, j, k; BYTE temp[5] = {0}; //cout << code[0] << code[1] << code[2] << code[3]; for (i = 0x20; i < 0x7f;i++ ) { for (j = 0x20; j < 0x7f;j++) { for (k = 0x20; k < 0x7f; k++) { temp[0] = charEncrypt((i >> 2) & 0x3f); temp[1] = 16 * i & 0x30; temp[1] = temp[1] | (j >> 4); temp[1] = charEncrypt(temp[1]); temp[2] = 4 * j & 0x3C; temp[2] = temp[2] | (k >> 6); temp[2] = charEncrypt(temp[2]); temp[3] = (k & 0x3F); temp[3] = charEncrypt(temp[3]); if (temp[0] == code[0] && temp[1] == code[1] && temp[2] == code[2] && temp[3] == code[3]) { std::cout << (char)i << (char)j << (char)k; } } } } } int OnsolveStart() { for (int i = 0; i < 6; i++) { OnDecodeStart(code+i*4); } BYTE temp[3]; for (int i = 0x20; i < 0x7f; i++) { temp[0]= charEncrypt((i >> 2) & 0x3f); temp[1] = 16 * i & 0x30; temp[1] = temp[1]; temp[1] = charEncrypt(temp[1]); if (temp[0] == '9' && temp[1] == '4') { cout << (char)i; } } return 1; } int main() { OnsolveStart(); OnDecodeStart("abcd"); return 0; }得到答案 KanXue2019ctf_st
const char *base64code = "tuvwxTUlmnopqrs7YZabcdefghij8yz0123456VWXkABCDEFGHIJKLMNOPQRS9+/"; const char *code = "!NGV%,$h1f4S3%2P(hkQ94=="; using namespace std; inline int charEncrypt(int data) { int dataa; dataa = base64code[data]; if (dataa > '@' && dataa <= 'Z') return 0x9B - dataa; if (dataa > 0x60 && dataa <= 'z') return dataa - 64; if (dataa > '/' && dataa <= '9') return dataa + 50; if (dataa == '+') return 'w'; if (dataa == '/') dataa = 'y'; return dataa; } void OnDecodeStart(const char *code) { unsigned short i, j, k; BYTE temp[5] = {0}; //cout << code[0] << code[1] << code[2] << code[3]; for (i = 0x20; i < 0x7f;i++ ) { for (j = 0x20; j < 0x7f;j++) { for (k = 0x20; k < 0x7f; k++) { temp[0] = charEncrypt((i >> 2) & 0x3f); temp[1] = 16 * i & 0x30; temp[1] = temp[1] | (j >> 4); temp[1] = charEncrypt(temp[1]); temp[2] = 4 * j & 0x3C; temp[2] = temp[2] | (k >> 6); temp[2] = charEncrypt(temp[2]); temp[3] = (k & 0x3F); temp[3] = charEncrypt(temp[3]); if (temp[0] == code[0] && temp[1] == code[1] && temp[2] == code[2] && temp[3] == code[3]) { std::cout << (char)i << (char)j << (char)k; } } } } } int OnsolveStart() { for (int i = 0; i < 6; i++) { OnDecodeStart(code+i*4); } BYTE temp[3]; for (int i = 0x20; i < 0x7f; i++) { temp[0]= charEncrypt((i >> 2) & 0x3f); temp[1] = 16 * i & 0x30; temp[1] = temp[1]; temp[1] = charEncrypt(temp[1]); if (temp[0] == '9' && temp[1] == '4') { cout << (char)i; } } return 1; } int main() { OnsolveStart(); OnDecodeStart("abcd"); return 0; }
const char *base64code = "tuvwxTUlmnopqrs7YZabcdefghij8yz0123456VWXkABCDEFGHIJKLMNOPQRS9+/"; const char *code = "!NGV%,$h1f4S3%2P(hkQ94=="; using namespace std; inline int charEncrypt(int data) { int dataa; dataa = base64code[data]; if (dataa > '@' && dataa <= 'Z') return 0x9B - dataa; if (dataa > 0x60 && dataa <= 'z') return dataa - 64; if (dataa > '/' && dataa <= '9') return dataa + 50; if (dataa == '+') return 'w'; if (dataa == '/') dataa = 'y'; return dataa; } void OnDecodeStart(const char *code) { unsigned short i, j, k; BYTE temp[5] = {0}; //cout << code[0] << code[1] << code[2] << code[3]; for (i = 0x20; i < 0x7f;i++ ) { for (j = 0x20; j < 0x7f;j++) { for (k = 0x20; k < 0x7f; k++) { temp[0] = charEncrypt((i >> 2) & 0x3f); temp[1] = 16 * i & 0x30; temp[1] = temp[1] | (j >> 4); temp[1] = charEncrypt(temp[1]); temp[2] = 4 * j & 0x3C; temp[2] = temp[2] | (k >> 6); temp[2] = charEncrypt(temp[2]); temp[3] = (k & 0x3F); temp[3] = charEncrypt(temp[3]); if (temp[0] == code[0] && temp[1] == code[1] && temp[2] == code[2] && temp[3] == code[3]) { std::cout << (char)i << (char)j << (char)k; } } } } } int OnsolveStart() { for (int i = 0; i < 6; i++) { OnDecodeStart(code+i*4); } BYTE temp[3]; for (int i = 0x20; i < 0x7f; i++) { temp[0]= charEncrypt((i >> 2) & 0x3f); temp[1] = 16 * i & 0x30; temp[1] = temp[1]; temp[1] = charEncrypt(temp[1]); if (temp[0] == '9' && temp[1] == '4') { cout << (char)i; } } return 1; } int main() { OnsolveStart(); OnDecodeStart("abcd"); return 0; }
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)
赞赏
他的文章
- 【原创】第六题 WP 5716
- [原创]第三题 write up by 青蛙Mage 6688
- [原创]第十题 write up by 青蛙mage 2195
- [原创]第一题write up 2468
看原图
赞赏
雪币:
留言: