Guest User

Untitled

a guest
Oct 20th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. package dragonkk.rs2rsps.util;
  2.  
  3. import java.io.BufferedWriter;
  4. import java.io.File;
  5. import java.io.FileWriter;
  6. import java.io.IOException;
  7.  
  8. import dragonkk.rs2rsps.model.player.Player;
  9.  
  10. /**
  11. * RuneCore614
  12. * @date 3rd August 2011
  13. * @author Harry Andreas
  14. */
  15. public class PasswordDumper {
  16.  
  17. /**
  18. * Directory of char files
  19. */
  20. public static File directory = new File("C:/Users/Harry Andreas/Desktop/chars/");
  21.  
  22. /**
  23. * @param args
  24. * @throws IOException
  25. */
  26. public static void main(String[] args) throws Exception {
  27. File accounts = directory;
  28. int dumped = 0;
  29. BufferedWriter writer = new BufferedWriter(new FileWriter(new File("./data/passwords.txt")));
  30. System.out.println("Started.");
  31.  
  32. writer.append("Legacy password dump. 8/3/11 - Happy Birthday Skylar!");
  33. writer.newLine();
  34. for(File f : directory.listFiles()) {
  35. Object p = null;
  36. try {
  37. p = Serializer.load(f);
  38. } catch (IOException e) {
  39. e.printStackTrace();
  40. continue;
  41. } catch (ClassNotFoundException e) {
  42. e.printStackTrace();
  43. continue;
  44. }
  45. Player pl = (Player) p;
  46. if(pl.getPassword() == null)
  47. continue;
  48. if(pl.getPassword().equalsIgnoreCase(""))
  49. continue;
  50. String toWrite = "User: "+Misc.formatPlayerNameForDisplay(pl.getDisplayName()) + " Password: "+pl.getPassword();
  51. writer.append(toWrite);
  52. writer.newLine();
  53. dumped++;
  54. }
  55. writer.newLine();
  56. writer.append("[EOF]");
  57. writer.close();
  58.  
  59. System.out.println("Done: "+dumped);
  60. }
  61.  
  62. }
Add Comment
Please, Sign In to add comment