#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