reverse3 注意:得到的 flag 请包上 flag{} 提交
下载下来
随便输入一下,直接退出。
用IDA 打开
找到关键的地方
这里就是输入的东西放到Str,v3是你输入的字符串的长度,v4不知道,然后有一个strncpy 把你输入的东西 经过sub_4110BE 函数曹祖后的值 复制到了Destination 这里,然后 又进行了一次for 循环的操作,最后和e3nifIH9b_C@n@dH这个东西进行对比。
现在的主要关键就是sub_4110BE 这个函数
点进去
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
| void *__cdecl sub_411AB0(char *a1, unsigned int a2, int *a3) { int v4; int v5; int v6; int v7; int i; unsigned int v9; int v10; int v11; void *v12; char *v13;
if ( !a1 || !a2 ) return 0; v9 = a2 / 3; if ( (int)(a2 / 3) % 3 ) ++v9; v10 = 4 * v9; *a3 = v10; v12 = malloc(v10 + 1); if ( !v12 ) return 0; j_memset(v12, 0, v10 + 1); v13 = a1; v11 = a2; v4 = 0; while ( v11 > 0 ) { byte_41A144[2] = 0; byte_41A144[1] = 0; byte_41A144[0] = 0; for ( i = 0; i < 3 && v11 >= 1; ++i ) { byte_41A144[i] = *v13; --v11; ++v13; } if ( !i ) break; switch ( i ) { case 1: *((_BYTE *)v12 + v4) = aAbcdefghijklmn[(int)(unsigned __int8)byte_41A144[0] >> 2]; v5 = v4 + 1; *((_BYTE *)v12 + v5) = aAbcdefghijklmn[((byte_41A144[1] & 0xF0) >> 4) | (16 * (byte_41A144[0] & 3))]; *((_BYTE *)v12 + ++v5) = aAbcdefghijklmn[64]; *((_BYTE *)v12 + ++v5) = aAbcdefghijklmn[64]; v4 = v5 + 1; break; case 2: *((_BYTE *)v12 + v4) = aAbcdefghijklmn[(int)(unsigned __int8)byte_41A144[0] >> 2]; v6 = v4 + 1; *((_BYTE *)v12 + v6) = aAbcdefghijklmn[((byte_41A144[1] & 0xF0) >> 4) | (16 * (byte_41A144[0] & 3))]; *((_BYTE *)v12 + ++v6) = aAbcdefghijklmn[((byte_41A144[2] & 0xC0) >> 6) | (4 * (byte_41A144[1] & 0xF))]; *((_BYTE *)v12 + ++v6) = aAbcdefghijklmn[64]; v4 = v6 + 1; break; case 3: *((_BYTE *)v12 + v4) = aAbcdefghijklmn[(int)(unsigned __int8)byte_41A144[0] >> 2]; v7 = v4 + 1; *((_BYTE *)v12 + v7) = aAbcdefghijklmn[((byte_41A144[1] & 0xF0) >> 4) | (16 * (byte_41A144[0] & 3))]; *((_BYTE *)v12 + ++v7) = aAbcdefghijklmn[((byte_41A144[2] & 0xC0) >> 6) | (4 * (byte_41A144[1] & 0xF))]; *((_BYTE *)v12 + ++v7) = aAbcdefghijklmn[byte_41A144[2] & 0x3F]; v4 = v7 + 1; break; } } *((_BYTE *)v12 + v4) = 0; return v12;
|
得到这样的一个东西,人傻了…
奇奇怪怪的
点进去就看到
就看到这个东西 , 及看到这个= 号 我就觉得是base64
先不管它,先把能逆向的代码先搞出来
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| #include <stdio.h> #include <string.h>
int main() { char a[100] = "e3nifIH9b_C@n@dH\0"; char b[sizeof(a)-1]; int i; for (i = 0; i < strlen(a); ++i) { b[i] = a[i] - i; printf("%c", b[i]); } return 0; }
|