源码分析
首先需要破解的程序源码
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <stdint.h>
#include <stdlib.h>
void main()
{
while (true)
{
std::cout << "请输入密码:" << std::endl;
std::string inputString;
std::cin >> inputString;
if (strcmp(inputString.c_str(),"qwe") == 0)
{
std::cout << "密码正确" << std::endl;
}
else
{
std::cout << "密码错误" << std::endl;
}
}
}
源码很简单 循环输入,如果输入qwe则输出密码正确,其他则输出密码错误
打开x64dbg 打开exe程序,单击右键,搜索->所有模块->字符串

找到密码错误行

点击右键 在反汇编中转到

本文介绍了如何分析并破解一个简单的C++程序,通过使用x64dbg调试器寻找关键代码段,设置断点,并修改跳转地址以实现密码验证的绕过。通过对字符串比较和循环逻辑的解析,展示了代码调试的基本流程和思路。
最低0.47元/天 解锁文章
1万+





