Skip to content

Instantly share code, notes, and snippets.

@jdeng
Created September 29, 2014 00:02
Show Gist options
  • Save jdeng/8148f37ac560b6c5e5de to your computer and use it in GitHub Desktop.
Save jdeng/8148f37ac560b6c5e5de to your computer and use it in GitHub Desktop.
Pass
import java.util.Map;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.io.*;
public class Pass
{
public static void main(String[] arg)
{
try {
Map m1 = (Map)new ObjectInputStream(new FileInputStream("./systemInfo.cfg")).readObject();
Map m2 = (Map)new ObjectInputStream(new FileInputStream("./CompatibleInfo.cfg")).readObject();
String token = (String)m2.get(258) + (Integer)m1.get(1);
System.out.println("token:" + token);
MessageDigest m = MessageDigest.getInstance("MD5");
byte[] data = token.getBytes();
m.update(data,0,data.length);
BigInteger i = new BigInteger(1,m.digest());
String pass = String.format("%1$032x", i).substring(0,7);
System.out.println("pass:" + pass);
}
catch (Exception e)
{
System.out.println("failed:");
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment