Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.48 KB | None | 0 0
  1. import java.lang.reflect.Field;
  2.  
  3. import java.lang.reflect.InvocationTargetException;
  4. import java.lang.reflect.Method;
  5. import java.util.Scanner;
  6.  
  7. import com.client.Client;
  8. import com.client.Identity;
  9. import com.client.Stream;
  10.  
  11. public class Program {
  12.  
  13. // private static aG stream;
  14.  
  15. public static void main(String[] args) throws NoSuchFieldException, SecurityException, IllegalArgumentException,
  16. IllegalAccessException, InvocationTargetException, NoSuchMethodException, InterruptedException {
  17.  
  18. Thread t = new Thread(() -> {
  19. Client.main(null);
  20. });
  21. t.start();
  22.  
  23. while (Client.getInstance() == null) {
  24. Thread.sleep(100);
  25. }
  26.  
  27. Scanner myObj = new Scanner(System.in); // Create a Scanner object
  28. Client client = Client.getInstance();
  29.  
  30. while (true) {
  31. try {
  32. System.out.println("Enter Command:");
  33. String[] commandData = myObj.nextLine().split(" ");
  34. startCommand(commandData, client);
  35. } catch (Exception e) {
  36. e.printStackTrace();
  37. }
  38. }
  39. }
  40.  
  41. public static long encodeName(String s) {
  42. long l = 0L;
  43. for (int i = 0; i < s.length() && i < 12; i++) {
  44. char c = s.charAt(i);
  45. l *= 37L;
  46. if (c >= 'A' && c <= 'Z') {
  47. l += 1 + c - 65;
  48. } else if (c >= 'a' && c <= 'z') {
  49. l += 1 + c - 97;
  50. } else if (c >= '0' && c <= '9') {
  51. l += 27 + c - 48;
  52. }
  53. }
  54. while (l % 37L == 0L && l != 0L) {
  55. l /= 37L;
  56. }
  57. return l;
  58. }
  59.  
  60. private static void startCommand(String[] commandData, Client c) throws NoSuchFieldException, SecurityException,
  61. IllegalArgumentException, IllegalAccessException, InterruptedException {
  62.  
  63. Stream stream = c.stream;
  64. switch (commandData[0]) {
  65. case "setCC":
  66. stream.createFrame(101);
  67. stream.writeWordBigEndian(3);
  68. for (int i1 = 0; i1 < 7; i1++)
  69. stream.writeWordBigEndian(222);
  70. for (int l1 = 0; l1 < 5; l1++)
  71. stream.writeWordBigEndian(222);
  72. return;
  73.  
  74. case "spawn":
  75. System.out.println(Client.myPlayer.x);
  76. Field field = Client.class.getDeclaredField("baseX");
  77. field.setAccessible(true);
  78. Field field2 = Client.class.getDeclaredField("baseY");
  79. field2.setAccessible(true);
  80. int baseX = (int) field.get(null);
  81. int baseY = (int) field2.get(null);
  82.  
  83. int x = baseX + (Client.myPlayer.x - 6 >> 7);
  84. int y = baseY + (Client.myPlayer.y - 6 >> 7);
  85. c.addObject(Integer.parseInt(commandData[1]), x, y, 0, 10, 0);
  86. /*
  87. * for (int i = -50; i < 80; i++) { stream.S(57); stream.af(i); stream.af(i);
  88. * stream.ae(i); stream.af(i); } System.out.println("THIS");
  89. */
  90. return;
  91.  
  92. case "error":
  93. /*
  94. * stream.S(60); stream.T("f".length()); stream.m("f");
  95. * System.out.println("THIS2");
  96. */
  97. return;
  98.  
  99. case "neg":
  100. /*
  101. * String inputString = "www.google.com"; stream.S(5); stream.T(-20);
  102. * stream.m(inputString.substring(1)); System.out.println("NEGGED");
  103. */
  104. return;
  105.  
  106. case "sendPm":
  107.  
  108. stream.createFrame(126);
  109. stream.writeWordBigEndian(0);
  110. int k = stream.currentOffset;
  111. stream.writeQWord(500);
  112.  
  113. for (int i = 0; i < 500; i++) {
  114. stream.writeWordBigEndian(k);
  115. }
  116.  
  117. stream.writeBytes(stream.currentOffset - k);
  118.  
  119. // for (int i = 0; i < 5; i++) {
  120. // for (bb player : c.V) {
  121. // if (player == null) {
  122. // continue;
  123. // }
  124. // Field field = bb.class.getDeclaredField("ar");
  125. // String name = (String) field.get(player);
  126. // System.out.println("Send PM to " + name);
  127. // Client.C.a(126);
  128. // Client.C.b(0);
  129. // int i2 = c.E.b;
  130. // Client.C.a(encodeName(name));
  131. // cq.a("Hello World", c.E);
  132. // c.E.h(c.E.b - i2);
  133. // }
  134. // }
  135. return;
  136.  
  137. case "itemonnpc":
  138. for (int i = 0; i < 20; i++) {
  139. /*
  140. * Client.C.a(185); Client.C.f(2471);
  141. */
  142. }
  143. return;
  144.  
  145. case "setMac":
  146. Field mac = Client.class.getDeclaredField("macAddress");
  147. mac.setAccessible(true);
  148. mac.set(c, "Lmao");
  149. System.out.println(mac.get(c).toString());
  150. Identity.identityKey = "12";
  151. System.out.println("THIS2");
  152. return;
  153. case "masstrade":
  154.  
  155. while (true) {
  156. Field players = Client.class.getDeclaredField("playerIndices");
  157. players.setAccessible(true);
  158. int[] playerIds = (int[]) players.get(c);
  159. for (int i = 0; i < playerIds.length; i++) {
  160. if (playerIds[i] != 0) {
  161. try {
  162.  
  163. stream.createFrame(39);
  164. stream.method431(playerIds[i]);
  165. } catch (Exception e) {
  166. e.printStackTrace();
  167. }
  168. }
  169. }
  170. Thread.sleep(1000);
  171. }
  172.  
  173. }
  174. }
  175.  
  176. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement