1 package com.incors.plaf.alloy;
package com.incors.plaf.alloy;
  2
  3 import java.io.*;
import java.io.*;
  4 import java.util.GregorianCalendar;
import java.util.GregorianCalendar;
  5 import java.util.zip.CRC32;
import java.util.zip.CRC32;
  6 import java.util.*;
import java.util.*;
  7
  8
 public class ch
public class ch {
{
  9
 public ch()
  public ch() {
{
 10 }
  }
 11
 12
 private static void a()
  private static void a() {
{
 13 if(a)
    if(a)
 14 return;
      return;
 15 bi.a("alloy.licenseCode",cr()); // feed serial automatically
    bi.a("alloy.licenseCode",cr()); // feed serial automatically
 16 String s=bi.a("alloy.licenseCode");
    String s=bi.a("alloy.licenseCode");
 17 if(s == null)
    if(s == null)
 18
 try
      try {
{
 19 InputStream inputstream=(com.incors.plaf.alloy.ch.class).getClassLoader().
        InputStream inputstream=(com.incors.plaf.alloy.ch.class).getClassLoader().
 20 getResourceAsStream("alloylnf.lic");
                                getResourceAsStream("alloylnf.lic");
 21
 if(inputstream != null)
        if(inputstream != null) {
{
 22 InputStreamReader inputstreamreader=new InputStreamReader(inputstream,
          InputStreamReader inputstreamreader=new InputStreamReader(inputstream,
 23 "ISO-8859-1");
                                              "ISO-8859-1");
 24 BufferedReader bufferedreader=new BufferedReader(inputstreamreader);
          BufferedReader bufferedreader=new BufferedReader(inputstreamreader);
 25 s=bufferedreader.readLine();
          s=bufferedreader.readLine();
 26 System.out.println(s);
          System.out.println(s);
 27 bi.a("alloy.licenseCode",s);
          bi.a("alloy.licenseCode",s);
 28 bufferedreader.close();
          bufferedreader.close();
 29 inputstream.close();
          inputstream.close();
 30 }
        }
 31 }
      }
 32
 catch(Exception exception)
      catch(Exception exception) {}
{}
 33
 if(s != null)
    if(s != null) {
{
 34 int l=s.indexOf('#');
      int l=s.indexOf('#');
 35 int i1=s.indexOf('#',l + 1);
      int i1=s.indexOf('#',l + 1);
 36 int j1=s.indexOf('#',i1 + 1);
      int j1=s.indexOf('#',i1 + 1);
 37 f=s.substring(0,l);
      f=s.substring(0,l);
 38 if(f.length() > 1)
      if(f.length() > 1)
 39 j=a(f);
        j=a(f);
 40 e=s.substring(l + 1,i1);
      e=s.substring(l + 1,i1);
 41 d=s.substring(0,i1);
      d=s.substring(0,i1);
 42 g=Long.parseLong(s.substring(i1 + 1,j1),36);
      g=Long.parseLong(s.substring(i1 + 1,j1),36);
 43 h=Long.parseLong(s.substring(j1 + 1),36);
      h=Long.parseLong(s.substring(j1 + 1),36);
 44 b();
      b();
 45 }
    }
 46 a=true;
    a=true;
 47 }
  }
 48
 49
 private static void b()
  private static void b() {
{
 50 i.update((h % 127L + d).getBytes());
    i.update((h % 127L + d).getBytes());
 51
 if(i.getValue() != g)
    if(i.getValue() != g) {
{
 52 b=false;
      b=false;
 53 return;
      return;
 54 }
    }
 55
 if(j != null && (new GregorianCalendar()).after(j))
    if(j != null && (new GregorianCalendar()).after(j)) { // 试用号过期
{ // 试用号过期
 56 b=false;
      b=false;
 57 return;
      return;
 58 }
    }
 59 b=true;
    b=true;
 60
 if(j != null && (new GregorianCalendar()).after(new GregorianCalendar(2003,7,12)))
    if(j != null && (new GregorianCalendar()).after(new GregorianCalendar(2003,7,12))) { // 如果使用期大于1年
{ // 如果使用期大于1年
 61 GregorianCalendar gregoriancalendar=new GregorianCalendar();
      GregorianCalendar gregoriancalendar=new GregorianCalendar();
 62 gregoriancalendar.add(1,1);
      gregoriancalendar.add(1,1);
 63
 if(j.after(gregoriancalendar))
      if(j.after(gregoriancalendar)) {
{
 64 c=false;
        c=false;
 65 return;
        return;
 66 }
      }
 67 }
    }
 68 c=true;
    c=true;
 69 }
  }
 70
 71
 private static GregorianCalendar a(String s)
  private static GregorianCalendar a(String s) {
{
 72 int l=Integer.parseInt(s.substring(0,4));
    int l=Integer.parseInt(s.substring(0,4));
 73 int i1=Integer.parseInt(s.substring(5,7));
    int i1=Integer.parseInt(s.substring(5,7));
 74 int j1=Integer.parseInt(s.substring(8,10));
    int j1=Integer.parseInt(s.substring(8,10));
 75 return new GregorianCalendar(l,i1 - 1,j1 + 1);
    return new GregorianCalendar(l,i1 - 1,j1 + 1);
 76 }
  }
 77
 78
 public static boolean c()
  public static boolean c() {
{
 79 if(!a)
    if(!a)
 80 a();
      a();
 81 return bi.a("alloy.licenseCode") != null;
    return bi.a("alloy.licenseCode") != null;
 82 }
  }
 83
 84
 public static boolean d()
  public static boolean d() {
{
 85 if(!a)
    if(!a)
 86 a();
      a();
 87 return b;
    return b;
 88 }
  }
 89
 90
 public static boolean e()
  public static boolean e() {
{
 91 if(!a)
    if(!a)
 92 a();
      a();
 93 return c;
    return c;
 94 }
  }
 95
 96 private static boolean a=false;
  private static boolean a=false;
 97 private static boolean b=false;
  private static boolean b=false;
 98 private static boolean c=false;
  private static boolean c=false;
 99 private static String d;
  private static String d;
100 public static String e;
  public static String e;
101 public static String f;
  public static String f;
102 public static long g=0L;
  public static long g=0L;
103 public static long h=0L;
  public static long h=0L;
104 private static CRC32 i=new CRC32();
  private static CRC32 i=new CRC32();
105 public static GregorianCalendar j;
  public static GregorianCalendar j;
106
107
 private static String cr()
  private static String cr() { // 自动生成序列号,比当前时间晚一个月
{ // 自动生成序列号,比当前时间晚一个月
108 Calendar cal=new GregorianCalendar();
    Calendar cal=new GregorianCalendar();
109 cal.add(cal.MONTH,1);
    cal.add(cal.MONTH,1);
110
111 String s="";
    String s="";
112 int year=cal.get(cal.YEAR);
    int year=cal.get(cal.YEAR);
113 int month=cal.get(cal.MONTH);
    int month=cal.get(cal.MONTH);
114 int day=cal.get(cal.DAY_OF_MONTH);
    int day=cal.get(cal.DAY_OF_MONTH);
115
116 s+=year + "/" + (month < 10 ? "0" + month : month) + "/" + (day < 10 ? "0" + day
    s+=year + "/" + (month < 10 ? "0" + month : month) + "/" + (day < 10 ? "0" + day
117 : day);
        : day);
118 s+="#oop@vip.163.com#128cw93#1a193l";
    s+="#oop@vip.163.com#128cw93#1a193l";
119
120 int l=s.indexOf('#');
    int l=s.indexOf('#');
121 int i1=s.indexOf('#',l + 1);
    int i1=s.indexOf('#',l + 1);
122 int j1=s.indexOf('#',i1 + 1);
    int j1=s.indexOf('#',i1 + 1);
123
124 String e=s.substring(l + 1,i1);
    String e=s.substring(l + 1,i1);
125 String d=s.substring(0,i1);
    String d=s.substring(0,i1);
126 String sg=s.substring(i1 + 1,j1);
    String sg=s.substring(i1 + 1,j1);
127 Long g=Long.parseLong(sg,36);
    Long g=Long.parseLong(sg,36);
128 Long h=Long.parseLong(s.substring(j1 + 1),36);
    Long h=Long.parseLong(s.substring(j1 + 1),36);
129
130 CRC32 crc=new CRC32();
    CRC32 crc=new CRC32();
131 crc.update((h % 127L + d).getBytes());
    crc.update((h % 127L + d).getBytes());
132 Long ii=crc.getValue();
    Long ii=crc.getValue();
133 StringBuffer sn=new StringBuffer(s).replace(i1 + 1,j1,Long.toString(ii,36));
    StringBuffer sn=new StringBuffer(s).replace(i1 + 1,j1,Long.toString(ii,36));
134 return sn.toString();
    return sn.toString();
135 }
  }
136 }
}
137
  关键代码处有注释,我就详细讲一下cr()。
由于Alloy的序列号的时间比当前时间晚一年以上也视作invalid,因此我在cr()中动态生成一个序列号,该序列号比当前时间晚一个月,使用bi.a()注入程序中(15行)。
111行到133行是具体的算号过程,可见“128cw93”和“1a1931”其实是两个36进制的数。
第133行把算得的校验值替换118行生成的字符串中的相应位置上的字符串,生成新的序列号。
	
posted on 2005-08-09 15:42 
^ Mustang ^ 阅读(1327) 
评论(2)  编辑  收藏  所属分类: 
破解