DNF_DLL/test/RSAC.cpp

15 lines
329 B
C++
Raw Normal View History

2022-02-17 13:17:46 +08:00
#pragma once
#include "pch.h"
2022-06-20 03:10:33 +08:00
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) {
return (((c - 1) ^ key) ^ key2) - key;
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
}