破解 BizTalk Adapter Pack 120 天限制

最近在找.net 和 sap 交互的组件,发现 biztalk  Adapter Pack  有 for mysap 的组件,但是120天试用的,虽然自已也只是做个方案,但是希望时间限制能长一点.于是拿它来开刀,研究了一把.

通过反编译它的几个关键组件,终于找到了它的时间检测代码。如下:

private static DateTime GetExpiryDate() { RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE/Microsoft/BizTalk Adapter Pack/2.0/Registration"); byte[] encryptedData = (byte[])key.GetValue("Application Data"); string s = "89D87365-ED2B-4f58-81C4-F42987DC1433"; byte[] bytes = Encoding.ASCII.GetBytes(s); byte[] Data = ProtectedData.Unprotect(encryptedData, bytes, DataProtectionScope.LocalMachine); return new DateTime(BitConverter.ToInt64(Data, 0)); }

 

很明显它是将失效时间写在注册表里的,并且是经地加密的。

根据上面代码写了一段相应的注册代码,将失效时间修改到 9999-12-31 23:59:59,如下:

private static void SetExpiryDate(DateTime dt) { string s = "89D87365-ED2B-4f58-81C4-F42987DC1433"; byte[] bytes = Encoding.ASCII.GetBytes(s); byte[] Data = BitConverter.GetBytes(dt.ToBinary()); byte[] encryptedData = ProtectedData.Protect(Data, bytes, DataProtectionScope.LocalMachine); RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE/Microsoft/BizTalk Adapter Pack/2.0/Registration",true ); key.SetValue("Application Data",encryptedData,RegistryValueKind.Binary); } static void Main(string[] args) { Console.WriteLine(GetExpiryDate().ToString()); SetExpiryDate(DateTime.MaxValue); Console.Read(); }

 

 

注:严重警告,在此只作为学习研究,如作其它用途或造成任何损失概不负责.

你可能感兴趣的:(加密,String,application,SAP,byte,破解)