首页
社区
课程
招聘
[原创]BUUCTF逆向题:[UTCTF2020]basic-re
发表于: 2022-3-27 17:36 4889

[原创]BUUCTF逆向题:[UTCTF2020]basic-re

2022-3-27 17:36
4889

1.基本信息探查:

1.EXEinfo:

2.运行一下:

2.IDA分析:

1.主函数分析:

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
31
32
33
34
35
36
37
38
39
40
int __cdecl main(int argc, const char **argv, const char **envp)
{
  char v4; // [rsp+Fh] [rbp-21h] BYREF
  double v5; // [rsp+10h] [rbp-20h] BYREF
  double v6; // [rsp+18h] [rbp-18h] BYREF
  unsigned __int64 v7; // [rsp+28h] [rbp-8h]
 
  v7 = __readfsqword(0x28u);
  printf("Enter an operator (+, -, *,): ");
  __isoc99_scanf("%c", &v4);
  printf("Enter two operands: ");
  __isoc99_scanf("%lf %lf", &v5, &v6);
  if ( v4 == '/' )
  {
    printf("%.1lf / %.1lf = %.1lf", v5, v6, v5 / v6);
    return 0;
  }
  if ( v4 > '/' )
    goto LABEL_11;
  if ( v4 == '-' )
  {
    printf("%.1lf - %.1lf = %.1lf", v5, v6, v5 - v6);
    return 0;
  }
  if ( v4 > '-' )
    goto LABEL_11;
  if ( v4 == '*' )
  {
    printf("%.1lf * %.1lf = %.1lf", v5, v6, v5 * v6);
    return 0;
  }
  if ( v4 != '+' )
  {
LABEL_11:
    printf("Error! operator is not correct");
    return 0;
  }
  printf("%.1lf + %.1lf = %.1lf", v5, v6, v5 + v6);
  return 0;
}

这个主函数就是做两个数的+,-,*,/,也没有看到什么flag啥的,咋办呢,主函数反正是没得flag的线索,那就直接查看字符串:

 

 

其实这个题啥也没考,flag摆你面前了:

 

utflag{str1ngs_1s_y0ur_fr13nd}


[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回
//