package test;



import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author tom
 *
 */
public class CrackMyEclipse6 {

	/**
	 *
	 *	获取用户输入
	 *
	 */
	private static String inputString() {
		BufferedReader bufferedreader = new BufferedReader(
				new InputStreamReader(System.in));
		String s = null;
		try {
			s = bufferedreader.readLine();
		} catch (IOException ioexception) {
			ioexception.printStackTrace();
		}
		return s;
	}


	static String License_Name = " License Name  :";
	static String License_Key =  " License Key   :";
	static String MyEclipse_Version_6_0 = "6.0";

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		String username = "abc";

		System.out.println(" /////////////////////////////////////////");
		System.out.println(" //                                     //");
		System.out.println(" // My Eclipse IDE v0.10 Keygen For 6.0 //");
		System.out.println(" // Version: 0.10                       //");
		System.out.println(" // Author tom                          //");
		System.out.println(" // Tools: Eclipse3.3                   //");
		System.out.println(" //                                     //");
		System.out.println(" /////////////////////////////////////////");

		while( true ){

			System.out.print(License_Name);
			username = inputString();
			if(username==null || username.trim().equals("")){
			    System.out.println("\"" + License_Name.substring(0,License_Name.length()-1).trim()  + "\" "+ "is Empty. Please input again(input 'exit' Program is End.).");
			}else{
			       if(username.trim().equalsIgnoreCase("exit")){
			         System.out.println(" Exit... ... ");
			         System.exit( 0 );
			       }else
			         break;
			}
		}

		/**
		 * FIXME
		 * Ver0.5中将加入对6.0以下版本的支持
		 */
		License_Key += getLicenseKey( MyEclipse_Version_6_0,username );
		System.out.println( License_Key );

	}


	/**
	 * 将字符转换成[0~9][a~z][A~Z]的ASCII码
	 * @param s
	 * @return
	 */
    private static String convert(String s)
    {
        if(s == null || s.length() == 0)
            return s;
        byte abyte0[] = s.getBytes();
        char ac[] = new char[s.length()];
        int i = 0;
        for(int k = abyte0.length; i < k; i++){
            int j = abyte0[i];
            if(j >= 48 && j <= 57)
                j = ((j - 48) + 5) % 10 + 48;
            else
            if(j >= 65 && j <= 90)
                j = ((j - 65) + 13) % 26 + 65;
            else
            if(j >= 97 && j <= 122)
                j = ((j - 97) + 13) % 26 + 97;
            ac[i] = (char)j;
        }
        return String.valueOf(ac);
    }

    /**
     * 计算字符串散列值
     * @param s
     * @return
     */
    private static int CalculateHash(String s)
    {
        int i = 0;
        char ac[] = s.toCharArray();
        int j = 0;
        for(int k = ac.length; j < k; j++)
            i = 31 * i + ac[j];
        return Math.abs(i);
    }

    private static String getLicenseKey( String MyeclipseVersion,String username )
    {
    	String key = "";
		String strCode = "";
		if( MyeclipseVersion.equals( MyEclipse_Version_6_0 )){
			strCode = username.substring(0,1);
			strCode += "Y";  // "T"为试用版   "Y"为专业版
			strCode += "E3MP"; // E3MP针对Eclipse3   E2MY 针对Eclipse2
			strCode += "10" ; //>3
			strCode += "12-456"; //填写任意数字,但第三个字符位应该为"-"
			strCode += "121231 "; //有效期《20090903》 随意填<例如:990903>    格式<XX年XX月XX日>最后一定加一个空格
			int j = CalculateHash((new StringBuilder(String.valueOf(strCode))).append("Decompiling this copyrighted software is a violation of both your license agreement and the Digital Millenium Copyright Act of 1998 (http://www.loc.gov/copyright/legislation/dmca.pdf). Under section 1204 of the DMCA, penalties range up to a $500,000 fine or up to five years imprisonment for a first offense. Think about it; pay for a license, avoid prosecution, and feel better about yourself.").append(username).toString());
			strCode = strCode + Integer.toString( j );
			key = convert( strCode );
		}
		return key;
    }
}

//flowbyte.cn
//sLR8ZC-855575-66525457680638618
最近下载更多
eagle1  LV1 2019年7月21日
m608072  LV1 2017年7月17日
菜鸟战斗  LV23 2013年7月9日
最近浏览更多
开发哈哈 2022年3月1日
暂无贡献等级
不嘻嘻  LV8 2021年5月31日
ylz12306  LV2 2020年6月25日
东风风神发顺丰  LV2 2020年2月20日
eagle1  LV1 2019年7月21日
1211413075  LV14 2019年6月1日
小米粒  LV1 2019年5月5日
chenyiiqng  LV5 2018年8月2日
浊涧一壶酒 2018年6月20日
暂无贡献等级
aifers  LV2 2018年4月11日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友