36 lines
825 B
C#
36 lines
825 B
C#
|
|
using System.Text;
|
|
|
|
namespace Zerolauncher.Defender
|
|
{
|
|
class EngineCacheSha
|
|
{
|
|
const string key = "mysecretkey";
|
|
static string? sha;
|
|
public static int errorCode = 0;
|
|
|
|
public static void Put(string eSha)
|
|
{
|
|
StringBuilder sb = new StringBuilder();
|
|
for (int i = 0; i < eSha.Length; i++)
|
|
{
|
|
sb.Append((char)(eSha[i] ^ key[i % key.Length]));
|
|
}
|
|
sha = sb.ToString();
|
|
}
|
|
|
|
public static string? Get()
|
|
{
|
|
if (sha == null) { return null; }
|
|
var sb = new StringBuilder();
|
|
for (int i = 0; i < sha.Length; i++)
|
|
{
|
|
sb.Append((char)(sha[i] ^ key[i % key.Length]));
|
|
}
|
|
return sb.ToString();
|
|
|
|
}
|
|
|
|
}
|
|
}
|