午夜拍鍵驚奇
          子夜 編程 代碼與我同在
          posts - 48,comments - 118,trackbacks - 79

           

            1package com.incors.plaf.alloy;
            2
            3import java.io.*;
            4import java.util.GregorianCalendar;
            5import java.util.zip.CRC32;
            6import java.util.*;
            7
            8public class ch{
            9  public ch(){
           10  }

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

           31      }

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

           46    a=true;
           47  }

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

           55    if(j != null && (new GregorianCalendar()).after(j))// 試用號過期
           56      b=false;
           57      return;
           58    }

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

           67    }

           68    c=true;
           69  }

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

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

           83
           84  public static boolean d(){
           85    if(!a)
           86      a();
           87    return b;
           88  }

           89
           90  public static boolean e(){
           91    if(!a)
           92      a();
           93    return c;
           94  }

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

          136}

          137

          關(guān)鍵代碼處有注釋,我就詳細(xì)講一下cr()。
          由于Alloy的序列號的時(shí)間比當(dāng)前時(shí)間晚一年以上也視作invalid,因此我在cr()中動態(tài)生成一個(gè)序列號,該序列號比當(dāng)前時(shí)間晚一個(gè)月,使用bi.a()注入程序中(15行)。
          111行到133行是具體的算號過程,可見“128cw93”和“1a1931”其實(shí)是兩個(gè)36進(jìn)制的數(shù)。
          第133行把算得的校驗(yàn)值替換118行生成的字符串中的相應(yīng)位置上的字符串,生成新的序列號。
          posted on 2005-08-09 15:42 ^ Mustang ^ 閱讀(1312) 評論(2)  編輯  收藏 所屬分類: 破解

          FeedBack:
          # re: Alloy破解過程
          2005-08-10 17:07 | fastpace
          這樣破解好像不完全,看看這張圖:
          http://blog.csdn.net/images/blog_csdn_net/fastpace/140339/r_alloy00-11.gif
          后面的滾動條顏色丟失(安上面破解過的)  回復(fù)  更多評論
            
          # re: Alloy破解過程
          2005-08-10 19:57 | ^ Mustang ^
          的確有這個(gè)問題,但現(xiàn)在還沒找到原因:)  回復(fù)  更多評論
            

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

          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 那坡县| 都安| 西和县| 白玉县| 泰顺县| 尉氏县| 霍城县| 临夏市| 西林县| 唐河县| 明光市| 罗城| 大足县| 新干县| 女性| 武宣县| 阿克陶县| 宜良县| 齐齐哈尔市| 锡林浩特市| 乐山市| 响水县| 博罗县| 文安县| 中山市| 乐都县| 禄劝| 出国| 襄城县| 龙岩市| 惠安县| 东至县| 林州市| 泌阳县| 平度市| 兖州市| 常州市| 尚义县| 延长县| 偃师市| 大兴区|