雪湖小札@blogjava

          心情與技術文檔同行 http://hi.baidu.com/jingleq

          BlogJava 首頁 新隨筆 聯系 聚合 管理
            24 Posts :: 2 Stories :: 4 Comments :: 0 Trackbacks

          常用鏈接

          留言簿(4)

          我參與的團隊

          隨筆檔案(24)

          文章檔案(2)

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

            antlr,語言識別的一個工具(anothertoolforlanguagerecognition,前身是pccts),它提供了一個框架,可以通過包含java、c++或c#動作的語法描述來構造語言識別器,編譯器和解釋器。antlrstudio是一款用于eclipse的插件,可以用來創建、調試antlr語法的集成環境。
            在antlrstudio的官方網站上提供的eclipse插件并沒有提供相應的licence.lic文件,所以我們還不能使用它的全部功能。
            在CowNew開源團隊網站 www.cownew.com上由kingchou提出了一個破解方案,我的操作都是基于這個方案的。
            方案是這樣描述的:AntlrStudio中antlr_Studio.license包中主要的類,也是其抵擋未注冊者使用的主要防線。1、當插件啟動時會先調用ASLicenseManager類的checkForLicense()。2、方法checkForLicense在此調用LicenseManager類的daysLeft()獲取剩余日期。3、進而觸發License類,其讀取License.lic注冊文件的信息,并會調用SignatureUtil工具類對其簽名做驗證。在ASLicenseManager中有一個很薄弱的環節,即:
          int i = licensemanager.daysLeft();
          if (i != -2) {
                if (hasAlreadyExpired() || i <= 0)
            ……
          只要daysLeft()返回值為-2即判斷為正式用戶。因而只要修改LicenseManagerImpl的daysLeft()方法為:
          public int daysLeft() {
                ……
                return -2;
          }
            由xml1123提出的修改是:直接將i   賦值為-2
          int i = licensemanager.daysLeft();
          i=-2;
          if (i != -2) {
           ……
            我的作法是采取了xml1123的修改。
            以下描述我的修改步驟:
            (1).在eclipse\plugins\AntlrStudio_1.1.0中找到AntlrStudio.jar文件。解壓AntlrStudio.jar\antlr_Studio\license中的ASLicenseManager.class出來,放到與jasml.jar(參考asm學習(0)--java字節碼工具Jasml)同一級目錄下。
            (2).cmd進入控制臺,cd到jasml.jar目錄下,輸入以下命令:
            set classpath=%classpath%;jasml.jar;
            java jasml -d ASLicenseManager.class
            (3).打開生成的ASLicenseManager.jasm文件,找到
             ----------- 原文 ---------
             invokevirtual   int antlr_Studio.license.LicenseManager.daysLeft()
                      istore_1
                      iload_1 
                      bipush   254
             ----------- 修改為 ----------
                      invokevirtual   int antlr_Studio.license.LicenseManager.daysLeft()
                      istore_1
                      bipush 254
                      istore_1
                      iload_1 
                      bipush   254
            (4).通過jasm文件編譯成.class文件。在控制臺中輸入命令:
            java jasml -c -o ASLicenseManager.jasm
            重新生成了ASLicenseManager.class文件
            (5).把生成的ASLicenseManager.class文件覆蓋在原來eclipse\plugins\AntlrStudio_1.1.0中找到的AntlrStudio.jar文件中的ASLicenseManager.class。
            (6).新建一個license.lic文件,放到plugins\AntlrStudio_1.1.0下,里面的內容為:
          2007-01-01
          Signature
          =0001
            啟動eclipse成功進入。
            修改好的ASLicenseManager.class.下載地址:http://www.aygfsteel.com/Files/csnowfox/ASLicenseManager.rar直接找到覆蓋就行。
            注意:此文僅供研究參考。提倡使用正版。

           

          posted on 2007-06-17 19:50 csnowfox 閱讀(1831) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。

          網站導航:
          博客園   IT新聞   Chat2DB   C++博客   博問  
           
          主站蜘蛛池模板: 西宁市| 安多县| 台南市| 砚山县| 灵武市| 垫江县| 舒城县| 彰武县| 华亭县| 高要市| 舞阳县| 洛川县| 永泰县| 旅游| 渑池县| 蕉岭县| 会理县| 连南| 大同县| 海阳市| 芦山县| 汝阳县| 恩平市| 平武县| 柘荣县| 闽侯县| 手游| 昂仁县| 惠水县| 抚州市| 南康市| 长顺县| 临朐县| 大姚县| 连城县| 台湾省| 朝阳县| 哈密市| 横峰县| 治县。| 浦北县|