111
This commit is contained in:
16
pch.h
16
pch.h
@@ -19,13 +19,14 @@
|
||||
#include "sqstdstring.h"
|
||||
#include "sqstdsystem.h"
|
||||
#include "iconv.h"
|
||||
#include<d3d9.h>
|
||||
#endif //PCH_H
|
||||
|
||||
|
||||
|
||||
|
||||
//# define EXPRESS "学习版"
|
||||
# define SELL "售出模式"
|
||||
//# define SELL "售出模式"
|
||||
#define INVERSION "24112901"
|
||||
|
||||
|
||||
@@ -38,7 +39,7 @@
|
||||
|
||||
|
||||
|
||||
static void Cutecode(char* pstr, int* pkey, int len = -1);
|
||||
static void Cutecode(char* pstr, int* pkey, int len = -1, int keyLength = 5);
|
||||
//单个字符解密
|
||||
static char CutcodeChar(char c, int key, int key2) {
|
||||
char a = (((c - 1) ^ key) ^ key2) - key;
|
||||
@@ -46,10 +47,13 @@ static char CutcodeChar(char c, int key, int key2) {
|
||||
}
|
||||
|
||||
//解密
|
||||
static void Cutecode(char* pstr, int* pkey, int len) {
|
||||
if (len == -1)len = strlen(pstr);
|
||||
for (int i = 0; i < len; i++)
|
||||
*(pstr + i) = CutcodeChar(*(pstr + i), pkey[i % 5], pkey[(i + 18) % 5]);
|
||||
static void Cutecode(char* pstr, int* pkey, int len , int keyLength) {
|
||||
if (len == -1) len = strlen(pstr);
|
||||
for (int i = 0; i < len; i++) {
|
||||
*(pstr + i) = CutcodeChar(*(pstr + i),
|
||||
pkey[i % keyLength],
|
||||
pkey[(i + 18) % keyLength]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user