Advertisement
BaSs_HaXoR

NetBean IntelliJ Keygen Source [JAVA]

Feb 4th, 2015
1,162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.55 KB | None | 0 0
  1. //#############################################################################################################################
  2. /*
  3. @Project: JetBrains IntelliJ Keygen JAVA Source Code
  4. @Author: Grigala (or petergi on Github)
  5. @OP: https://github.com/petergi/Jetbrains-IntelliJ-IDEA-Key-Generator
  6. @HowTo:
  7. #) Note* keygen is the name of the java file you create with the source code below.
  8. #1) compile as "keygen.java".
  9. #2) Open up CMD, and navigate to Java JDK/bin/ directory
  10. #3) In CMD run: (CMD) javac keygen.java
  11. #4) java keygen [Your Username]
  12. #) Note* Above just put your name in place of "[Your Username]", so ex.: java keygen BaSs
  13. */
  14.  
  15. //ATTENTION!: bkey[1] = 14;//version\\ In the following code, change the 14 to the appropriate version of IntelliJ (for byte 1 of the bytearray).
  16. //#############################################################################################################################
  17. import java.math.BigInteger;
  18. import java.util.Date;
  19. import java.util.Random;
  20. import java.util.zip.CRC32;
  21.  
  22. public class keygen
  23. {
  24.   /**
  25.   * @param s
  26.   * @param i
  27.   * @param bytes
  28.   * @return
  29.   */
  30.   public static short getCRC(String s, int i, byte bytes[])
  31.   {
  32.       CRC32 crc32 = new CRC32();
  33.       if (s != null)
  34.       {
  35.           for (int j = 0; j < s.length(); j++)
  36.           {
  37.               char c = s.charAt(j);
  38.               crc32.update(c);
  39.           }
  40.       }
  41.       crc32.update(i);
  42.       crc32.update(i >> 8);
  43.       crc32.update(i >> 16);
  44.       crc32.update(i >> 24);
  45.       for (int k = 0; k < bytes.length - 2; k++)
  46.       {
  47.           byte byte0 = bytes[k];
  48.           crc32.update(byte0);
  49.       }
  50.       return (short) (int) crc32.getValue();
  51.   }
  52.  
  53.   /**
  54.   * @param biginteger
  55.   * @return String
  56.   */
  57.   public static String encodeGroups(BigInteger biginteger)
  58.   {
  59.       BigInteger beginner1 = BigInteger.valueOf(0x39aa400L);
  60.       StringBuilder sb = new StringBuilder();
  61.       for (int i = 0; biginteger.compareTo(BigInteger.ZERO) != 0; i++)
  62.       {
  63.           int j = biginteger.mod(beginner1).intValue();
  64.           String s1 = encodeGroup(j);
  65.           if (i > 0)
  66.           {
  67.               sb.append("-");
  68.           }
  69.           sb.append(s1);
  70.           biginteger = biginteger.divide(beginner1);
  71.       }
  72.       return sb.toString();
  73.   }
  74.  
  75.   /**
  76.   * @param i
  77.   * @return
  78.   */
  79.   public static String encodeGroup(int i)
  80.   {
  81.       StringBuilder sb = new StringBuilder();
  82.       for (int j = 0; j < 5; j++)
  83.       {
  84.           int k = i % 36;
  85.           char c;
  86.           if (k < 10)
  87.           {
  88.               c = (char) (48 + k);
  89.           }
  90.           else
  91.           {
  92.               c = (char) ((65 + k) - 10);
  93.           }
  94.           sb.append(c);
  95.           i /= 36;
  96.       }
  97.       return sb.toString();
  98.   }
  99.  
  100.   /**
  101.   * @param name
  102.   * @param days
  103.   * @param id
  104.   * @param prtype
  105.   * @return
  106.   */
  107.   public static String MakeKey(String name, int days, int id)
  108.   {
  109.       id %= 100000;
  110.       byte bkey[] = new byte[12];
  111.       bkey[0] = (byte) 1; // Product type: IntelliJ IDEA is 1
  112.       bkey[1] = 14; // version
  113.       Date d = new Date();
  114.       long ld = (d.getTime() >> 16);
  115.       bkey[2] = (byte) (ld & 255);
  116.       bkey[3] = (byte) ((ld >> 8) & 255);
  117.       bkey[4] = (byte) ((ld >> 16) & 255);
  118.       bkey[5] = (byte) ((ld >> 24) & 255);
  119.       days &= 0xffff;
  120.       bkey[6] = (byte) (days & 255);
  121.       bkey[7] = (byte) ((days >> 8) & 255);
  122.       bkey[8] = 105;
  123.       bkey[9] = -59;
  124.       bkey[10] = 0;
  125.       bkey[11] = 0;
  126.       int w = getCRC(name, id % 100000, bkey);
  127.       bkey[10] = (byte) (w & 255);
  128.       bkey[11] = (byte) ((w >> 8) & 255);
  129.       BigInteger pow = new BigInteger("89126272330128007543578052027888001981", 10);
  130.       BigInteger mod = new BigInteger("86f71688cdd2612ca117d1f54bdae029", 16);
  131.       BigInteger k0 = new BigInteger(bkey);
  132.       BigInteger k1 = k0.modPow(pow, mod);
  133.       String s0 = Integer.toString(id);
  134.       String sz = "0";
  135.       while (s0.length() != 5)
  136.       {
  137.           s0 = sz.concat(s0);
  138.       }
  139.       s0 = s0.concat("-");
  140.       String s1 = encodeGroups(k1);
  141.       s0 = s0.concat(s1);
  142.       return s0;
  143.   }
  144.  
  145.   public static void main(String[] args)
  146.   {
  147.       if (args.length == 0)
  148.       {
  149.           System.err.printf("*** Usage: %s name%n", keygen.class.getCanonicalName());
  150.           System.exit(1);
  151.       }
  152.       Random r = new Random();
  153.       System.out.println(MakeKey(args[0], 0, r.nextInt(100000)));
  154.   }
  155. }
  156. //#############################################################################################################################
  157. //BaSs_HaXoR
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement