• 静思
  • 吴言片语
    • 吴言
    • 片语
    • 杂七杂八
  • 死于青春
    • 一路走好
  • 乌合麒麟
  • 纪念
    • 5.12
    • 3.23
  • GitHub
    • A List of Post-mortems
    • The Art of Command Line
  • 关于
    • Privacy Policy

程序员的信仰

金鳞岂是池中物,一遇风云便化龙

HOME » 技术生活 » Alloy破解过程

Alloy破解过程

2005 年 8 月 9 日 @ 下午 3:42 by Jay | 被踩了 2,125 脚
package com.incors.plaf.alloy;
 
import java.io.*;
import java.util.GregorianCalendar;
import java.util.zip.CRC32;
import java.util.*;

public class ch{
  public ch(){
  }

  private static void a(){
    if(a)
      return;
    bi.a("alloy.licenseCode",cr()); // feed serial automatically
    String s=bi.a("alloy.licenseCode");
    if(s == null)
      try{
        InputStream inputstream=(com.incors.plaf.alloy.ch.class).getClassLoader().
                                getResourceAsStream("alloylnf.lic");
        if(inputstream != null){
          InputStreamReader inputstreamreader=new InputStreamReader(inputstream,
                                              "ISO-8859-1");
          BufferedReader bufferedreader=new BufferedReader(inputstreamreader);
          s=bufferedreader.readLine();
          System.out.println(s);
          bi.a("alloy.licenseCode",s);
          bufferedreader.close();
          inputstream.close();
        }
      }
      catch(Exception exception){}
    if(s != null){
      int l=s.indexOf('#');
      int i1=s.indexOf('#',l + 1);
      int j1=s.indexOf('#',i1 + 1);
      f=s.substring(0,l);
      if(f.length() > 1)
        j=a(f);
      e=s.substring(l + 1,i1);
      d=s.substring(0,i1);
      g=Long.parseLong(s.substring(i1 + 1,j1),36);
      h=Long.parseLong(s.substring(j1 + 1),36);
      b();
    }
    a=true;
  }

  private static void b(){
    i.update((h % 127L + d).getBytes());
    if(i.getValue() != g){
      b=false;
      return;
    }
    if(j != null && (new GregorianCalendar()).after(j)){ // 试用号过期
      b=false;
      return;
    }
    b=true;
    if(j != null && (new GregorianCalendar()).after(new GregorianCalendar(2003,7,12))){ // 如果使用期大于1年
      GregorianCalendar gregoriancalendar=new GregorianCalendar();
      gregoriancalendar.add(1,1);
      if(j.after(gregoriancalendar)){
        c=false;
        return;
      }
    }
    c=true;
  }

  private static GregorianCalendar a(String s){
    int l=Integer.parseInt(s.substring(0,4));
    int i1=Integer.parseInt(s.substring(5,7));
    int j1=Integer.parseInt(s.substring(8,10));
    return new GregorianCalendar(l,i1 - 1,j1 + 1);
  }

  public static boolean c(){
    if(!a)
      a();
    return bi.a("alloy.licenseCode") != null;
  }

  public static boolean d(){
    if(!a)
      a();
    return b;
  }

  public static boolean e(){
    if(!a)
      a();
    return c;
  }

  private static boolean a=false;
  private static boolean b=false;
  private static boolean c=false;
  private static String d;
  public static String e;
  public static String f;
  public static long g=0L;
  public static long h=0L;
  private static CRC32 i=new CRC32();
  public static GregorianCalendar j;

  private static String cr(){ // 自动生成序列号,比当前时间晚一个月
    Calendar cal=new GregorianCalendar();
    cal.add(cal.MONTH,1);

   String s="";
    int year=cal.get(cal.YEAR);
    int month=cal.get(cal.MONTH);
    int day=cal.get(cal.DAY_OF_MONTH);

    s+=year + "/" + (month < 10 ? "0" + month : month) + "/" + (day < 10 ? "0" + day : day);
    s+="#[email protected]#128cw93#1a193l";

    int l=s.indexOf('#');
    int i1=s.indexOf('#',l + 1);
    int j1=s.indexOf('#',i1 + 1);

    String e=s.substring(l + 1,i1);
    String d=s.substring(0,i1);
    String sg=s.substring(i1 + 1,j1);
    Long g=Long.parseLong(sg,36);
    Long h=Long.parseLong(s.substring(j1 + 1),36);

    CRC32 crc=new CRC32();
    crc.update((h % 127L + d).getBytes());
    Long ii=crc.getValue();
    StringBuffer sn=new StringBuffer(s).replace(i1 + 1,j1,Long.toString(ii,36));
    return sn.toString();
  }
}

