1 Star 0 Fork 0

pedoc / GemBox.KeyGen

加入 Gitee
与超过 600 万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未指定开源许可证,未经作者的许可,此代码仅用于学习,不能用于其他用途。
克隆/下载
Class1065.cs 6.55 KB
一键复制 编辑 Web IDE 原始数据 按行查看 历史
pedoc 提交于 2019-04-15 17:32 . init
namespace GemBox.KeyGen
{
using System;
using System.Globalization;
// Token: 0x02000592 RID: 1426
public class Class1065
{
// Token: 0x06002F04 RID: 12036 RVA: 0x000F52E0 File Offset: 0x000F34E0
public void method_0(string string_1)
{
string b = Class1065.smethod_0(string_1.ToUpper(CultureInfo.InvariantCulture).Trim());
if (this.bool_0)
{
if (this.string_0 != b)
{
throw new Exception("The serial key can be set only once.");
}
}
else
{
this.string_0 = b;
this.bool_0 = true;
if (this.string_0 == null)
{
throw new Exception("The serial key \"" + string_1 +
"\" is not valid. Valid serial key has multiple groups of alphanumeric characters, separated with dashes. ");
}
}
}
// Token: 0x06002F05 RID: 12037 RVA: 0x000F5360 File Offset: 0x000F3560
private static string smethod_0(string string_1)
{
string[] array = string_1.Split(new char[]
{
'-'
});
if (string_1.Length == 19)
{
if (array.Length != 4)
{
return null;
}
string[] array2 = array;
for (int i = 0; i < array2.Length; i++)
{
if (array2[i].Length != 4)
{
return null;
}
}
return array[0] + array[1] + array[2] + array[3];
}
else
{
if (array.Length != 3)
{
return null;
}
if (array[0].Length == 4 && array[1].Length == 7)
{
if (array[2].Length == 3)
{
return array[0] + array[1] + array[2];
}
}
return null;
}
}
// Token: 0x06002F06 RID: 12038 RVA: 0x000F5400 File Offset: 0x000F3600
public bool method_1(int int_0, ref int int_1, ref int int_2)
{
if (this.string_0 == null)
{
return false;
}
int int_3 = 0;
Random random = new Random();
if (this.string_0[0] == 'E')
{
Class1123.Enum158 @enum;
string text;
string text2;
DateTime dateTime;
int num;
Class1123.smethod_1(this.string_0, out @enum, out int_3, out text, out text2, 'E', out dateTime,
out num);
@enum |= (Class1123.Enum158) 4;
if (Class1065.smethod_2(@enum, int_3, int_0))
{
if ((@enum & (Class1123.Enum158) 32) != (Class1123.Enum158) 0 &&
((DateTime.Now.Date - dateTime.Date).Days < 0 ||
(DateTime.Now.Date - dateTime.Date).Days > num))
{
throw new Exception("The serial key is not valid. License expired.");
}
int_1 = random.Next(111, 12567);
int_2 = int_1 + 23 * random.Next(3, 1796);
SpreadsheetInfo.bool_0 = true;
return true;
}
}
else if (Class1123.smethod_3(this.string_0) == 'R')
{
int_1 = random.Next(1112, 12567);
int_2 = int_1 - 150;
SpreadsheetInfo.bool_0 = false;
return true;
}
throw new Exception("The serial key is not valid." + Class1065.smethod_1(int_3));
}
// Token: 0x06002F07 RID: 12039 RVA: 0x000F5538 File Offset: 0x000F3738
private static string smethod_1(int int_0)
{
string text = string.Empty;
if (int_0 <= 64)
{
switch (int_0)
{
case 31:
text = "29";
break;
case 32:
case 34:
case 36:
break;
case 33:
text = "31";
break;
case 35:
text = "33";
break;
case 37:
text = "35";
break;
default:
if (int_0 == 64)
{
text = "37";
}
break;
}
}
else if (int_0 != 66)
{
if (int_0 == 74)
{
text = "41";
}
}
else
{
text = "39";
}
if (text != null && text.Length > 1)
{
text = text[0].ToString() + "." + text[1].ToString();
if (text != SpreadsheetInfo.VersionLong)
{
return string.Concat(new string[]
{
" Your code is using 'GemBox.Spreadsheet ",
SpreadsheetInfo.VersionLong,
"' but your serial key is for 'GemBox.Spreadsheet ",
text,
"'. Please use serial key for 'GemBox.Spreadsheet ",
SpreadsheetInfo.VersionLong,
"'."
});
}
}
return string.Empty;
}
// Token: 0x06002F08 RID: 12040 RVA: 0x00025715 File Offset: 0x00023915
private static bool smethod_2(Class1123.Enum158 enum158_0, int int_0, int int_1)
{
return (enum158_0 & (Class1123.Enum158) 40) != (Class1123.Enum158) 0 &&
(enum158_0 & (Class1123.Enum158) 4) != (Class1123.Enum158) 0 &&
(enum158_0 & (Class1123.Enum158) 1) == (Class1123.Enum158) 0 &&
(enum158_0 & (Class1123.Enum158) 2) == (Class1123.Enum158) 0 && int_0 == int_1;
}
// Token: 0x040011FB RID: 4603
private string string_0;
// Token: 0x040011FC RID: 4604
private bool bool_0;
}
}

评论 ( 0 )

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

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

搜索帮助