DNF_DLL/test/RSAC.cpp

17 lines
377 B
C++
Raw Normal View History

2022-02-17 13:17:46 +08:00
#pragma once
#include "pch.h"
2024-03-31 13:23:55 +08:00
static int awqs = 0;
2022-02-17 13:17:46 +08:00
//<2F><><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>
2022-06-20 03:10:33 +08:00
char CutcodeChar(char c, int key, int key2) {
2024-03-31 13:23:55 +08:00
awqs++;
char a = (((c - 1) ^ key) ^ key2) - key;
return a;
2022-02-17 13:17:46 +08:00
}
//<2F><><EFBFBD><EFBFBD>
void Cutecode(char* pstr, int* pkey) {
int len = strlen(pstr);
for (int i = 0; i < len; i++)
2022-06-20 03:10:33 +08:00
*(pstr + i) = CutcodeChar(*(pstr + i), pkey[i % 5], pkey[(i + 18) % 5]);
2022-02-17 13:17:46 +08:00
}