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

📄 generic.cpp

📁 破解很多程序的序列号算法程序
💻 CPP
字号:
#include <windows.h>
#include <stdio.h>
#include <string.h>
#include "generic.h"
#include "resource.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;

   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]="1234567 - ", ch, buf[2];
	char *upper;
	int i, length;
	unsigned long calc, con=1234567;

	switch (uMsg)
	{
	case WM_COMMAND :
		switch (LOWORD (wParam))
		{
		case IDGEN :
			GetDlgItemText( hDlg, IDC_USERINPUT, username, 255);
			// put key generation code here!!
			
			length = strlen (username);
			if (length < 8)
			{
				MessageBox (0, "User name must be 8 or more characters!", "Error", MB_OK );
				break;
			}
			
			for (i=0 ; i < 5 ; i++)
			{
				calc = con;
				ch = username[length-i-1];
				calc += ch;
				calc += ((i+1)*(i+1));
				ch = username[i];
				calc += ch;
				calc = calc % 255;				
				sprintf(buf, "%x", calc);
				strcat (serial, buf);
			}
			upper = _strupr (serial);
			MessageBox (0, "Took into account 1234567 as first field of serial...", "Note", MB_OK );

			//finish and bug out!
			SetDlgItemText( hDlg, IDC_RESULTKEY, upper);
			break;
		case IDEXIT :
			EndDialog( hDlg, IDEXIT);
			break;
		}
	default : return(FALSE);
	}
return(TRUE);

}

⌨️ 快捷键说明

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