关键代码处有注释,我就详细讲一下cr()。

由于Alloy的序列号的时间比当前时间晚一年以上也视作invalid,因此我在cr()中动态生成一个序列号,该序列号比当前时间晚一个月,使用bi.a()注入程序中(15行)。

行到132行是具体的算号过程,可见“128cw93”和“1a1931”其实是两个36进制的数。

第132行把算得的校验值替换117行生成的字符串中的相应位置上的字符串,生成新的序列号。



-- EOF --
除非注明(如“转载”、“[zz]”等),本博文章皆为原创内容,转载时请注明: 「转载自程序员的信仰©」
本文链接地址:Alloy破解过程

分享

  • 点击分享到 Facebook (在新窗口中打开) Facebook
  • 点击以分享到 X(在新窗口中打开) X
  • 更多
  • 点击分享到Reddit(在新窗口中打开) Reddit
  • 点击分享到Telegram(在新窗口中打开) Telegram
  • 点击以在 Mastodon 上共享(在新窗口中打开) Mastodon

赞过:

赞 正在加载……

相关

Today on history:

【2021】夺金时刻!中国队38金海报合集来了![zz]
【2010】得亏除了主流媒体还有优酷啊,不然郭德纲上哪儿说理去啊
Posted in: 技术生活 Tagged: alloy, java, 破解
← “麦莎”来了
桃花庵 [zz] →

android (9) apple (20) augmentum (9) Beijing (21) bt (8) career (28) coding (38) firefox (10) google (36) hibernate (11) ibm (11) iphone (10) java (93) linux (16) m$ (26) mac (58) macos (27) nazca (9) olympics (8) oo (8) playstation (10) rip (8) Shanghai (39) spring (9) tips (45) tommy emmanuel (8) ubuntu (12) usa (23) windows (9) 北航 (17) 博客 (29) 吐槽 (8) 周末 (9) 和谐社会 (26) 小资 (11) 愤青 (40) 方言 (10) 朋友 (77) 歌词 (8) 烟酒不分家 (18) 爱国 (19) 爱情 (8) 犯二 (15) 破解 (8) 足球 (11)

烫手山芋

  • 再谈苹果的输入法:这一次是靠OS X自带的输入法来翻身的~ - 被踩了 27,349 脚
  • 生活,就是一个期待跟着一个期待 - 被踩了 21,357 脚
  • 星巴克饮品缩写大全(Starbucks Drink ID Codes)[zz] - 被踩了 18,408 脚
  • 从一个全角冒号说一下我为什么不感冒iOS - 被踩了 14,316 脚
  • 有关Character.isLetter()和Character.isLetterOrDigit() - 被踩了 13,591 脚

刚拍的砖

  • leo 发表在《再谈苹果的输入法:这一次是靠OS X自带的输入法来翻身的~》
  • 花 发表在《再谈苹果的输入法:这一次是靠OS X自带的输入法来翻身的~》
  • 无名氏 发表在《从一个全角冒号说一下我为什么不感冒iOS》
  • Jay 发表在《Mac OS geek级问题》
  • Wei Wang 发表在《再谈苹果的输入法:这一次是靠OS X自带的输入法来翻身的~》

随便看看

  • 使用Spring LDAP ODM操作LDAP13 年 ago
  • 星巴克饮品缩写大全(Starbucks Drink ID Codes)[zz]9 年 ago
  • 联通3G套餐到底哪个便宜?15 年 ago
  • 宝刀未老20 年 ago
  • 初夏,下雨天9 年 ago

文以类聚

光阴似箭

其他操作

  • 登录
  • 条目 feed
  • 评论 feed
  • WordPress.org

Copyright © 2025 程序员的信仰.

Jay's Omega WordPress Theme by Jay

 

正在加载评论...
 

    %d