Alloy破解过程

 

  1 None.gif package com.incors.plaf.alloy;
  2 None.gif
  3 None.gifimport java.io. * ;
  4 None.gifimport java.util.GregorianCalendar;
  5 None.gifimport java.util.zip.CRC32;
  6 None.gifimport java.util. * ;
  7 None.gif
  8 ExpandedBlockStart.gifContractedBlock.gif public   class  ch dot.gif {
  9ExpandedSubBlockStart.gifContractedSubBlock.gif  public ch()dot.gif{
 10ExpandedSubBlockEnd.gif  }

 11InBlock.gif
 12ExpandedSubBlockStart.gifContractedSubBlock.gif  private static void a()dot.gif{
 13InBlock.gif    if(a)
 14InBlock.gif      return;
 15InBlock.gif    bi.a("alloy.licenseCode",cr()); // feed serial automatically
 16InBlock.gif    String s=bi.a("alloy.licenseCode");
 17InBlock.gif    if(s == null)
 18ExpandedSubBlockStart.gifContractedSubBlock.gif      trydot.gif{
 19InBlock.gif        InputStream inputstream=(com.incors.plaf.alloy.ch.class).getClassLoader().
 20InBlock.gif                                getResourceAsStream("alloylnf.lic");
 21ExpandedSubBlockStart.gifContractedSubBlock.gif        if(inputstream != null)dot.gif{
 22InBlock.gif          InputStreamReader inputstreamreader=new InputStreamReader(inputstream,
 23InBlock.gif                                              "ISO-8859-1");
 24InBlock.gif          BufferedReader bufferedreader=new BufferedReader(inputstreamreader);
 25InBlock.gif          s=bufferedreader.readLine();
 26InBlock.gif          System.out.println(s);
 27InBlock.gif          bi.a("alloy.licenseCode",s);
 28InBlock.gif          bufferedreader.close();
 29InBlock.gif          inputstream.close();
 30ExpandedSubBlockEnd.gif        }

 31ExpandedSubBlockEnd.gif      }

 32ExpandedSubBlockStart.gifContractedSubBlock.gif      catch(Exception exception)dot.gif{}
 33ExpandedSubBlockStart.gifContractedSubBlock.gif    if(s != null)dot.gif{
 34InBlock.gif      int l=s.indexOf('#');
 35InBlock.gif      int i1=s.indexOf('#',l + 1);
 36InBlock.gif      int j1=s.indexOf('#',i1 + 1);
 37InBlock.gif      f=s.substring(0,l);
 38InBlock.gif      if(f.length() > 1)
 39InBlock.gif        j=a(f);
 40InBlock.gif      e=s.substring(l + 1,i1);
 41InBlock.gif      d=s.substring(0,i1);
 42InBlock.gif      g=Long.parseLong(s.substring(i1 + 1,j1),36);
 43InBlock.gif      h=Long.parseLong(s.substring(j1 + 1),36);
 44InBlock.gif      b();
 45ExpandedSubBlockEnd.gif    }

 46InBlock.gif    a=true;
 47ExpandedSubBlockEnd.gif  }

 48InBlock.gif
 49ExpandedSubBlockStart.gifContractedSubBlock.gif  private static void b()dot.gif{
 50InBlock.gif    i.update((h % 127L + d).getBytes());
 51ExpandedSubBlockStart.gifContractedSubBlock.gif    if(i.getValue() != g)dot.gif{
 52InBlock.gif      b=false;
 53InBlock.gif      return;
 54ExpandedSubBlockEnd.gif    }

 55ExpandedSubBlockStart.gifContractedSubBlock.gif    if(j != null && (new GregorianCalendar()).after(j))dot.gif// 试用号过期
 56InBlock.gif      b=false;
 57InBlock.gif      return;
 58ExpandedSubBlockEnd.gif    }

 59InBlock.gif    b=true;
 60ExpandedSubBlockStart.gifContractedSubBlock.gif    if(j != null && (new GregorianCalendar()).after(new GregorianCalendar(2003,7,12)))dot.gif// 如果使用期大于1年
 61InBlock.gif      GregorianCalendar gregoriancalendar=new GregorianCalendar();
 62InBlock.gif      gregoriancalendar.add(1,1);
 63ExpandedSubBlockStart.gifContractedSubBlock.gif      if(j.after(gregoriancalendar))dot.gif{
 64InBlock.gif        c=false;
 65InBlock.gif        return;
 66ExpandedSubBlockEnd.gif      }

 67ExpandedSubBlockEnd.gif    }

 68InBlock.gif    c=true;
 69ExpandedSubBlockEnd.gif  }

 70InBlock.gif
 71ExpandedSubBlockStart.gifContractedSubBlock.gif  private static GregorianCalendar a(String s)dot.gif{
 72InBlock.gif    int l=Integer.parseInt(s.substring(0,4));
 73InBlock.gif    int i1=Integer.parseInt(s.substring(5,7));
 74InBlock.gif    int j1=Integer.parseInt(s.substring(8,10));
 75InBlock.gif    return new GregorianCalendar(l,i1 - 1,j1 + 1);
 76ExpandedSubBlockEnd.gif  }

 77InBlock.gif
 78ExpandedSubBlockStart.gifContractedSubBlock.gif  public static boolean c()dot.gif{
 79InBlock.gif    if(!a)
 80InBlock.gif      a();
 81InBlock.gif    return bi.a("alloy.licenseCode"!= null;
 82ExpandedSubBlockEnd.gif  }

 83InBlock.gif
 84ExpandedSubBlockStart.gifContractedSubBlock.gif  public static boolean d()dot.gif{
 85InBlock.gif    if(!a)
 86InBlock.gif      a();
 87InBlock.gif    return b;
 88ExpandedSubBlockEnd.gif  }

 89InBlock.gif
 90ExpandedSubBlockStart.gifContractedSubBlock.gif  public static boolean e()dot.gif{
 91InBlock.gif    if(!a)
 92InBlock.gif      a();
 93InBlock.gif    return c;
 94ExpandedSubBlockEnd.gif  }

 95InBlock.gif
 96InBlock.gif  private static boolean a=false;
 97InBlock.gif  private static boolean b=false;
 98InBlock.gif  private static boolean c=false;
 99InBlock.gif  private static String d;
100InBlock.gif  public static String e;
101InBlock.gif  public static String f;
102InBlock.gif  public static long g=0L;
103InBlock.gif  public static long h=0L;
104InBlock.gif  private static CRC32 i=new CRC32();
105InBlock.gif  public static GregorianCalendar j;
106InBlock.gif
107ExpandedSubBlockStart.gifContractedSubBlock.gif  private static String cr()dot.gif// 自动生成序列号,比当前时间晚一个月
108InBlock.gif    Calendar cal=new GregorianCalendar();
109InBlock.gif    cal.add(cal.MONTH,1);
110InBlock.gif
111InBlock.gif    String s="";
112InBlock.gif    int year=cal.get(cal.YEAR);
113InBlock.gif    int month=cal.get(cal.MONTH);
114InBlock.gif    int day=cal.get(cal.DAY_OF_MONTH);
115InBlock.gif
116InBlock.gif    s+=year + "/" + (month < 10 ? "0" + month : month) + "/" + (day < 10 ? "0" + day
117InBlock.gif        : day);
118InBlock.gif    s+="#oop@vip.163.com#128cw93#1a193l";
119InBlock.gif
120InBlock.gif    int l=s.indexOf('#');
121InBlock.gif    int i1=s.indexOf('#',l + 1);
122InBlock.gif    int j1=s.indexOf('#',i1 + 1);
123InBlock.gif
124InBlock.gif    String e=s.substring(l + 1,i1);
125InBlock.gif    String d=s.substring(0,i1);
126InBlock.gif    String sg=s.substring(i1 + 1,j1);
127InBlock.gif    Long g=Long.parseLong(sg,36);
128InBlock.gif    Long h=Long.parseLong(s.substring(j1 + 1),36);
129InBlock.gif
130InBlock.gif    CRC32 crc=new CRC32();
131InBlock.gif    crc.update((h % 127L + d).getBytes());
132InBlock.gif    Long ii=crc.getValue();
133InBlock.gif    StringBuffer sn=new StringBuffer(s).replace(i1 + 1,j1,Long.toString(ii,36));
134InBlock.gif    return sn.toString();
135ExpandedSubBlockEnd.gif  }

136ExpandedBlockEnd.gif}

137 None.gif

关键代码处有注释,我就详细讲一下cr()。
由于Alloy的序列号的时间比当前时间晚一年以上也视作invalid,因此我在cr()中动态生成一个序列号,该序列号比当前时间晚一个月,使用bi.a()注入程序中(15行)。
111行到133行是具体的算号过程,可见“128cw93”和“1a1931”其实是两个36进制的数。
第133行把算得的校验值替换118行生成的字符串中的相应位置上的字符串,生成新的序列号。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值