1 Star 0 Fork 0

pedoc / GemBox.KeyGen

加入 Gitee
与超过 600 万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未指定开源许可证,未经作者的许可,此代码仅用于学习,不能用于其他用途。
克隆/下载
Class1123.cs 8.47 KB
一键复制 编辑 Web IDE 原始数据 按行查看 历史
pedoc 提交于 2019-04-15 17:32 . init
using System.Collections.Generic;
namespace GemBox.KeyGen
{
using System;
using System.Globalization;
// Token: 0x020005D1 RID: 1489
internal static class Class1123
{
// Token: 0x060031C9 RID: 12745 RVA: 0x000FDA78 File Offset: 0x000FBC78
public static string smethod_0(string string_0, char char_0, int int_0)
{
string_0 = string_0.ToUpper(CultureInfo.InvariantCulture);
if (string_0.Length != int_0)
{
throw new Exception(string.Concat(new object[]
{
"Long key must have ",
int_0,
" characters and not ",
string_0.Length,
"(",
string_0,
")."
}));
}
if (string_0[0] != char_0)
{
throw new ArgumentException("Long key must start with '" + char_0.ToString() + "' character.");
}
if (Class1123.smethod_3(string_0.Substring(0, string_0.Length - 1)) != string_0[string_0.Length - 1])
{
throw new Exception("Long key has wrong checksum.");
}
return string_0.Substring(1, string_0.Length - 2);
}
// Token: 0x060031CA RID: 12746 RVA: 0x00027494 File Offset: 0x00025694
public static void smethod_1(string string_0, out Class1123.Enum158 enum158_0, out int int_3,
out string string_1, out string string_2, char char_0, out DateTime dateTime_0, out int int_1)
{
Class1123.smethod_2(Class1123.smethod_0(string_0, char_0, 16), out enum158_0, out int_3, out string_1,
out string_2, out dateTime_0, out int_1);
}
// Token: 0x060031CB RID: 12747 RVA: 0x000FDB70 File Offset: 0x000FBD70
public static void smethod_2(string string_0, out Class1123.Enum158 enum158_0, out int int_3,
out string string_1, out string string_2, out DateTime dateTime_0, out int int_1)
{
Class1227 @class = new Class1227(Class1123.CharToInt(string_0[0]) * 27961);
char[] array = new char[string_0.Length - 1];
for (int i = 0; i < array.Length; i++)
{
var ch=string_0[i + 1];
int num = Class1123.CharToInt(ch);
int num2 = @class.method_3(0, 36);
array[i] = ToChar((36 + num - num2) % 36);
}
//81SG0Z61QVY33
//Console.WriteLine(new string(array));
string string_3 = new string(array, 0, 1);
enum158_0 = (Class1123.Enum158) Class1123.smethod_4(string_3);
string string_4 = new string(array, 1, 2);
int_3 = Class1123.smethod_4(string_4);
string_1 = new string(array, 3, 3);
string_2 = new string(array, 6, 2);
if ((enum158_0 & (Class1123.Enum158) 32) != (Class1123.Enum158) 0)
{
int num3 = Class1123.smethod_4(new string(array, 8, 5));
int_1 = num3 / 1000000;
int num4 = num3 / 10000 - int_1 * 100;
int month = num3 / 100 - num4 * 100 - int_1 * 10000;
int day = num3 - num3 / 100 * 100;
dateTime_0 = new DateTime(2000 + num4, month, day);
return;
}
int_1 = 0;
dateTime_0 = DateTime.MaxValue;
}
// Token: 0x060031CC RID: 12748 RVA: 0x000FDC94 File Offset: 0x000FBE94
public static char smethod_3(string string_0)
{
int num = 0;
for (int i = 0; i < string_0.Length; i++)
{
int num2 = Class1123.CharToInt(string_0[i]);
if (i % 2 == 1)
{
int num3 = num2 * 2;
num += num3 / 36 + num3 % 36;
}
else
{
num += num2;
}
}
return Class1123.ToChar(num % 36);
}
public static int smethod_4(string string_0)
{
int num = 0;
for (int i = 0; i < string_0.Length; i++)
{
num *= 36;
num += Class1123.CharToInt(string_0[i]);
}
return num;
}
public static string Find(int val)
{
//round 1
for (char i = '0'; i <= '9'; i++)
{
for (char j = 'A'; j <= 'Z'; j++)
{
var compose = (i.ToString() + j.ToString()).ToString();
var compose1=(j.ToString() + i.ToString()).ToString();
var compose2=(i.ToString() + i.ToString()).ToString();
var compose3=(j.ToString() + j.ToString()).ToString();
if (smethod_4(compose) == val) return compose;
if (smethod_4(compose1) == val) return compose1;
if (smethod_4(compose2) == val) return compose2;
if (smethod_4(compose3) == val) return compose3;
}
}
//round2
for (char i = '0'; i <= '9'; i++)
{
for (char j = '0'; j <= '9'; j++)
{
var compose = (i.ToString() + j.ToString()).ToString();
var compose1=(j.ToString() + i.ToString()).ToString();
var compose2=(i.ToString() + i.ToString()).ToString();
var compose3=(j.ToString() + j.ToString()).ToString();
if (smethod_4(compose) == val) return compose;
if (smethod_4(compose1) == val) return compose1;
if (smethod_4(compose2) == val) return compose2;
if (smethod_4(compose3) == val) return compose3;
}
}
//round2
for (char i = 'A'; i <= 'Z'; i++)
{
for (char j = 'A'; j <= 'Z'; j++)
{
var compose = (i.ToString() + j.ToString()).ToString();
var compose1=(j.ToString() + i.ToString()).ToString();
var compose2=(i.ToString() + i.ToString()).ToString();
var compose3=(j.ToString() + j.ToString()).ToString();
if (smethod_4(compose) == val) return compose;
if (smethod_4(compose1) == val) return compose1;
if (smethod_4(compose2) == val) return compose2;
if (smethod_4(compose3) == val) return compose3;
}
}
return "";
}
public static string FindAll(int val)
{
for (char i = '0'; i <= '9'; i++)
{
for (char j = 'A'; j <= 'Z'; j++)
{
var result = "";
var compose = (i.ToString() + j.ToString()).ToString();
var compose1=(j.ToString() + i.ToString()).ToString();
var compose2=(i.ToString() + i.ToString()).ToString();
var compose3=(j.ToString() + j.ToString()).ToString();
if (smethod_4(compose) == val) result= compose;
if (smethod_4(compose1) == val) result= compose1;
if (smethod_4(compose2) == val) result= compose2;
if (smethod_4(compose3) == val) result= compose3;
if(!string.IsNullOrEmpty(result))
Console.WriteLine("找到一组:"+result);
}
}
return "";
}
public static char ToChar(int value)
{
if (value > 9)
{
return (char) (65 + value - 10);
}
return (char) (48 + value);
}
private static char RToChar(int value)
{
if (value <= 9)
{
return (char)(value-65+10);
}
return (char) (value-48);
}
public static int CharToInt(char ch)
{
if (!char.IsDigit(ch) && (ch < 'A' || ch > 'Z'))
{
throw new ArgumentException("Wrong char value.", "ch");
}
if (char.IsDigit(ch))
{
return (int) (ch - '0');
}
return (int) (ch - 'A' + '\n');
}
// Token: 0x020005D2 RID: 1490
public enum Enum158
{
}
}
}

评论 ( 0 )

你可以在登录后,发表评论

C#
1
https://gitee.com/pedoc/GemBox.KeyGen.git
git@gitee.com:pedoc/GemBox.KeyGen.git
pedoc
GemBox.KeyGen
GemBox.KeyGen
master

搜索帮助

141041 ab9339c7 1850385 141043 25c028d5 1850385