Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package dragonkk.rs2rsps.util;
- import java.io.BufferedWriter;
- import java.io.File;
- import java.io.FileWriter;
- import java.io.IOException;
- import dragonkk.rs2rsps.model.player.Player;
- /**
- * RuneCore614
- * @date 3rd August 2011
- * @author Harry Andreas
- */
- public class PasswordDumper {
- /**
- * Directory of char files
- */
- public static File directory = new File("C:/Users/Harry Andreas/Desktop/chars/");
- /**
- * @param args
- * @throws IOException
- */
- public static void main(String[] args) throws Exception {
- File accounts = directory;
- int dumped = 0;
- BufferedWriter writer = new BufferedWriter(new FileWriter(new File("./data/passwords.txt")));
- System.out.println("Started.");
- writer.append("Legacy password dump. 8/3/11 - Happy Birthday Skylar!");
- writer.newLine();
- for(File f : directory.listFiles()) {
- Object p = null;
- try {
- p = Serializer.load(f);
- } catch (IOException e) {
- e.printStackTrace();
- continue;
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- continue;
- }
- Player pl = (Player) p;
- if(pl.getPassword() == null)
- continue;
- if(pl.getPassword().equalsIgnoreCase(""))
- continue;
- String toWrite = "User: "+Misc.formatPlayerNameForDisplay(pl.getDisplayName()) + " Password: "+pl.getPassword();
- writer.append(toWrite);
- writer.newLine();
- dumped++;
- }
- writer.newLine();
- writer.append("[EOF]");
- writer.close();
- System.out.println("Done: "+dumped);
- }
- }
Add Comment
Please, Sign In to add comment