⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 generic.cpp

📁 破解很多程序的序列号算法程序
💻 CPP
字号:
#include <windows.h>
#include "generic.h"
#include "resource.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#if defined (win32)
   #define IS_WIN32 TRUE
#else
   #define IS_WIN32 FALSE
#endif

HINSTANCE hInst;        // current instance

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
 {  
   hInst = hInstance;
   srand( (unsigned) time(NULL));
   DialogBox(hInst, MAKEINTRESOURCE( IDD_DIALOG1 ), 0, (DLGPROC)gen);

   return(0);
 }


LRESULT CALLBACK gen( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	char username[255]="", serial[255]="RKS-";
	int seed,i;
	DWORD sn;

	switch (uMsg)
	{
	case WM_COMMAND :
		switch (LOWORD (wParam))
		{
		case IDGEN :
			GetDlgItemText( hDlg, IDC_USERINPUT, username, 255);
			// put key generation code here!!
			if ( lstrlen( username) == 0)
			{
				MessageBox(0,"You must enter a string!","Error",MB_ICONERROR | MB_OK);
				break;
			}
			// uppercase the username
			_strupr( username);

			// initialize a 1 out of 4 random seed
			seed = rand();
			seed /= 8192;
			sn=0;

			switch ( seed)
			{
			case 0 :
				seed = 0x1b54;
			break;
			case 1 :
				seed = 0x1b1f;
			break;
			case 2 :
				seed = 0x1771;
			break;
			case 3 :
				seed = 0x17d9;
			break;

			default : seed = 0x17d9;
			}
			// now make serial
			for ( i=0 ; i < lstrlen( username) ; i++)
			{
				if ( username[i] != ' ')
				{
					sn += seed * username[i];
					sn--;
				}
			}
			sprintf( username, "%d", sn);
			lstrcat( serial, username);

			//finish and bug out!
			SetDlgItemText( hDlg, IDC_RESULTKEY, serial);
			break;
		case IDEXIT :
			EndDialog( hDlg, IDEXIT);
			break;
		}
	break;

	case WM_DESTROY : 
		EndDialog( hDlg, IDEXIT);
	break;

	default : return(FALSE);
	}
return(TRUE);

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -