首页 > 其他 > 详细

攻防世界 reverse 进阶 19-gametime

时间:2019-09-02 21:43:26      阅读:526      评论:0      收藏:0      [点我收藏+]

19.gametime csaw-ctf-2016-quals

这是一个小游戏,挺有意思的

‘s‘-->‘ ‘    ‘x‘-->‘x‘   ‘m‘-->‘m‘

观察流程,发现检验函数在

 1 char __usercall check_input_401507@<al>(int a1@<edx>, int a2@<ecx>, DWORD dwMilliseconds, int a4, int a5)
 2 {
 3   int v5; // esi
 4   int v6; // ebx
 5 
 6   v5 = a1;
 7   v6 = a2;
 8   print_401A73((int)"key is %s (%s)", a5, a4);
 9   bks_401423();
10   print_401A73((int)"\r                                 \r");
11   if ( v5 > 0 )
12   {
13     do
14     {
15       print_401A73((int)".");
16       Sleep(dwMilliseconds);
17       --v5;
18     }
19     while ( v5 );
20   }
21   if ( check_time_401260(v6, 500 * dwMilliseconds) )//关键
22     return 1;
23   print_401A73((int)"key is %s (%s)\r", a5, a4);
24   print_401A73((int)"UDDER FAILURE! http://imgur.com/4Ajx21P \n");
25   return 0;
26 }

检验工作交给了:401260()函数

 1 bool __fastcall check_time_401260(int a1, int t)
 2 {
 3   int a1_2; // edi
 4   int t_2; // esi
 5   int input_c; // eax
 6 
 7   a1_2 = a1;
 8   t_2 = t;
 9   if ( a1 ==   )
10     print_401A73((int)"s\n");
11   else
12     print_401A73((int)"%c\n", a1);
13   if ( t_2 )
14   {
15     while ( !_kbhit() )
16     {
17       if ( !--t_2 )
18         goto LABEL_7;
19     }
20     input_c = _getch();                         // 输入
21   }
22   else
23   {
24 LABEL_7:
25     input_c = -1;
26   }
27   return input_c != -1 && input_c == a1_2;      // 相应时间内输入,并判断是否正确
28 }

最简单的方法就是修改401260()函数的返回值,nop掉失败跳,ok

技术分享图片

 

 技术分享图片

 

 key is  (no5c30416d6cf52638460377995c6a8cf5)

 

攻防世界 reverse 进阶 19-gametime

原文:https://www.cnblogs.com/DirWang/p/11448796.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!