#include
#include
const char REG_KEY_NAME[]= "Software\\Rovasoft";
const char REG_VALUE_NAME1[]= "BookID";
const char REG_VALUE_NAME2[]= "Key";
#define FAIL 0xFFFFFFFFL
#define MAX_LEN 32
void main(void)
{
HANDLE handle;
HKEY hKey;
long BookID, BookIDSize;
char Key[MAX_LEN];
char buf[MAX_LEN];
int k;
long ValueType;
char subtractor[16] =
{ 0x2F,
0x2E,
0x2C,
0x2D,
0x2F, //not sure
0x2D,
0x2F, //not sure
0x2F,
0x2C,
0x2E,
0x2F, //not sure
0x2F, //not sure
0x2F, //not sure
0x2F, //not sure
0x2F, //not sure
0x2F //not sure
};
if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, REG_KEY_NAME, NULL, NULL, NULL, KEY_ALL_ACCESS,
NULL, &hKey, NULL) != ERROR_SUCCESS)
{
printf("Error opening registry key \"%s\".\n", REG_KEY_NAME);
return;
}
BookIDSize = sizeof(BookID);
if (RegQueryValueEx(hKey, REG_VALUE_NAME1, NULL, (unsigned long *)&ValueType, (LPBYTE)&BookID,
(LPDWORD)&BookIDSize) != ERROR_SUCCESS)
{
printf("Error reading registry value \"%s\\%s\".\n", REG_KEY_NAME, REG_VALUE_NAME1);
RegCloseKey(hKey);
return;
}
if (BookID < 1000000000L)
{
BookID += 1000000000L;
}
sprintf(buf, "%010u", BookID);
lstrcat(buf, "000000");
for (k = 0; k < 16; k++)
{
Key[k] = ((buf[k] - subtractor[k]) % 10) + '0';
}
Key[16] = '\0';
if (RegSetValueEx(hKey, REG_VALUE_NAME2, NULL, REG_SZ , (CONST BYTE *)(&Key[0]),
lstrlen(Key) + 1) != ERROR_SUCCESS)
{
printf("Error writing registry value \"%s\\%s\".\n", REG_KEY_NAME, REG_VALUE_NAME2);
RegCloseKey(hKey);
return;
}
RegCloseKey(hKey);
printf("Successfully registered.\n");
}
相关视频
相关阅读 Windows错误代码大全 Windows错误代码查询激活windows有什么用Mac QQ和Windows QQ聊天记录怎么合并 Mac QQ和Windows QQ聊天记录Windows 10自动更新怎么关闭 如何关闭Windows 10自动更新windows 10 rs4快速预览版17017下载错误问题Win10秋季创意者更新16291更新了什么 win10 16291更新内容windows10秋季创意者更新时间 windows10秋季创意者更新内容kb3150513补丁更新了什么 Windows 10补丁kb3150513是什么
热门文章 去除winrar注册框方法
最新文章
比特币病毒怎么破解 比去除winrar注册框方法
华为无线路由器HG522-C破解教程(附超级密码JEB格式文件京东电子书下载和阅读限制破解教UltraISO注册码全集(最新)通过Access破解MSSQL获得数据
人气排行 华为无线路由器HG522-C破解教程(附超级密码JEB格式文件京东电子书下载和阅读限制破解教UltraISO注册码全集(最新)qq相册密码破解方法去除winrar注册框方法(适应任何版本)怎么用手机破解收费游戏华为无线猫HG522破解如何给软件脱壳基础教程
查看所有0条评论>>