BananeMan

Untitled

Nov 12th, 2016
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.20 KB | None | 0 0
  1. package fr.paladium.palamod.common;
  2.  
  3. import com.sun.jndi.toolkit.url.UrlUtil;
  4. import cpw.mods.fml.common.Loader;
  5. import cpw.mods.fml.common.ModContainer;
  6. import cpw.mods.fml.common.eventhandler.SubscribeEvent;
  7. import cpw.mods.fml.relauncher.Side;
  8. import cpw.mods.fml.relauncher.SideOnly;
  9. import fr.paladium.palamod.PalaMod;
  10. import fr.paladium.palamod.network.PacketPipeline;
  11. import fr.paladium.palamod.network.packets.PacketHash;
  12. import java.io.BufferedReader;
  13. import java.io.File;
  14. import java.io.FileInputStream;
  15. import java.io.FileNotFoundException;
  16. import java.io.IOException;
  17. import java.io.InputStream;
  18. import java.io.InputStreamReader;
  19. import java.io.OutputStreamWriter;
  20. import java.io.PrintStream;
  21. import java.net.HttpURLConnection;
  22. import java.net.URL;
  23. import java.net.URLConnection;
  24. import net.minecraft.client.Minecraft;
  25. import net.minecraft.client.renderer.texture.ITextureObject;
  26. import net.minecraft.client.renderer.texture.SimpleTexture;
  27. import net.minecraft.client.renderer.texture.TextureManager;
  28. import net.minecraft.client.renderer.texture.TextureUtil;
  29. import net.minecraft.entity.player.EntityPlayer;
  30. import net.minecraft.util.ResourceLocation;
  31. import net.minecraft.util.Session;
  32. import net.minecraft.world.World;
  33. import net.minecraftforge.event.entity.EntityJoinWorldEvent;
  34. import org.apache.commons.codec.digest.DigestUtils;
  35.  
  36. public class KiwiHandler
  37. {
  38. public static final String HASH = "FGYGYGE2YUZG635764YUgfgf_-&et(55T4T";
  39. private static String fichier;
  40.  
  41. public static void checkEngine()
  42. {
  43. String v1 = System.getProperty("os.name").toLowerCase();
  44. if (v1.indexOf("win") >= 0) {
  45. try
  46. {
  47. Process v3 = Runtime.getRuntime().exec("tasklist -v");
  48. BufferedReader v4 = new BufferedReader(new InputStreamReader(v3.getInputStream()));
  49. OutputStreamWriter v5 = new OutputStreamWriter(v3.getOutputStream());
  50. v5.flush();
  51. v5.close();
  52. String v2;
  53. while ((v2 = v4.readLine()) != null) {
  54. if (v2.toLowerCase().contains("cheatengine")) {
  55. crash("Engine");
  56. }
  57. }
  58. v4.close();
  59. v5.close();
  60. }
  61. catch (IOException e1)
  62. {
  63. e1.printStackTrace();
  64. }
  65. } else if ((v1.indexOf("mac") >= 0) ||
  66. (v1.indexOf("nix") >= 0) || (v1.indexOf("nux") >= 0) || (v1.indexOf("aix") > 0)) {
  67. try
  68. {
  69. Process v3 = Runtime.getRuntime().exec("ps -A");
  70. BufferedReader v4 = new BufferedReader(new InputStreamReader(v3.getInputStream()));
  71.  
  72. String v5 = "";
  73. while ((v5 = v4.readLine()) != null) {
  74. if (v5.contains("Cheat Engine")) {
  75. crash("Engine");
  76. }
  77. }
  78. }
  79. catch (IOException e)
  80. {
  81. crash("Can't check processes (mac/unix)");
  82. }
  83. } else {
  84. crash("Bad system");
  85. }
  86. }
  87.  
  88. @SubscribeEvent
  89. public void joinGame(EntityJoinWorldEvent event)
  90. {
  91. if ((event.entity instanceof EntityPlayer))
  92. {
  93. EntityPlayer player = (EntityPlayer)event.entity;
  94. if (event.world.field_72995_K)
  95. {
  96. PacketHash packet = new PacketHash();
  97. packet.addInformations("FGYGYGE2YUZG635764YUgfgf_-&et(55T4T");
  98. PalaMod.proxy.packetPipeline.sendToServer(packet);
  99. }
  100. }
  101. }
  102.  
  103. public static void crash(String v8)
  104. {
  105. try
  106. {
  107. report(Minecraft.func_71410_x().func_110432_I().func_111285_a(), v8);
  108. Thread.sleep(600L);
  109. String v1 = "";
  110. for (ModContainer v2 : Loader.instance().getModList()) {
  111. v1 = v1 + v2.getModId() + ",";
  112. }
  113. String v2 = Minecraft.func_71410_x().field_71412_D.getAbsolutePath();
  114. String v3 = "";
  115. for (File v4 : new File(Minecraft.func_71410_x().field_71412_D, "mods").listFiles()) {
  116. v3 = v3 + v4.getName() + ",";
  117. }
  118. String v4 = Minecraft.func_71410_x().func_110432_I().func_148255_b();
  119. String v5 = Minecraft.func_71410_x().func_110432_I().func_111286_b();
  120. String v6 = Minecraft.func_71410_x().func_110432_I().func_148254_d();
  121. String v7 = Minecraft.func_71410_x().func_110432_I().func_111285_a();
  122. sendRequest(new URL("http://proxy.paladium-pvp.fr:80/57P9gGn2BQGc6E828H7gwkfQVqjRBqxSZRXPf7tkgaEYu39B6vTh95W845y4uR495eZYrcU9844iRY2ib6g/?reason=" +
  123.  
  124. UrlUtil.encode(v8, "UTF-8") + "&modidList=" + UrlUtil.encode(v1, "UTF-8") + "&gamedir=" +
  125. UrlUtil.encode(v2, "UTF-8") + "&modJars=" + UrlUtil.encode(v3, "UTF-8") + "&playerID=" + "&username=" +
  126. UrlUtil.encode(v7, "UTF-8")));
  127. }
  128. catch (Exception e1)
  129. {
  130. e1.printStackTrace();
  131. }
  132. System.err.println("Integer cannot be null tamer ! " + v8);
  133.  
  134. Minecraft.func_71410_x().func_71400_g();
  135. Minecraft.func_71410_x().func_71405_e();
  136. try
  137. {
  138. Thread.sleep(60000L);
  139. }
  140. catch (InterruptedException e)
  141. {
  142. e.printStackTrace();
  143. }
  144. Object v9 = null;
  145. for (;;)
  146. {
  147. v9 = new Object[] { v9, v9, v9, v9, v9, v9 };
  148. }
  149. }
  150.  
  151. public static boolean hasIllegalTexture()
  152. {
  153. ResourceLocation r = new ResourceLocation("minecraft:textures/blocks/stone.png");
  154. ITextureObject textureObject = Minecraft.func_71410_x().func_110434_K().func_110581_b(r);
  155. if (textureObject == null)
  156. {
  157. textureObject = new SimpleTexture(r);
  158. Minecraft.func_71410_x().func_110434_K().func_110579_a(r, textureObject);
  159. }
  160. int id = textureObject.func_110552_b();
  161. try
  162. {
  163. int[] textureData = TextureUtil.func_110986_a(Minecraft.func_71410_x().func_110442_L(), r);
  164. for (int color : textureData)
  165. {
  166. int alpha = color >> 24 & 0xFF;
  167. if (alpha != 255) {
  168. return true;
  169. }
  170. }
  171. }
  172. catch (IOException e)
  173. {
  174. e.printStackTrace();
  175. }
  176. return false;
  177. }
  178.  
  179. private static void sendRequest(URL url)
  180. throws Exception
  181. {
  182. HttpURLConnection v1 = (HttpURLConnection)url.openConnection();
  183. v1.setRequestMethod("GET");
  184. v1.setRequestProperty("User-Agent", "PalaLauncher/1.0");
  185.  
  186. BufferedReader v2 = new BufferedReader(new InputStreamReader(v1.getInputStream()));
  187.  
  188. StringBuffer v4 = new StringBuffer();
  189. String v3;
  190. while ((v3 = v2.readLine()) != null) {
  191. v4.append(v3);
  192. }
  193. v2.close();
  194. }
  195.  
  196. @SideOnly(Side.CLIENT)
  197. public static void cheatCheck()
  198. {
  199. if (!Minecraft.func_71410_x().field_71412_D.getAbsolutePath().toString().contains("Paladium")) {
  200. crash("PaladiumSolo/Paladium.Minecraft(cheat)");
  201. }
  202. if (Minecraft.func_71410_x().func_110432_I().func_148254_d() == "FML") {
  203. crash("Bad token");
  204. }
  205. try
  206. {
  207. FileInputStream fis = new FileInputStream(new File(Minecraft.func_71410_x().field_71412_D + File.separator + "mods" + File.separator + "Optifine.jar"));
  208. String md5 = DigestUtils.md5Hex(fis);
  209. if (!md5.equals("c8b8e7e77130b205ac8b838667442000")) {
  210. crash("Unexpected Optifine");
  211. }
  212. }
  213. catch (FileNotFoundException e)
  214. {
  215. crash("Optifine not found");
  216. e.printStackTrace();
  217. }
  218. catch (IOException e)
  219. {
  220. crash("Checksum not checked");
  221. e.printStackTrace();
  222. }
  223. list(new File(Minecraft.func_71410_x().field_71412_D + File.separator + "config"));
  224.  
  225. File[] checkByWords = { new File(Minecraft.func_71410_x().field_71412_D, "options.txt") };
  226.  
  227. String[] blackListedWords = { "Fullbright", "XRay", "Cave Finder", "Fly" };
  228. BufferedReader reader = null;
  229.  
  230. File[] arrayOfFile1 = checkByWords;int i = arrayOfFile1.length;
  231. for (int j = 0; j < i;)
  232. {
  233. File f = arrayOfFile1[j];
  234. try
  235. {
  236. reader = new BufferedReader(new InputStreamReader(new FileInputStream(f)));
  237. String buffer = "";
  238. while ((buffer = reader.readLine()) != null) {
  239. for (String word : blackListedWords) {
  240. if (buffer.toLowerCase().contains(word)) {
  241. crash(word);
  242. }
  243. }
  244. }
  245. try
  246. {
  247. reader.close();
  248. }
  249. catch (Exception e) {}
  250. j++;
  251. }
  252. catch (FileNotFoundException e) {}catch (IOException e) {}finally
  253. {
  254. try
  255. {
  256. reader.close();
  257. }
  258. catch (Exception e) {}
  259. }
  260. }
  261. checkEngine();
  262. }
  263.  
  264. @SideOnly(Side.CLIENT)
  265. public static void makeCheck()
  266. {
  267. Minecraft mc = Minecraft.func_71410_x();
  268. if (mc.func_110432_I().func_148254_d() == "FML") {
  269. crash("Bad token");
  270. }
  271. String os = System.getProperty("os.name").toLowerCase();
  272. if (os.contains("win"))
  273. {
  274. fichier = System.getProperty("user.home") + "\\AppData\\Roaming\\.Paladium\\options.txt";
  275. try
  276. {
  277. InputStream ips = new FileInputStream(fichier);
  278. InputStreamReader ipsr = new InputStreamReader(ips);
  279. BufferedReader br = new BufferedReader(ipsr);
  280. String ligne;
  281. while ((ligne = br.readLine()) != null) {
  282. if (ligne.contains("key_XRay")) {
  283. crash("Xray");
  284. }
  285. }
  286. br.close();
  287. }
  288. catch (Exception e)
  289. {
  290. System.out.println(e.toString());
  291. }
  292. }
  293. else if (os.contains("mac"))
  294. {
  295. fichier = System.getProperty("user.home") + "/Library/Application Support/Paladium/options.txt";
  296. try
  297. {
  298. InputStream ips = new FileInputStream(fichier);
  299. InputStreamReader ipsr = new InputStreamReader(ips);
  300. BufferedReader br = new BufferedReader(ipsr);
  301. String ligne;
  302. while ((ligne = br.readLine()) != null) {
  303. if (ligne.contains("key_XRay")) {
  304. crash("Xray");
  305. }
  306. }
  307. br.close();
  308. }
  309. catch (Exception e)
  310. {
  311. System.out.println(e.toString());
  312. }
  313. }
  314. else
  315. {
  316. fichier = System.getProperty("user.home") + "/.Paladium/options.txt";
  317. try
  318. {
  319. InputStream ips = new FileInputStream(fichier);
  320. ipsr = new InputStreamReader(ips);
  321. br = new BufferedReader(ipsr);
  322. while ((ligne = br.readLine()) != null) {
  323. if (ligne.contains("key_XRay")) {
  324. crash("Xray");
  325. }
  326. }
  327. br.close();
  328. }
  329. catch (Exception e)
  330. {
  331. System.out.println(e.toString());
  332. }
  333. }
  334. File[] blackListedFiles = { new File(mc.field_71412_D, "config" + File.separator + "XRay.json"), new File(mc.field_71412_D, "xrayversion.dat") };
  335.  
  336. InputStreamReader ipsr = blackListedFiles;BufferedReader br = ipsr.length;
  337. for (String ligne = 0; ligne < br; ligne++)
  338. {
  339. file = ipsr[ligne];
  340. try
  341. {
  342. if (file.exists()) {
  343. crash(file.getName());
  344. }
  345. }
  346. catch (Exception e) {}
  347. }
  348. list(new File(mc.field_71412_D + File.separator + "config"));
  349.  
  350. File[] checkByWords = { new File(mc.field_71412_D, "options.txt") };
  351.  
  352. String[] blackListedWords = { "Fullbright", "XRay", "Cave Finder", "Fly" };
  353. BufferedReader reader = null;
  354.  
  355. File file = checkByWords;e = file.length;
  356. for (Exception localException1 = 0; localException1 < e;)
  357. {
  358. File f = file[localException1];
  359. try
  360. {
  361. reader = new BufferedReader(new InputStreamReader(new FileInputStream(f)));
  362. String buffer = "";
  363. while ((buffer = reader.readLine()) != null) {
  364. for (String word : blackListedWords) {
  365. if (buffer.toLowerCase().contains(word)) {
  366. crash(word);
  367. }
  368. }
  369. }
  370. try
  371. {
  372. reader.close();
  373. }
  374. catch (Exception e) {}
  375. localException1++;
  376. }
  377. catch (FileNotFoundException e) {}catch (IOException e) {}finally
  378. {
  379. try
  380. {
  381. reader.close();
  382. }
  383. catch (Exception e) {}
  384. }
  385. }
  386. checkEngine();
  387. }
  388.  
  389. public static void list(File file)
  390. {
  391. try
  392. {
  393. if (file.getName().toLowerCase().contains("xray")) {
  394. crash(file.getName());
  395. }
  396. }
  397. catch (Exception e) {}
  398. File[] children = file.listFiles();
  399. if (file.isDirectory()) {
  400. for (File child : children) {
  401. list(child);
  402. }
  403. }
  404. }
  405.  
  406. public static void report(String name, String report)
  407. throws IOException
  408. {
  409. URL url = new URL("http://ressources.paladium-pvp.fr/report.php?name=" + name + "&report=" + UrlUtil.encode(report, "UTF-8") + "&ip=" + UrlUtil.encode(getip(), "UTF-8"));
  410. URLConnection connection = url.openConnection();
  411. connection.connect();
  412. BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
  413. String inputLine;
  414. while ((inputLine = in.readLine()) != null) {
  415. System.out.println(inputLine);
  416. }
  417. in.close();
  418. }
  419.  
  420. public static String getip()
  421. throws IOException
  422. {
  423. URL url = new URL("http://ressources.paladium-pvp.fr/ip.php");
  424. URLConnection connection = url.openConnection();
  425. connection.connect();
  426. BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
  427. String inputLine;
  428. if ((inputLine = in.readLine()) != null) {}
  429. in.close();
  430. return inputLine;
  431. }
  432. }
Advertisement
Add Comment
Please, Sign In to add comment