-
-
[原创] 2019KCTF总决赛 第一题:无限流
-
发表于: 2019-12-1 20:21 2037
-
放到IDA搜下字符串,即可定位到关键函数。
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 | int __thiscall onclick(CWnd * this ) { struct CString *v1; // ST08_4 CWnd *v2; // eax int v3; // eax char result[8]; // [esp+4Ch] [ebp-18h] int i; // [esp+54h] [ebp-10h] const char *v7; // [esp+58h] [ebp-Ch] char *Str; // [esp+5Ch] [ebp-8h] CWnd *v9; // [esp+60h] [ebp-4h] v9 = this ; v1 = (CWnd *)(( char *) this + 100); v2 = CWnd::GetDlgItem( this , 1002); CWnd::GetWindowTextA(v2, v1); v3 = sub_401970(( char *)v9 + 100); Str = CString::GetBuffer((CWnd *)(( char *)v9 + 100), v3); if ( ! strlen (Str) ) return CWnd::MessageBoxA(v9, "请输入password!" , 0, 0); v7 = "cuk!ogl" ; for ( i = 0; Str[i]; ++i ) { if ( Str[i] > '9' || Str[i] < '0' ) // 限制输入范围为整数 error(); else result[i] = v7[Str[i] - '0' ]; // 取出对应位置的字符,并存放到result } result[i] = 0; return check(result); // 如果result为goluck!则成功 } |
代码逻辑很清晰,flag就是 "goluck!" 的每个字符在 "cuk!ogl"的下标。
得到flag为:5461023
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课
赞赏
他的文章
赞赏
雪币:
留言: