UltraDebug

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: A C D R G Y M Z X S P
公益项目,接受捐赠
查看: 1035|回复: 0
收起左侧

[CTF] 【reverse】buu-[Zer0pts2020]easy_strcmp——main函数的启动过程+IDA动态调试ELF

[复制链接]
ultradebug

主题

0

回帖

UD

管理员

UID
1
积分
2344
注册时间
2021-12-20
最后登录
1970-1-1
2022-9-12 16:40:08 | 显示全部楼层 |阅读模式

依赖

  1. IDA7.7
  2. Ubuntu20.04

作者:hans774882968以及hans774882968以及hans774882968

本文Link:https://www.ultradebug.com/thread-718-1-1.html

本文juejin:https://juejin.cn/post/7142310602067673124

本文csdn:https://blog.csdn.net/hans774882968/article/details/126813906

思路

64位ELF。用IDA打开即可看到main函数:

__int64 __fastcall main(int a1, char **a2, char **a3)
{
  if ( a1 > 1 )
  {
    if ( !strcmp(a2[1], "zer0pts{********CENSORED********}") )
      puts("Correct!");
    else
      puts("Wrong!");
  }
  else
  {
    printf("Usage: %s <FLAG>\n", *a2);
  }
  return 0LL;
}

会这么简单嘛?我们应该关注a2[1]是否被修改了。因此看看start函数:

// positive sp value has been detected, the output may be wrong!
void __fastcall __noreturn start(__int64 a1, __int64 a2, void (*a3)(void))
{
  __int64 v3; // rax
  int v4; // esi
  __int64 v5; // [rsp-8h] [rbp-8h] BYREF
  char *retaddr; // [rsp+0h] [rbp+0h] BYREF

  v4 = v5;
  v5 = v3;
  _libc_start_main(main, v4, &retaddr, init, fini, a3, &v5)
还有更多的精彩内容,作者设置为付费后可见
UltraDebug免责声明
✅以上内容均来自网友转发或原创,如存在侵权请发送到站方邮件9003554@qq.com处理。
✅The above content is forwarded or original by netizens. If there is infringement, please send the email to the destination 9003554@qq.com handle.
回复 打印

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|站点地图|UltraDebug ( 滇ICP备2022002049号-2 滇公网安备 53032102000034号)

GMT+8, 2025-6-20 15:45 , Processed in 0.035170 second(s), 11 queries , Redis On.

Powered by Discuz X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表