Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.paladium.palamod.common;
- import com.sun.jndi.toolkit.url.UrlUtil;
- import cpw.mods.fml.common.Loader;
- import cpw.mods.fml.common.ModContainer;
- import cpw.mods.fml.common.eventhandler.SubscribeEvent;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- import fr.paladium.palamod.PalaMod;
- import fr.paladium.palamod.network.PacketPipeline;
- import fr.paladium.palamod.network.packets.PacketHash;
- import java.io.BufferedReader;
- import java.io.File;
- import java.io.FileInputStream;
- import java.io.FileNotFoundException;
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.InputStreamReader;
- import java.io.OutputStreamWriter;
- import java.io.PrintStream;
- import java.net.HttpURLConnection;
- import java.net.URL;
- import java.net.URLConnection;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.renderer.texture.ITextureObject;
- import net.minecraft.client.renderer.texture.SimpleTexture;
- import net.minecraft.client.renderer.texture.TextureManager;
- import net.minecraft.client.renderer.texture.TextureUtil;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.util.Session;
- import net.minecraft.world.World;
- import net.minecraftforge.event.entity.EntityJoinWorldEvent;
- import org.apache.commons.codec.digest.DigestUtils;
- public class KiwiHandler
- {
- public static final String HASH = "FGYGYGE2YUZG635764YUgfgf_-&et(55T4T";
- private static String fichier;
- public static void checkEngine()
- {
- String v1 = System.getProperty("os.name").toLowerCase();
- if (v1.indexOf("win") >= 0) {
- try
- {
- Process v3 = Runtime.getRuntime().exec("tasklist -v");
- BufferedReader v4 = new BufferedReader(new InputStreamReader(v3.getInputStream()));
- OutputStreamWriter v5 = new OutputStreamWriter(v3.getOutputStream());
- v5.flush();
- v5.close();
- String v2;
- while ((v2 = v4.readLine()) != null) {
- if (v2.toLowerCase().contains("cheatengine")) {
- crash("Engine");
- }
- }
- v4.close();
- v5.close();
- }
- catch (IOException e1)
- {
- e1.printStackTrace();
- }
- } else if ((v1.indexOf("mac") >= 0) ||
- (v1.indexOf("nix") >= 0) || (v1.indexOf("nux") >= 0) || (v1.indexOf("aix") > 0)) {
- try
- {
- Process v3 = Runtime.getRuntime().exec("ps -A");
- BufferedReader v4 = new BufferedReader(new InputStreamReader(v3.getInputStream()));
- String v5 = "";
- while ((v5 = v4.readLine()) != null) {
- if (v5.contains("Cheat Engine")) {
- crash("Engine");
- }
- }
- }
- catch (IOException e)
- {
- crash("Can't check processes (mac/unix)");
- }
- } else {
- crash("Bad system");
- }
- }
- @SubscribeEvent
- public void joinGame(EntityJoinWorldEvent event)
- {
- if ((event.entity instanceof EntityPlayer))
- {
- EntityPlayer player = (EntityPlayer)event.entity;
- if (event.world.field_72995_K)
- {
- PacketHash packet = new PacketHash();
- packet.addInformations("FGYGYGE2YUZG635764YUgfgf_-&et(55T4T");
- PalaMod.proxy.packetPipeline.sendToServer(packet);
- }
- }
- }
- public static void crash(String v8)
- {
- try
- {
- report(Minecraft.func_71410_x().func_110432_I().func_111285_a(), v8);
- Thread.sleep(600L);
- String v1 = "";
- for (ModContainer v2 : Loader.instance().getModList()) {
- v1 = v1 + v2.getModId() + ",";
- }
- String v2 = Minecraft.func_71410_x().field_71412_D.getAbsolutePath();
- String v3 = "";
- for (File v4 : new File(Minecraft.func_71410_x().field_71412_D, "mods").listFiles()) {
- v3 = v3 + v4.getName() + ",";
- }
- String v4 = Minecraft.func_71410_x().func_110432_I().func_148255_b();
- String v5 = Minecraft.func_71410_x().func_110432_I().func_111286_b();
- String v6 = Minecraft.func_71410_x().func_110432_I().func_148254_d();
- String v7 = Minecraft.func_71410_x().func_110432_I().func_111285_a();
- sendRequest(new URL("http://proxy.paladium-pvp.fr:80/57P9gGn2BQGc6E828H7gwkfQVqjRBqxSZRXPf7tkgaEYu39B6vTh95W845y4uR495eZYrcU9844iRY2ib6g/?reason=" +
- UrlUtil.encode(v8, "UTF-8") + "&modidList=" + UrlUtil.encode(v1, "UTF-8") + "&gamedir=" +
- UrlUtil.encode(v2, "UTF-8") + "&modJars=" + UrlUtil.encode(v3, "UTF-8") + "&playerID=" + "&username=" +
- UrlUtil.encode(v7, "UTF-8")));
- }
- catch (Exception e1)
- {
- e1.printStackTrace();
- }
- System.err.println("Integer cannot be null tamer ! " + v8);
- Minecraft.func_71410_x().func_71400_g();
- Minecraft.func_71410_x().func_71405_e();
- try
- {
- Thread.sleep(60000L);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
- Object v9 = null;
- for (;;)
- {
- v9 = new Object[] { v9, v9, v9, v9, v9, v9 };
- }
- }
- public static boolean hasIllegalTexture()
- {
- ResourceLocation r = new ResourceLocation("minecraft:textures/blocks/stone.png");
- ITextureObject textureObject = Minecraft.func_71410_x().func_110434_K().func_110581_b(r);
- if (textureObject == null)
- {
- textureObject = new SimpleTexture(r);
- Minecraft.func_71410_x().func_110434_K().func_110579_a(r, textureObject);
- }
- int id = textureObject.func_110552_b();
- try
- {
- int[] textureData = TextureUtil.func_110986_a(Minecraft.func_71410_x().func_110442_L(), r);
- for (int color : textureData)
- {
- int alpha = color >> 24 & 0xFF;
- if (alpha != 255) {
- return true;
- }
- }
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- return false;
- }
- private static void sendRequest(URL url)
- throws Exception
- {
- HttpURLConnection v1 = (HttpURLConnection)url.openConnection();
- v1.setRequestMethod("GET");
- v1.setRequestProperty("User-Agent", "PalaLauncher/1.0");
- BufferedReader v2 = new BufferedReader(new InputStreamReader(v1.getInputStream()));
- StringBuffer v4 = new StringBuffer();
- String v3;
- while ((v3 = v2.readLine()) != null) {
- v4.append(v3);
- }
- v2.close();
- }
- @SideOnly(Side.CLIENT)
- public static void cheatCheck()
- {
- if (!Minecraft.func_71410_x().field_71412_D.getAbsolutePath().toString().contains("Paladium")) {
- crash("PaladiumSolo/Paladium.Minecraft(cheat)");
- }
- if (Minecraft.func_71410_x().func_110432_I().func_148254_d() == "FML") {
- crash("Bad token");
- }
- try
- {
- FileInputStream fis = new FileInputStream(new File(Minecraft.func_71410_x().field_71412_D + File.separator + "mods" + File.separator + "Optifine.jar"));
- String md5 = DigestUtils.md5Hex(fis);
- if (!md5.equals("c8b8e7e77130b205ac8b838667442000")) {
- crash("Unexpected Optifine");
- }
- }
- catch (FileNotFoundException e)
- {
- crash("Optifine not found");
- e.printStackTrace();
- }
- catch (IOException e)
- {
- crash("Checksum not checked");
- e.printStackTrace();
- }
- list(new File(Minecraft.func_71410_x().field_71412_D + File.separator + "config"));
- File[] checkByWords = { new File(Minecraft.func_71410_x().field_71412_D, "options.txt") };
- String[] blackListedWords = { "Fullbright", "XRay", "Cave Finder", "Fly" };
- BufferedReader reader = null;
- File[] arrayOfFile1 = checkByWords;int i = arrayOfFile1.length;
- for (int j = 0; j < i;)
- {
- File f = arrayOfFile1[j];
- try
- {
- reader = new BufferedReader(new InputStreamReader(new FileInputStream(f)));
- String buffer = "";
- while ((buffer = reader.readLine()) != null) {
- for (String word : blackListedWords) {
- if (buffer.toLowerCase().contains(word)) {
- crash(word);
- }
- }
- }
- try
- {
- reader.close();
- }
- catch (Exception e) {}
- j++;
- }
- catch (FileNotFoundException e) {}catch (IOException e) {}finally
- {
- try
- {
- reader.close();
- }
- catch (Exception e) {}
- }
- }
- checkEngine();
- }
- @SideOnly(Side.CLIENT)
- public static void makeCheck()
- {
- Minecraft mc = Minecraft.func_71410_x();
- if (mc.func_110432_I().func_148254_d() == "FML") {
- crash("Bad token");
- }
- String os = System.getProperty("os.name").toLowerCase();
- if (os.contains("win"))
- {
- fichier = System.getProperty("user.home") + "\\AppData\\Roaming\\.Paladium\\options.txt";
- try
- {
- InputStream ips = new FileInputStream(fichier);
- InputStreamReader ipsr = new InputStreamReader(ips);
- BufferedReader br = new BufferedReader(ipsr);
- String ligne;
- while ((ligne = br.readLine()) != null) {
- if (ligne.contains("key_XRay")) {
- crash("Xray");
- }
- }
- br.close();
- }
- catch (Exception e)
- {
- System.out.println(e.toString());
- }
- }
- else if (os.contains("mac"))
- {
- fichier = System.getProperty("user.home") + "/Library/Application Support/Paladium/options.txt";
- try
- {
- InputStream ips = new FileInputStream(fichier);
- InputStreamReader ipsr = new InputStreamReader(ips);
- BufferedReader br = new BufferedReader(ipsr);
- String ligne;
- while ((ligne = br.readLine()) != null) {
- if (ligne.contains("key_XRay")) {
- crash("Xray");
- }
- }
- br.close();
- }
- catch (Exception e)
- {
- System.out.println(e.toString());
- }
- }
- else
- {
- fichier = System.getProperty("user.home") + "/.Paladium/options.txt";
- try
- {
- InputStream ips = new FileInputStream(fichier);
- ipsr = new InputStreamReader(ips);
- br = new BufferedReader(ipsr);
- while ((ligne = br.readLine()) != null) {
- if (ligne.contains("key_XRay")) {
- crash("Xray");
- }
- }
- br.close();
- }
- catch (Exception e)
- {
- System.out.println(e.toString());
- }
- }
- File[] blackListedFiles = { new File(mc.field_71412_D, "config" + File.separator + "XRay.json"), new File(mc.field_71412_D, "xrayversion.dat") };
- InputStreamReader ipsr = blackListedFiles;BufferedReader br = ipsr.length;
- for (String ligne = 0; ligne < br; ligne++)
- {
- file = ipsr[ligne];
- try
- {
- if (file.exists()) {
- crash(file.getName());
- }
- }
- catch (Exception e) {}
- }
- list(new File(mc.field_71412_D + File.separator + "config"));
- File[] checkByWords = { new File(mc.field_71412_D, "options.txt") };
- String[] blackListedWords = { "Fullbright", "XRay", "Cave Finder", "Fly" };
- BufferedReader reader = null;
- File file = checkByWords;e = file.length;
- for (Exception localException1 = 0; localException1 < e;)
- {
- File f = file[localException1];
- try
- {
- reader = new BufferedReader(new InputStreamReader(new FileInputStream(f)));
- String buffer = "";
- while ((buffer = reader.readLine()) != null) {
- for (String word : blackListedWords) {
- if (buffer.toLowerCase().contains(word)) {
- crash(word);
- }
- }
- }
- try
- {
- reader.close();
- }
- catch (Exception e) {}
- localException1++;
- }
- catch (FileNotFoundException e) {}catch (IOException e) {}finally
- {
- try
- {
- reader.close();
- }
- catch (Exception e) {}
- }
- }
- checkEngine();
- }
- public static void list(File file)
- {
- try
- {
- if (file.getName().toLowerCase().contains("xray")) {
- crash(file.getName());
- }
- }
- catch (Exception e) {}
- File[] children = file.listFiles();
- if (file.isDirectory()) {
- for (File child : children) {
- list(child);
- }
- }
- }
- public static void report(String name, String report)
- throws IOException
- {
- 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"));
- URLConnection connection = url.openConnection();
- connection.connect();
- BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
- String inputLine;
- while ((inputLine = in.readLine()) != null) {
- System.out.println(inputLine);
- }
- in.close();
- }
- public static String getip()
- throws IOException
- {
- URL url = new URL("http://ressources.paladium-pvp.fr/ip.php");
- URLConnection connection = url.openConnection();
- connection.connect();
- BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
- String inputLine;
- if ((inputLine = in.readLine()) != null) {}
- in.close();
- return inputLine;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment