以下代码可以得到试用期的license,当中包括开始试用的日期
private static string uE880(Type type, string uE00D, Stream SuE00D)
{
BinaryFormatter binaryFormatter = new BinaryFormatter();
object[] array = binaryFormatter.Deserialize(SuE00D) as object[];
if (!(array[1] is Hashtable))
{
return null;
}
Hashtable hashtable = array[1] as Hashtable;
foreach (object obj in hashtable.Keys)
{
string text = (string)obj;
return hashtable[text] as string;
}
return null;
}
static void Main(string[] args)
{
Telnet telnet = new Telnet();
Type type = telnet.GetType();
Assembly entryAssembly = Assembly.GetEntryAssembly();
FileInfo fileInfo = new FileInfo(entryAssembly.Location);
List<Stream> list = new List<Stream>();
foreach(string text in entryAssembly.GetManifestResourceNames())
{
if (text.EndsWith(".licenses", StringComparison.OrdinalIgnoreCase))
{
list.Add(entryAssembly.GetManifestResourceStream(text));
}
}
foreach (Stream uE00D in list)
{
string name = fileInfo.Name;
string text = uE880(type, fileInfo.Name, uE00D);
if (text != null)
{
}
}
}
断点在hashtable 上,可以看见你的license,我的是这样:
TRIAL-lbkSPEhDSUSQZzThs3Nu0MfatabYskJy-2020/10/12 19:48:20
这段代码时照猫画虎从他程序中提取出来的。
然后就是下面的代码:
private static void \uF5C5\uE0D8\uE8D3\uF5DA\uE5CE\uE886(Type \uE010, bool \uE010, string \uE010)
{
StringBuilder stringBuilder = new StringBuilder();
if (LicenseManager.\uE8A8\uE75B\uF0D2\uE00B\uF1CE\uE225 == null)
{
if (LicenseManager.CurrentContext.GetType().ReflectedType != null && LicenseManager.CurrentContext.GetType().ReflectedType.Name.Equals("licenseinterophelper", StringComparison.OrdinalIgnoreCase))
{
stringBuilder.Append("License.Set(String licenseKey) must be called before using this product. A free 30-day trial license key is available at http://dart.com/trial or a developer license can be purchased at " + LicenseManager.\uE032\uEDBB\uE846\uE14F\uF2EF\uF8AA + ".");
}
else
{
stringBuilder.Append("No license found. Please add the line \"" + LicenseManager.\uF5C5\uE0D8\uE8D3\uF5DA\uE5CE\uE888(\uE010) + "\" to the top level project's licenses.licx file and recompile. Refer to the 'Licensing and Trial Operation' topic of the help documentation for further assistance.");
}
stringBuilder.Append("\n\nFor more information contact Dart at support@dart.com, sales@dart.com or 315.790.5456.");
LicenseManager.Message(stringBuilder.