Reversing-x64Elf-100

使用ida打开,f5反编译main函数
image

分析代码

  v5 = __readfsqword(0x28u); //栈保护相关
  printf("Enter the password: ");
  if ( !fgets(s, 255, stdin) )  //如果读取失败
    return 0LL;		//程序直接退出,返回0
	//如果读取成功,执行下面的代码
  if ( (unsigned int)sub_4006FD((__int64)s) )
  {
    puts("Incorrect password!");
    return 1LL;
  }
  else
  {
    puts("Nice!");
    return 0LL;
  }

分析可知关键在于sub_4006FD函数,双击进入该函数
image

分析可知v3是一个二维数组,v3[i % 3]就是在选择是v[0]、v[1]、v[2],
2 * (i / 3)就是在选择字符串中的哪个字符
例如i=0-->v3[0][0]='D',i=1-->v3[1][0]='p'
要求flag就是求(i+a1),使用上面求出来的ascll值减1就行

写一个解密脚本

def decrypt_password_simple():
    v3 = ["Dufhbmf", "pG`imos", "ewUglpt"]
    password = []
    for i in range(12):
        char = v3[i % 3][2 * (i // 3)]
        password.append(chr(ord(char) - 1))
    return ''.join(password)
result = decrypt_password_simple()
print(result)

image

posted @ 2026-03-06 23:09  大雪深埋  阅读(11)  评论(0)    收藏  举报
// 正常配置 window.cnblogsConfig = { links: {}, }; // 友链页配置 window.cnblogsConfig.links.page = [ { title: '友情链接', // 标题 icon: 'icon-lianjie', // iconfont style: 'color: #a78bfa;', links: [ { name: '2_haowen_V', // 昵称 introduction: 'IT技术类博客', // 简介 avatar: 'https://pic.cnblogs.com/face/1334215/20180504110551.png', // 头像 url: 'https://www.hehaowen.com.cn/' // 友链地址 }, ] }, ];