迷宫题
1 __int64 __fastcall main(__int64 a1, char **a2, char **a3) 2 { 3 signed __int64 mid_i; // rbx 4 signed int mid_str; // eax 5 bool v5; // bp 6 bool v6; // al 7 const char *v7; // rdi 8 __int64 arr; // [rsp+0h] [rbp-28h] 9 10 arr = 0LL; 11 puts("Input flag:"); 12 scanf("%s", &s1, 0LL); 13 if ( strlen(&s1) != 24 || strncmp(&s1, "nctf{", 5uLL) || *(&byte_6010BF + 24) != '}' )// 输入24位,前5位为ntcf{ 第24位是} 14 { 15 LABEL_22: 16 puts("Wrong flag!"); 17 exit(-1); 18 } 19 mid_i = 5LL; 20 if ( strlen(&s1) - 1 > 5 ) 21 { 22 while ( 1 ) 23 { 24 mid_str = *(&s1 + mid_i); // 从输入的第5位开始 25 v5 = 0; 26 if ( mid_str > 'N' ) 27 { 28 mid_str = mid_str; 29 if ( mid_str == 'O' ) 30 { 31 v6 = l_sub_400650(&arr + 1); // 操作j 列 'O'对应左
1 bool __fastcall sub_400650(_DWORD *a1) 2 { 3 int v1; // eax 4 5 v1 = (*a1)--; 6 return v1 > 0; 7 }View Code
32 goto LABEL_14; 33 } 34 if ( mid_str == 'o' ) 35 { 36 v6 = l_add_400660(&arr + 1); // 操作j 列 'o'对应右 37 goto LABEL_14; 38 } 39 } 40 else 41 { 42 mid_str = mid_str; 43 if ( mid_str == '.' ) 44 { 45 v6 = h_sub_400670(&arr); // 操作i 行 '.'对应上
1 bool __fastcall sub_400670(_DWORD *a1) 2 { 3 int v1; // eax 4 5 v1 = (*a1)--; 6 return v1 > 0; 7 }View Code
46 goto LABEL_14; 47 } 48 if ( mid_str == '0' ) 49 { 50 v6 = h_sub_400680(&arr); // 操作i 行 '0'对应下 51 LABEL_14: 52 v5 = v6; 53 goto LABEL_15; 54 } 55 } 56 LABEL_15: 57 if ( !check_400690(asc_601060, SHIDWORD(arr), arr) )// 走' ' 或者 '#' 58 // #define HIDWORD(x) (((_DWORD)&(x)+1)) 59 // 60 // ******* * **** * **** * *** *# *** *** *** ********* 61 goto LABEL_22; 62 if ( ++mid_i >= strlen(&s1) - 1 ) 63 { 64 if ( v5 ) 65 break; 66 LABEL_20: 67 v7 = "Wrong flag!"; 68 goto LABEL_21; 69 } 70 } 71 } 72 if ( asc_601060[8 * arr + SHIDWORD(arr)] != '#' )// 最终移动到# 73 goto LABEL_20; 74 v7 = "Congratulations!"; 75 LABEL_21: 76 puts(v7); 77 return 0LL; 78 }
处理脚本:
1 import numpy as np 2 q='nctf{' 3 h='}' 4 asc=' ******* * **** * **** * *** *# *** *** *** *********' 5 mg=np.array(list(asc)) 6 print(str(mg.reshape(int(len(asc)/8),8)).replace('\'','')) 7 # [[ * * * * * *] 8 # [* * *] 9 # [* * * * * *] 10 # [* * * * *] 11 # [* * # *] 12 # [* * * * * *] 13 # [* * *] 14 # [* * * * * * * *]] 15 mid_str='右下右右下下左下下下右右右右上上左左'.replace('上','.').replace('下','0').replace('左','O').replace('右','o') 16 print(q+mid_str+h) 17 # nctf{o0oo00O000oooo..OO}
//'O'