code:
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#ifdef linux
#include <unistd.h>
#include <pwd.h>
#endif
#ifdef _WIN32
#include<Windows.h>
#endif
using namespace std;
#include<stdio.h>
#include<string.h>
string xxooxxxoooxooxoooxo()
{
#if defined linux //linux system
uid_t userid;
struct passwd* pwd;
userid=getuid();
pwd=getpwuid(userid);
return pwd->pw_name;
#elif defined _WIN32
const int MAX_LEN = 100;
char szBuffer[MAX_LEN];
DWORD len = MAX_LEN;
if( GetUserName(szBuffer, &len) )
return szBuffer;
#else
return "";
#endif
}
int main()
{
hash<string> h;
string xxxooxx=xxooxxxoooxooxoooxo();
string n;
string k;
cout<<"Name:";
cin>>n;
string xxooxx=n+xxxooxx;
size_t kkk=h(xxooxx);
string kk=to_string(kkk);
cout<<"Key:";
cin>>k;
if(xxooxx.length()>17)
{
cout<<"Too Long!"<<endl;
return 0;
}
if(kk==k){
cout<<"Ok, you kengened me!"<<endl;
}else{
cout<<"Key error!"<<endl;
}
system("pause");
return 0;
}```
自制keygenme拿来练手的,自己解不出来了,求大神帮忙
可能大家理解有误,我的意思是试图通过逆向等方式从编译出来的exe中获取key[md][/md] |