Base64+Crc32代码全是抄袭各个地方的代码
验证和算法用C++
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <tlhelp32.h>
#include <ctype.h>
#include "resource.h"
#include "MemCode.h"
#include "Crc.h"
HINSTANCE hInst;
#pragma comment(linker,"/SUBSYSTEM:WINDOWS")
namespace Hi
{
int Startup(HWND hWnd)
{
MemCode Mem;
Base64 MakeBase64;
Crc32 MakeCrc32;
char *Out;
Mem.GetTxet(hWnd, 4002);
char *EnCode = MakeBase64.Base64_Encode_Bin(Mem.User, sizeof(Mem.User));
Mem.SendData(EnCode, sizeof(EnCode));
Sleep(500);
Mem.RecvData();
char *DeCode = MakeBase64.Base64_Decode(Mem.Buffer);
MakeCrc32.MakeCrc32Value(DeCode, Out);
if(strcmp(Out, Mem.Code))
{
MessageBox(hWnd, "注册失败", "提示", MB_OK);
}
MessageBox(hWnd, "注册成功", "提示", MB_OK);
return 1;
}
}
BOOL CALLBACK DialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
char User[10];
char Code[10];
switch(uMsg)
{
case WM_INITDIALOG:
SendMessage(hWnd, WM_SETICON, (WPARAM) 0, (LPARAM)LoadIconA(hInst, MAKEINTRESOURCE(IDI_ICON1)));
return TRUE;
case WM_CLOSE:
EndDialog(hWnd, 0);
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
Hi::Startup(hWnd);
return TRUE;
case IDCANCEL:
SendMessage(hWnd, WM_CLOSE, 0, 0);
return TRUE;
}
}
return FALSE;
}
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
hInst = hInstance;
return DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DialogProc);
}
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课