本帖最后由 困兽 于 2019-8-14 13:01 编辑
.NET程序,这是注册码算法吗?用什么工具怎么写注册机?
[C#] 纯文本查看 复制代码 // TeklaTool.CRegisterValid
// Token: 0x0600001A RID: 26 RVA: 0x00002C10 File Offset: 0x00000E10
public string RegisterValidValue()
{
string text = CRegisterValid.strMac + CRegisterValid.strCPU + CRegisterValid.strMotherBoard;
ArrayList arrayList = new ArrayList();
int num = 0;
for (int i = 0; i < text.Length; i++)
{
string item;
if (text.Length - i >= 3)
{
item = text.Substring(i, 3);
}
else
{
item = text.Substring(i);
}
i += 2;
if (num < arrayList.Count)
{
List<string> list = (List<string>)arrayList[num];
if (list == null)
{
arrayList.Insert(num, new List<string>
{
item
});
}
else
{
list.Add(item);
}
}
else
{
arrayList.Insert(num, new List<string>
{
item
});
}
num++;
num %= 3;
}
string text2 = "";
List<string> list2 = (List<string>)arrayList[1];
List<string> list3 = (List<string>)arrayList[0];
List<string> list4 = (List<string>)arrayList[2];
for (int i = 0; i < list2.Count; i++)
{
text2 += list2[i];
}
for (int i = 0; i < list3.Count; i++)
{
text2 += list3[i];
}
for (int i = 0; i < list4.Count; i++)
{
text2 += list4[i];
}
byte[] bytes = Encoding.UTF8.GetBytes(text2);
string s = BitConverter.ToString(bytes).Replace("-", "");
byte[] bytes2 = Encoding.UTF8.GetBytes("7sto5neYa2ngZh9ouTe1klaJi0aoXu2e");
byte[] bytes3 = Encoding.UTF8.GetBytes(s);
ICryptoTransform cryptoTransform = new RijndaelManaged
{
Key = bytes2,
Mode = CipherMode.ECB,
Padding = PaddingMode.PKCS7
}.CreateEncryptor();
byte[] inArray = cryptoTransform.TransformFinalBlock(bytes3, 0, bytes3.Length);
return Convert.ToBase64String(inArray);
} |