Exetools  

Go Back   Exetools > General > Source Code

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 04-25-2014, 13:23
kheung kheung is offline
Friend
 
Join Date: Feb 2002
Location: China
Posts: 17
Rept. Given: 1
Rept. Rcvd 2 Times in 1 Post
Thanks Given: 0
Thanks Rcvd at 3 Times in 1 Post
kheung Reputation: 2
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));
  }
}
Reply With Quote
The Following 2 Users Gave Reputation+1 to kheung For This Useful Post:
papi (05-02-2014)
  #2  
Old 04-25-2014, 14:30
Kla$ Kla$ is offline
VIP
 
Join Date: Mar 2013
Posts: 112
Rept. Given: 89
Rept. Rcvd 76 Times in 28 Posts
Thanks Given: 54
Thanks Rcvd at 23 Times in 14 Posts
Kla$ Reputation: 76
please if you compile it is not difficult
thank you
Reply With Quote
  #3  
Old 05-03-2014, 08:41
droopy
 
Posts: n/a
Thanks. I will be great if you upload both code and compiled version.
Thanks!
Reply With Quote
  #4  
Old 05-04-2014, 22:47
giv's Avatar
giv giv is offline
VIP
 
Join Date: Jan 2011
Location: Romania
Posts: 1,657
Rept. Given: 801
Rept. Rcvd 1,283 Times in 561 Posts
Thanks Given: 226
Thanks Rcvd at 562 Times in 240 Posts
giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299
Quote:
Originally Posted by droopy View Post
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.
Reply With Quote
  #5  
Old 11-28-2014, 06:45
memo-5 memo-5 is offline
Friend
 
Join Date: Sep 2005
Posts: 80
Rept. Given: 15
Rept. Rcvd 3 Times in 3 Posts
Thanks Given: 60
Thanks Rcvd at 11 Times in 6 Posts
memo-5 Reputation: 3
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?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On


Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Audio demo version - any tips for patching a driver? an0rma1 General Discussion 7 03-11-2018 08:32


All times are GMT +8. The time now is 17:05.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )