分析abex'crackme#2

文件地址:https://www.wocloud.com.cn/webclient/share/sindex.action?id=i9K_Br6TgE4gbyGIlYkffWKcRy5TUdZ8U6_uiWwxDovNjPaT6IJAgRhtvqTOsW3w

这是一个根据输入的name自动生成serial的VB软件。

1.指令分析

打开之后,外部主要有三条指令。

jmp dword ptr ds:[0x4010A0]              ;  msvbvm60.ThunRTMain
push 0x401E14
call 00401232                            ;  <jmp.&MSVBVM60.#ThunRTMain_100>

起始从push 0x401E14开始,将所需要的参数结构体入栈,传入函数。

call 00401232即调用jmp dword ptr ds:[0x4010A0]进入主函数

2.字串搜索

打开“查找”--》“所有参考文本字串”,找到我们错误提示的字符串。

2.1字串分析

找到“Wrong..”和"congratulation..."相邻,那么必定有比较,匹配序列号是否正确,跳转到对应字符串提示。向上查找

serial查找

这是相当于C语言的strcmp函数,即EDX和EAX是我们需要的参数,设置断点,F9执行到断点,在生成的可执行文件中写入name,继续执行,找到存储数据的对应栈地址。

根据栈中存储内存地址,找到name和serial内存地址

转换为长型Unicode

校验结果

得到name=123456,对应的serial=95969798

解码程序

#include <string>
#include <iostream>

using namespace std;

int main()
{
    string str;
    cout << "请输入name:" << endl;
    cin >> str;
    cout << "你的serial为:" << endl;
    cout << uppercase;
    for (int i = 0; i < 4; ++i) {
        cout << hex << (int)str[i] + 0x64;
    }
    cout << nouppercase;

    system("PAUSE");
    return 0;
}

原文地址:https://www.cnblogs.com/Mayfly-nymph/p/11325574.html