六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

URTracker 2.11版 license驗證原理剖析

[摘要]注 :原創,轉載請注明出處。作 者:草惜草首 發: http://kokey.blogchina.com序言: 看了henryouly的文章以后深受啟發,決定對URTracker最新的版本來個剖析。在此,特別感謝henryouly!××××...
注    :原創,轉載請注明出處。
作 者:草惜草
首 發: http://kokey.blogchina.com

序言:

   看了henryouly的文章以后深受啟發,決定對URTracker最新的版本來個剖析。在此,特別感謝henryouly!

×××××××××××××××××××××××××××××××××××××××××××××
URTracker事務跟蹤系統是一款功能強大而且易于使用的Web方式的協同工作軟件 。它用于幫助公司和團隊跟蹤工作中的問題,管理和記錄這些問題的處理過程。
URTracker向您的團隊提供了一個全功能的,高度可定制的軟件工具用于報告和跟蹤問題、需求、缺陷(BUG)或者任務等事務。它擁有豐富的自定義字段、基于項目和角色的權限控制、簡化的工作流、友好的用戶界面,以及更多的其他特性。我們非常確信您將會喜歡上URTracker,因為我們相信她正是您所需要的。
 ××××××××××××××××××××××××××××××××××××××××××××
 工具介紹:
 
   要研究.NET當然離不開Reflector for .NET 。(Reflector is a class browser for .NET components. It supports assembly and namespace views, type and member search, XML documentation, call and callee graphs, IL, Visual Basic, Delphi and C# decompiler, dependency trees, base type and derived type hierarchies and resource viewers. )
   如果想把代碼保存下來,那就需要Reflector的插件Reflector.FileDisassembler了。(The Reflector.FileDisassembler is a little add-in for the new version of Lutz Roeder's .NET Reflector that you can use to dump the decompiler output to files of any Reflector supported language (C#, VB.NET, Delphi). This is extremely useful if you are searching for a specific line of code as you can use VS.NET's "Find in Files" or want to convert a class from one language to another.

  下載地址:Reflector for .NET   http://www.aisto.com/roeder/dotnet/
                      Reflector.FileDisassembler    http://www.denisbauer.com/NETTools/FileDisassembler.aspx
 
 正文:

嚴重聲明:本文只作科研和學習用途。如果由本文產生的法律糾紛,一概與本人無關。

好了,了解了Reflector咱們就可以動手研究URTracker了。

當然首先用Reflector分析bin文件夾下的文件,一共有12個DLL文件,從他們的名稱你也可以猜出個八八九九,反正你不怕麻煩你就挨個用Reflector試好了...^_^
最后找到了WebTracker.dll 可疑,因為在Reflector按F3,你可以搜索到很多關于license的東東。哈哈,探究之路開始了。
首先看看Lealsoft.URTracker.BLL下有個ServerLicenseProvider類。

public class ServerLicenseProvider : LicenseProvider
{
      // Methods
      static ServerLicenseProvider();
      public ServerLicenseProvider();
      protected virtual ServerLicense CreateEmptyLicense(Type type);
      protected virtual ServerLicense CreateLicense(Type type, string key);
      public override License GetLicense(LicenseContext context, Type type, object instance, bool allowExceptions);
      protected virtual string GetLicenseData(Type type);
      protected virtual Stream GetLicenseDataStream(Type type);
      protected virtual bool ValidateLicense(ServerLicense license, out string errorMessage);
      protected virtual bool ValidateLicenseData(Type type, string licenseData);

      // Fields
      private static readonly ServerLicenseCollector LicenseCollector;

      // Nested Types
      private sealed class ServerLicenseCollector
      {
            // Methods
            public ServerLicenseCollector();
            public void AddLicense(Type objectType, ServerLicense license);
            public ServerLicense GetLicense(Type objectType);
            public void RemoveLicense(Type objectType);

            // Fields
            private IDictionary _collectedLicenses;
      }
}
 
看到沒,有幾個CreateLicense,GetLicense,ValidateLicense ,ValidateLicenseData,GetLicenseDataStream這幾個方法。好,打開看看都是什么東東。

protected virtual ServerLicense CreateLicense(Type type, string key)
{
      char[] chArray1 = new char[1] { ':' } ;
      string[] textArray1 = key.Split(chArray1);
      return new URTrackerLicense(type, key, long.Parse(textArray1[1], CultureInfo.InvariantCulture), long.Parse(textArray1[2], CultureInfo.InvariantCulture), textArray1[3], long.Parse(textArray1[4], CultureInfo.InvariantCulture), long.Parse(textArray1[5], CultureInfo.InvariantCulture), textArray1[6]);
}
 
哇!就是新建license,URTrackerLicense后面有幾個參數,什么也看不出,感覺是要用":"split開一個字符串。來,打開URTrackerLicense構造函數看看。
public URTrackerLicense(Type type, string key, long startTicks, long ticks, string username, long userIndex, long clientCount, string mac) : base(type, key)
{
      this._foundMac = false;
      this._ticks = ticks;
      this._startTicks = startTicks;
      this._username = username;
      this._userIndex = userIndex;
      this._clientCount = clientCount;
      this._mac = mac;
      this._macArray = URTrackerLicense.GetMacArray();
      this._foundMac = this._macArray.IndexOf(this._mac) > -1;
}
 
哦,看到ticks,startTicks,username,userIndex,clientCount,mac
難道這些就是所需參數"到期時間,使用開始時間,用戶名,用戶名索引,用戶數,本機網卡地址"
有點意思了。呵呵。
找到了 URTrackerLicense 類,你就會知道我們猜測的沒有錯了。
public class URTrackerLicense : ServerLicense
{
      // Methods
      public URTrackerLicense(Type type, string key, long startTicks, long ticks, string username, long userIndex, long clientCount, string mac);
      public static ArrayList GetMacArray();

      // Properties
      public long ClientCount { get; }
      public bool IsExpired { get; }
      public string Mac { get; }
      public long StartTicks { get; }
      public long Ticks { get; }
      public long UserIndex { get; }
      public string Username { get; }

      // Fields
      private long _clientCount;
      private bool _foundMac;
      private string _mac;
      private ArrayList _macArray;
      private long _startTicks;
      private long _ticks;
      private long _userIndex;
      private string _username;
}
 
繼續,剛才找了CreateLicense,現在開始找ValidateLicenseData。
protected virtual bool ValidateLicenseData(Type type, string licenseData)
{
      bool flag1 = false;
      char[] chArray1 = new char[1] { ':' } ;
      string[] textArray1 = licenseData.Split(chArray1);
      if (textArray1.Length == 7)
      {
            return (string.Compare("URTracker1Licensed", textArray1[0], true, CultureInfo.InvariantCulture) == 0);
      }
      return flag1;
}
 
哈哈,就是說剛才分析那個數組中textArray1[0],必須是URTracker1Licensed!哈哈,這也進一步證實了我們要把注冊信息字符串用":"分開的設想。
Come on!離成功越來越近了!接著分析ValidateLicense。
protected virtual bool ValidateLicense(ServerLicense license, out string errorMessage)
{
      errorMessage = null;
      URTrackerLicense license1 = (URTrackerLicense) license;
      if (license1.IsExpired)
      {
            errorMessage = "The License has expired.";
            return false;
      }
      return true;
}
 
哦,知道了!原來是判斷URTrackerLicense的屬性IsExpired的真假!好,咱們看看屬性IsExpired。
public bool IsExpired
{
      get
      {
            if ((DateTime.Today.Ticks <= this._ticks) && (DateTime.Now.Ticks >= this._startTicks))
            {
                  return !this._foundMac;
            }
            return true;
      }
}
 
 知道了吧!就是判斷當前時間要在ticks和startTicks之間!然后再判斷Mac的值。
 現在查找Mac的相關類或者方法。找到了GetMacArray
 public static ArrayList GetMacArray()
{
      ManagementClass class1 = new ManagementClass("Win32_NetworkAdapterConfiguration");
      ManagementObjectCollection collection1 = class1.GetInstances();
      ArrayList list1 = new ArrayList();
      using (ManagementObjectCollection.ManagementObjectEnumerator enumerator1 = collection1.GetEnumerator())
      {
            while (enumerator1.MoveNext())
            {
                  ManagementObject obj1 = enumerator1.get_Current();
                  if ((bool) obj1.get_Item("IPEnabled"))
                  {
                        list1.Add(obj1.get_Item("MacAddress").ToString().Replace(":", "").ToUpper());
                  }
                  obj1.Dispose();
            }
      }
      return list1;
}


[1] [2]  下一頁




主站蜘蛛池模板: 日韩黄a级成人毛片 | 亚洲免费观看在线视频 | 亚洲成a人v在线观看 | 人人公开免费超级碰碰碰视频 | 性感制服| 五月激情六月丁香 | 四虎影院国产 | 天天狠天天透天干天天怕处 | 婷婷性 | 新一级毛片国语版 | 在线h观看 | 亚洲成a人片在线观看中文 亚洲成a人片在线观看精品 | 我色综合| 天天干天天干天天干天天 | 四虎网址在线观看 | 日韩激情视频在线观看 | 欧美特黄特色aaa大片免费看 | 日韩福利视频精品专区 | 欧洲亚洲一区二区三区 | 影音色资源 | 欧美性v视频播放 | 欧洲亚洲视频 | 青青在线视频免费看观看 | 日日舔夜夜操 | 午夜一级精品免费毛片 | 亚洲国产欧美在线人成 | 日韩播放 | 中文字幕在线免费观看 | 日韩在线视频免费 | 日本三级午夜 | 手机在线观看亚洲国产精品 | 五月激情丁香婷婷综合第九 | 日本成人福利 | 四虎播放 | 影音先锋国产系列精品 | 亚洲狠狠婷婷综合久久久久图片 | 中文字幕免费视频精品一 | 在线成人国产 | 青青碰 | 永久在线观看www免费视频 | 日本不卡一区二区三区在线观看 |