华科软件安全实验--逆向Demo2020.exe--序列号生成算法破解--exp


#include<stdio.h>
#include<String.h>
#include "windows.h"
int main()
{
    SYSTEMTIME st;
    int v7,v6,i;
    DWORD  len,first,second,third;
    char computername[256];
    printf("%s","提示,序列号会根据时间、电脑名称发生改变(甚至可以改成根据执行路径发生改变),因此请将该程序与Demo2020.exe放在同一个系统运行\n");

    //part one 
    GetLocalTime(&st);
    first=st.wYear+st.wMonth+st.wDayOfWeek+2*(st.wDay+st.wHour);
    printf("%04x-",first);

    //part two
    GetComputerNameA(computername,&len);
    v6=0;
    for(i=0;i<len;i++)
    {
        v7=computername[i];
        v6+=st.wMonth+v7;
        second=v6;
    }
    printf("%04x-",second>>8);

    //part third
    //GetModuleFileNameA(0,filename, 0x100u);
    third=st.wHour*(second+101);   //'e'=101
    printf("%04x-aFF0",(third+first)>>8);
    getchar();
    getchar();
    return 0;
}

编译执行,

分析过程见另外一篇文章 https://blog.csdn.net/m0_43406494/article/details/109105737

猜你喜欢

转载自blog.csdn.net/m0_43406494/article/details/109105124