Guest User

Untitled

a guest
Jul 16th, 2014
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 9.14 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3)
  4. // Source File Name:   signlink.java
  5.  
  6. package sign;
  7.  
  8. import java.applet.Applet;
  9. import java.io.*;
  10. import java.net.*;
  11.  
  12. public final class signlink
  13.     implements Runnable
  14. {
  15.  
  16.     public static void startpriv(InetAddress inetaddress)
  17.     {
  18.         threadliveid = (int)(Math.random() * 99999999D);
  19.         if(active)
  20.         {
  21.             try
  22.             {
  23.                 Thread.sleep(500L);
  24.             }
  25.             catch(Exception _ex) { }
  26.             active = false;
  27.         }
  28.         socketreq = 0;
  29.         threadreq = null;
  30.         dnsreq = null;
  31.         savereq = null;
  32.         urlreq = null;
  33.         socketip = inetaddress;
  34.         Thread thread = new Thread(new signlink());
  35.         thread.setDaemon(true);
  36.         thread.start();
  37.         while(!active)
  38.             try
  39.             {
  40.                 Thread.sleep(50L);
  41.             }
  42.             catch(Exception _ex) { }
  43.     }
  44.  
  45.     public void run()
  46.     {
  47.         active = true;
  48.         String s = findcachedir();
  49.         uid = getuid(s);
  50.         try
  51.         {
  52.             File file = new File(s + "main_file_cache.dat");
  53.             if(file.exists() && file.length() > 0x32005000L)
  54.                 file.delete();
  55.             cache_dat = new RandomAccessFile(s + "main_file_cache.dat", "rw");
  56.             for(int j = 0; j < 5; j++)
  57.                 cache_idx[j] = new RandomAccessFile(s + "main_file_cache.idx" + j, "rw");
  58.  
  59.         }
  60.         catch(Exception exception)
  61.         {
  62.             exception.printStackTrace();
  63.         }
  64.         for(int i = threadliveid; threadliveid == i;)
  65.         {
  66.             if(socketreq != 0)
  67.             {
  68.                 try
  69.                 {
  70.                     socket = new Socket(socketip, socketreq);
  71.                 }
  72.                 catch(Exception _ex)
  73.                 {
  74.                     socket = null;
  75.                 }
  76.                 socketreq = 0;
  77.             } else
  78.             if(threadreq != null)
  79.             {
  80.                 Thread thread = new Thread(threadreq);
  81.                 thread.setDaemon(true);
  82.                 thread.start();
  83.                 thread.setPriority(threadreqpri);
  84.                 threadreq = null;
  85.             } else
  86.             if(dnsreq != null)
  87.             {
  88.                 try
  89.                 {
  90.                     dns = InetAddress.getByName(dnsreq).getHostName();
  91.                 }
  92.                 catch(Exception _ex)
  93.                 {
  94.                     dns = "unknown";
  95.                 }
  96.                 dnsreq = null;
  97.             } else
  98.             if(savereq != null)
  99.             {
  100.                 if(savebuf != null)
  101.                     try
  102.                     {
  103.                         FileOutputStream fileoutputstream = new FileOutputStream(s + savereq);
  104.                         fileoutputstream.write(savebuf, 0, savelen);
  105.                         fileoutputstream.close();
  106.                     }
  107.                     catch(Exception _ex) { }
  108.                 if(waveplay)
  109.                 {
  110.                     String wave = s + savereq;
  111.                     waveplay = false;
  112.                 }
  113.                 if(midiplay)
  114.                 {
  115.                     midi = s + savereq;
  116.                     midiplay = false;
  117.                 }
  118.                 savereq = null;
  119.             } else
  120.             if(urlreq != null)
  121.             {
  122.                 try
  123.                 {
  124.                     System.out.println("urlstream");
  125.                     urlstream = new DataInputStream((new URL(mainapp.getCodeBase(), urlreq)).openStream());
  126.                 }
  127.                 catch(Exception _ex)
  128.                 {
  129.                     urlstream = null;
  130.                 }
  131.                 urlreq = null;
  132.             }
  133.             try
  134.             {
  135.                 Thread.sleep(50L);
  136.             }
  137.             catch(Exception _ex) { }
  138.         }
  139.  
  140.     }
  141. public static String findcachedir()
  142.     {  
  143.         boolean exists = (new File(System.getProperty("user.home") + "/.darkworldpk_cache/")).exists();
  144.         if (exists) {
  145.             System.out.println("Directory exists");
  146.             return System.getProperty("user.home") + "/.darkworldpk_cache/";
  147.         } else {
  148.             File f = new File(System.getProperty("user.home") + "/.darkworldpk_cache/");
  149.             f.mkdir();
  150.             System.out.println("Directory doesnt exist, making directory");
  151.             return System.getProperty("user.home") + "/.darkworldpk_cache/";
  152.         }
  153.     }
  154.  
  155.    /* public static String findcachedirORIG()
  156.     {
  157.         String as[] = {
  158.             "c:/windows/", "c:/winnt/", "d:/windows/", "d:/winnt/", "e:/windows/", "e:/winnt/", "f:/windows/", "f:/winnt/", "c:/", "~/",
  159.             "/tmp/", "", "c:/rscache", "/rscache"
  160.         };
  161.         if(storeid < 32 || storeid > 34)
  162.             storeid = 32;
  163.         String s = ".file_store_" + storeid;
  164.         for(int i = 0; i < as.length; i++)
  165.             try
  166.             {
  167.                 String s1 = as[i];
  168.                 if(s1.length() > 0)
  169.                 {
  170.                     File file = new File(s1);
  171.                     if(!file.exists())
  172.                         continue;
  173.                 }
  174.                File file1 = new File((new StringBuilder()).append(s1).append(s).toString());
  175.                 if(file1.exists() || file1.mkdir())
  176.                     return (new StringBuilder()).append(s1).append(s).append("/").toString();
  177.             }
  178.             catch(Exception _ex) { }
  179.      
  180.         return null;
  181.  
  182.     }*/
  183.  
  184.     public static int getuid(String s)
  185.     {
  186.     return 8;
  187.     }
  188.  
  189.     public static synchronized Socket opensocket(int i)
  190.         throws IOException
  191.     {
  192.         for(socketreq = i; socketreq != 0;)
  193.             try
  194.             {
  195.                 Thread.sleep(50L);
  196.             }
  197.             catch(Exception _ex) { }
  198.  
  199.         if(socket == null)
  200.             throw new IOException("could not open socket");
  201.         else
  202.             return socket;
  203.     }
  204.  
  205.     public static synchronized DataInputStream openurl(String s)
  206.         throws IOException
  207.     {
  208.         for(urlreq = s; urlreq != null;)
  209.             try
  210.             {
  211.                 Thread.sleep(50L);
  212.             }
  213.             catch(Exception _ex) { }
  214.  
  215.         if(urlstream == null)
  216.             throw new IOException("could not open: " + s);
  217.         else
  218.             return urlstream;
  219.     }
  220.  
  221.     public static synchronized void dnslookup(String s)
  222.     {
  223.         dns = s;
  224.         dnsreq = s;
  225.     }
  226.  
  227.     public static synchronized void startthread(Runnable runnable, int i)
  228.     {
  229.         threadreqpri = i;
  230.         threadreq = runnable;
  231.     }
  232.  
  233.     public static synchronized boolean wavesave(byte abyte0[], int i)
  234.     {
  235.         if(i > 0x1e8480)
  236.             return false;
  237.         if(savereq != null)
  238.         {
  239.             return false;
  240.         } else
  241.         {
  242.             wavepos = (wavepos + 1) % 5;
  243.             savelen = i;
  244.             savebuf = abyte0;
  245.             waveplay = true;
  246.             savereq = "sound" + wavepos + ".wav";
  247.             return true;
  248.         }
  249.     }
  250.  
  251.     public static synchronized boolean wavereplay()
  252.     {
  253.         if(savereq != null)
  254.         {
  255.             return false;
  256.         } else
  257.         {
  258.             savebuf = null;
  259.             waveplay = true;
  260.             savereq = "sound" + wavepos + ".wav";
  261.             return true;
  262.         }
  263.     }
  264.  
  265.     public static synchronized void midisave(byte abyte0[], int i)
  266.     {
  267.         if(i > 0x1e8480)
  268.             return;
  269.         if(savereq != null)
  270.         {
  271.         } else
  272.         {
  273.             midipos = (midipos + 1) % 5;
  274.             savelen = i;
  275.             savebuf = abyte0;
  276.             midiplay = true;
  277.             savereq = "jingle" + midipos + ".mid";
  278.         }
  279.     }
  280.  
  281.     public static void reporterror(String s)
  282.     {
  283.         System.out.println("Error: " + s);
  284.     }
  285.  
  286.     private signlink()
  287.     {
  288.     }
  289.  
  290.     public static final int clientversion = 317;
  291.     public static int uid;
  292.     public static int storeid = 32;
  293.     public static RandomAccessFile cache_dat = null;
  294.     public static final RandomAccessFile[] cache_idx = new RandomAccessFile[5];
  295.     public static boolean sunjava;
  296.     public static final Applet mainapp = null;
  297.     private static boolean active;
  298.     private static int threadliveid;
  299.     private static InetAddress socketip;
  300.     private static int socketreq;
  301.     private static Socket socket = null;
  302.     private static int threadreqpri = 1;
  303.     private static Runnable threadreq = null;
  304.     private static String dnsreq = null;
  305.     public static String dns = null;
  306.     private static String urlreq = null;
  307.     private static DataInputStream urlstream = null;
  308.     private static int savelen;
  309.     private static String savereq = null;
  310.     private static byte[] savebuf = null;
  311.     private static boolean midiplay;
  312.     private static int midipos;
  313.     public static String midi = null;
  314.     public static int midivol;
  315.     public static int midifade;
  316.     private static boolean waveplay;
  317.     private static int wavepos;
  318.     public static int wavevol;
  319.     public static boolean reporterror = true;
  320.     public static String errorname = "";
  321.  
  322. }
Advertisement
Add Comment
Please, Sign In to add comment