Exetools

Exetools (https://forum.exetools.com/index.php)
-   Source Code (https://forum.exetools.com/forumdisplay.php?f=46)
-   -   Keymaker for JxB v1.5 demo version (Windows) (https://forum.exetools.com/showthread.php?t=15746)

kheung 04-25-2014 13:23

Keymaker for JxB v1.5 demo version (Windows)
 
Demo version download
Code:

import java.io.*;
import java.lang.Runtime;
import java.util.Scanner;
import java.nio.ByteBuffer;
import java.security.*;
import java.math.*;

class MakeKey
{
  private static String getSN()
  {
    String s = null;
    Runtime runtime = Runtime.getRuntime();
    Process process;
    try {
      String as[] = {"wmic", "bios", "get", "serialnumber"};
      process = runtime.exec(as);
    } catch(IOException _ex) {
      return null;
    }

    Scanner scanner = new Scanner(process.getInputStream());
    while(scanner.hasNext()) {
      if("SerialNumber".equals(scanner.next())) {
        s = scanner.next().trim();
        break;
      }
    }

    scanner.close();

    return s;
  }

  private static int sum(int i)
  {
    int j = 0;
    for(; i > 0; i >>= 4)
      j += i & 0xf;

    return j % 10;
  }

  private static byte[] reverseBytes(byte ab[])
  {
    byte [] aout = new byte[ab.length];
    for(int i=0; i < ab.length; ++i)
      aout[i] = ab[ab.length -i - 1];
    return aout;
  }

  private static String getKey(long machineId, long unixTime)
  {
    int i = (int)(machineId & -1);
    int j = (int)(machineId >> Integer.SIZE & -1);
    int i1 = i + 0xf5ef08cb + 0x11223344 & -1;
    int j1 = (j - 0xbb87db7) + 0x55667788 & Integer.MAX_VALUE;

    ByteBuffer bb = ByteBuffer.allocateDirect(8);
    bb.putInt(j1);
    bb.putInt(i1);
    bb.rewind();
    long l = bb.getLong();
    int d = (int)unixTime ^ 0x56739acd;

    return String.format("%dZ%d%d", l, d, sum(d));
  }

  public static void main(String [ ] args)
  {
    long machineId = 0;
    String sn = getSN();

    try {
      MessageDigest md = MessageDigest.getInstance("MD5");
      byte[] ba = reverseBytes(md.digest(sn.getBytes()));
      ByteBuffer bb = ByteBuffer.allocateDirect(ba.length);

      bb.put(ba);
      bb.rewind();
      machineId = bb.getLong(Long.SIZE / Byte.SIZE);
    } catch (Exception e) {
      System.out.println("Error: " + e);
    }
    System.out.println("Machine Serial: " + sn);
    long unixTime = System.currentTimeMillis() / 1000L + 86400 * 365 * 3 - 86400 * 13;
    System.out.println("Demo Key: " + getKey(machineId, unixTime));
  }
}


Kla$ 04-25-2014 14:30

please if you compile it is not difficult
thank you

droopy 05-03-2014 08:41

Thanks. I will be great if you upload both code and compiled version.
Thanks!

giv 05-04-2014 22:47

Quote:

Originally Posted by droopy (Post 91185)
Thanks. I will be great if you upload both code and compiled version.
Thanks!

Better not.
This is "source code" area after all.
I think you arrive in wrong forum.
;)

memo-5 11-28-2014 06:45

ok I am not a Java guy, so I converted the code into c#. running the program and getting the key was easy, but unfortunately the key didn't work, are there any body can confirm that the produced demo key works for him?


All times are GMT +8. The time now is 04:02.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX