Advertisement
Guest User

Untitled

a guest
May 26th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.43 KB | None | 0 0
  1. package injected;
  2.  
  3. import com.sun.tools.attach.*;
  4. import java.awt.*;
  5. import javax.swing.*;
  6. import java.util.*;
  7. import java.net.*;
  8. import java.lang.reflect.*;
  9. import java.io.*;
  10.  
  11. public class main
  12. {
  13. public static void main(final String[] args) throws Exception {
  14. final File file1 = new File(Main.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
  15. System.out.println("Starting injected by Fusked mais que vcheater a casi tout fait...");
  16. try {
  17. Class.forName("com.sun.tools.attach.VirtualMachine");
  18. }
  19. catch (ClassNotFoundException var10) {
  20. System.out.println("ERROR: Il manque le tools.jar gros fdp");
  21. return;
  22. }
  23. System.out.println("Loading attach library...");
  24. extractLibrary(file1);
  25. try {
  26. System.loadLibrary("attach");
  27. }
  28. catch (Exception var11) {
  29. System.out.println("ERROR: Couldn't load attach libary!");
  30. return;
  31. }
  32. System.out.println("Attach library loaded.");
  33. System.out.println("Searching for Minecraft JVM...");
  34. for (final VirtualMachineDescriptor virtualmachinedescriptor : VirtualMachine.list()) {
  35. if (virtualmachinedescriptor.displayName().startsWith("net.minecraft.launchwrapper.Launch")) {
  36. System.out.println("Minecraft found, attaching...");
  37. final VirtualMachine virtualmachine = VirtualMachine.attach(virtualmachinedescriptor);
  38. final String s = virtualmachine.getSystemProperties().getProperty("java.version");
  39. final String s2 = System.getProperty("java.version");
  40. if (!s.equals(s2)) {
  41. System.out.println("WARN: Ta un pc trop merdique pour utiliser mon cheat ..");
  42. }
  43. System.out.println("Loading agent...");
  44. try {
  45. virtualmachine.loadAgent(file1.getAbsolutePath());
  46. }
  47. catch (Exception exception) {
  48. System.out.println("ERROR: Agent failed to load (" + exception.getMessage() + ")!");
  49. return;
  50. }
  51. System.out.println("Agent successfully loaded, detaching...");
  52. virtualmachine.detach();
  53. System.out.println("fitchi started successfully.");
  54. System.exit(0);
  55. return;
  56. }
  57. }
  58. System.out.println("Minecraft not found, exiting.");
  59. JOptionPane.showMessageDialog(null, "No Minecraft JVM found.", "fitchi", 0);
  60. }
  61.  
  62. private static void extractLibrary(final File jarFile) throws IOException {
  63. final String s = System.getProperty("os.name").toLowerCase();
  64. final boolean flag = System.getProperty("os.arch").equals("amd64") || System.getProperty("os.arch").equals("x86_64");
  65. main.OperatingSystem main$operatingsystem;
  66. if (s.indexOf("win") >= 0) {
  67. main$operatingsystem = main.OperatingSystem.WINDOWS;
  68. }
  69. else if (s.indexOf("nix") < 0 && s.indexOf("nux") < 0 && s.indexOf("aix") <= 0) {
  70. if (s.indexOf("mac") < 0) {
  71. JOptionPane.showMessageDialog(null, "Unsupported operating system '" + s + "'.", "SpookyNan", 0);
  72. return;
  73. }
  74. main$operatingsystem = Main.OperatingSystem.OSX;
  75. }
  76. else {
  77. main$operatingsystem = Main.OperatingSystem.LINUX;
  78. }
  79. System.out.println(main$operatingsystem.name() + " detected, using " + main$operatingsystem.getVmClass() + ".");
  80. try {
  81. Class.forName(main$operatingsystem.getVmClass());
  82. }
  83. catch (ClassNotFoundException var12) {
  84. System.out.println("ERROR: Couldn't load " + main$operatingsystem.getVmClass() + " class, are you using the right tools.jar file for your operating system?");
  85. return;
  86. }
  87. final String s2 = main$operatingsystem.getLibraryPath(flag);
  88. final URL url = ClassLoader.getSystemResource(s2);
  89. final File file1 = new File(jarFile.getParentFile(), s2.substring(s2.lastIndexOf("/"), s2.length()));
  90. if (!file1.exists()) {
  91. file1.deleteOnExit();
  92. final InputStream inputstream = url.openStream();
  93. final OutputStream outputstream = new BufferedOutputStream(new FileOutputStream(file1));
  94. final byte[] abyte = new byte[8192];
  95. int i;
  96. while ((i = inputstream.read(abyte)) > -1) {
  97. outputstream.write(abyte, 0, i);
  98. }
  99. outputstream.close();
  100. inputstream.close();
  101. }
  102. if (System.getProperty("java.library.path") != null) {
  103. System.setProperty("java.library.path", s2 + System.getProperty("path.separator") + System.getProperty("java.library.path"));
  104. }
  105. else {
  106. System.setProperty("java.library.path", s2);
  107. }
  108. try {
  109. final Field field = ClassLoader.class.getDeclaredField("sys_paths");
  110. field.setAccessible(true);
  111. field.set(null, null);
  112. }
  113. catch (SecurityException | IllegalArgumentException | IllegalAccessException | NoSuchFieldException ex2) {
  114. final Exception ex;
  115. final Exception var11 = ex;
  116. final Exception exception = null;
  117. exception.printStackTrace();
  118. }
  119. }
  120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement