实验吧CTFreverse题目证明自己吧writeup

这篇博客分享了作者解决实验吧CTF中一个名为'prove yourself'的逆向题目的心得。通过运行程序发现输入错误会导致程序闪退,进一步使用IDA分析,找到了隐藏的字符串,揭示了flag为'Cr4ckIsSoE4sy!'。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

题目地址: http://ctf5.shiyanbar.com/crackme/ 

先运行下

发现输入错误就会闪退

没有加壳

载入IDA    搜索字符串

 

 

signed int __cdecl sub_401060(const char *input)

{

  unsigned int i; // edx

  unsigned int j; // edx

  int v3; // edx

  int v5; // [esp+Ch] [ebp-10h]

  int v6; // [esp+10h] [ebp-Ch]

  int v7; // [esp+14h] [ebp-8h]

  __int16 v8; // [esp+18h] [ebp-4h]

  char v9; // [esp+1Ah] [ebp-2h]



  v5 = dword_40708C;

  v6 = dword_407090;

  v8 = word_407098;

  v9 = byte_40709A;

  v7 = dword_407094;

  if ( strlen(input) == strlen(&v5) )           // 如果我们输入的长度=v5的长度

  {

    i = 0;

    if ( strlen(input) != 0 )                   // 如果len(input) != 0 且i<len(input)

    {

      do

        input[i++] ^= 0x20u;                    // 与0x20u异或

      while ( i < strlen(input) );

    }

    j = 0;

    if ( strlen(&v5) != 0 )                     // 对v5进行-5

    {

      do

        *(&v5 + j++) -= 5;

      while ( j < strlen(&v5) );                // 那我们只需要倒过来操作  先-5  再与0x20异或即可得到flag

    }

    v3 = 0;

    if ( strlen(&v5) == 0 )

      return 1;

    while ( *(&v5 + v3 + input - &v5) == *(&v5 + v3) )

    {

      if ( ++v3 >= strlen(&v5) )

        return 1;

    }

  }

  return 0;

}

 

得到flag:Cr4ckIsSoE4sy!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值