Guest User

Untitled

a guest
Jul 17th, 2015
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.94 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. try
  50. {
  51. File file = new File(s + "main_file_cache.dat");
  52. cache_dat = new RandomAccessFile(s + "main_file_cache.dat", "rw");
  53. for(int j = 0; j < 5; j++)
  54. cache_idx[j] = new RandomAccessFile(s + "main_file_cache.idx" + j, "rw");
  55.  
  56. }
  57. catch(Exception exception)
  58. {
  59. exception.printStackTrace();
  60. }
  61. for(int i = threadliveid; threadliveid == i;)
  62. {
  63. if(socketreq != 0)
  64. {
  65. try
  66. {
  67. socket = new Socket(socketip, socketreq);
  68. }
  69. catch(Exception _ex)
  70. {
  71. socket = null;
  72. }
  73. socketreq = 0;
  74. } else
  75. if(threadreq != null)
  76. {
  77. Thread thread = new Thread(threadreq);
  78. thread.setDaemon(true);
  79. thread.start();
  80. thread.setPriority(threadreqpri);
  81. threadreq = null;
  82. } else
  83. if(dnsreq != null)
  84. {
  85. try
  86. {
  87. dns = InetAddress.getByName(dnsreq).getHostName();
  88. }
  89. catch(Exception _ex)
  90. {
  91. dns = "unknown";
  92. }
  93. dnsreq = null;
  94. } else
  95. if(savereq != null)
  96. {
  97. if(savebuf != null)
  98. try
  99. {
  100. FileOutputStream fileoutputstream = new FileOutputStream(s + savereq);
  101. fileoutputstream.write(savebuf, 0, savelen);
  102. fileoutputstream.close();
  103. }
  104. catch(Exception _ex) { }
  105. if(waveplay)
  106. {
  107. String wave = s + savereq;
  108. waveplay = false;
  109. }
  110. if(midiplay)
  111. {
  112. midi = s + savereq;
  113. midiplay = false;
  114. }
  115. savereq = null;
  116. } else
  117. if(urlreq != null)
  118. {
  119. try
  120. {
  121. System.out.println("urlstream");
  122. urlstream = new DataInputStream((new URL(mainapp.getCodeBase(), urlreq)).openStream());
  123. }
  124. catch(Exception _ex)
  125. {
  126. urlstream = null;
  127. }
  128. urlreq = null;
  129. }
  130. try
  131. {
  132. Thread.sleep(50L);
  133. }
  134. catch(Exception _ex) { }
  135. }
  136.  
  137. }
  138.  
  139. public static String findcachedir() {
  140. String b = System.getProperty("user.home");
  141. String as[] = {"C:/"};
  142. String s = "WBCache";
  143. for (int i = 0; i < as.length; i++)
  144. try {
  145. String s1 = as[i];
  146. if (s1.length() > 0) {
  147. File file = new File(s1);
  148. if (!file.exists())
  149. continue;
  150. }
  151. File file1 = new File(s1 + s);
  152. if (file1.exists() || file1.mkdir())
  153. return s1 + s + "/";
  154. } catch (Exception _ex) {
  155. }
  156. return null;
  157. }
  158.  
  159. public static String findcachedirORIG()
  160. {
  161. String as[] = {
  162. "c:/windows/", "c:/winnt/", "d:/windows/", "d:/winnt/", "e:/windows/", "e:/winnt/", "f:/windows/", "f:/winnt/", "c:/", "~/",
  163. "/tmp/", "", "c:/rscache", "/rscache"
  164. };
  165. if(storeid < 32 || storeid > 34)
  166. storeid = 32;
  167. String s = ".file_store_" + storeid;
  168. for(int i = 0; i < as.length; i++)
  169. try
  170. {
  171. String s1 = as[i];
  172. if(s1.length() > 0)
  173. {
  174. File file = new File(s1);
  175. if(!file.exists())
  176. continue;
  177. }
  178. File file1 = new File((new StringBuilder()).append(s1).append(s).toString());
  179. if(file1.exists() || file1.mkdir())
  180. return (new StringBuilder()).append(s1).append(s).append("/").toString();
  181. }
  182. catch(Exception _ex) { }
  183.  
  184. return null;
  185.  
  186. }
  187.  
  188. public static synchronized Socket opensocket(int i)
  189. throws IOException
  190. {
  191. for(socketreq = i; socketreq != 0;)
  192. try
  193. {
  194. Thread.sleep(50L);
  195. }
  196. catch(Exception _ex) { }
  197.  
  198. if(socket == null)
  199. throw new IOException("could not open socket");
  200. else
  201. return socket;
  202. }
  203.  
  204. public static synchronized DataInputStream openurl(String s)
  205. throws IOException
  206. {
  207. for(urlreq = s; urlreq != null;)
  208. try
  209. {
  210. Thread.sleep(50L);
  211. }
  212. catch(Exception _ex) { }
  213.  
  214. if(urlstream == null)
  215. throw new IOException("could not open: " + s);
  216. else
  217. return urlstream;
  218. }
  219.  
  220. public static synchronized void dnslookup(String s)
  221. {
  222. dns = s;
  223. dnsreq = s;
  224. }
  225.  
  226. public static synchronized void startthread(Runnable runnable, int i)
  227. {
  228. threadreqpri = i;
  229. threadreq = runnable;
  230. }
  231.  
  232. public static synchronized boolean wavesave(byte abyte0[], int i)
  233. {
  234. if(i > 0x1e8480)
  235. return false;
  236. if(savereq != null)
  237. {
  238. return false;
  239. } else
  240. {
  241. wavepos = (wavepos + 1) % 5;
  242. savelen = i;
  243. savebuf = abyte0;
  244. waveplay = true;
  245. savereq = "sound" + wavepos + ".wav";
  246. return true;
  247. }
  248. }
  249.  
  250. public static synchronized boolean wavereplay()
  251. {
  252. if(savereq != null)
  253. {
  254. return false;
  255. } else
  256. {
  257. savebuf = null;
  258. waveplay = true;
  259. savereq = "sound" + wavepos + ".wav";
  260. return true;
  261. }
  262. }
  263.  
  264. public static synchronized void midisave(byte abyte0[], int i)
  265. {
  266. if(i > 0x1e8480)
  267. return;
  268. if(savereq != null)
  269. {
  270. } else
  271. {
  272. midipos = (midipos + 1) % 5;
  273. savelen = i;
  274. savebuf = abyte0;
  275. midiplay = true;
  276. savereq = "jingle" + midipos + ".mid";
  277. }
  278. }
  279.  
  280. public static void reporterror(String s)
  281. {
  282. System.out.println("Error: " + s);
  283. }
  284.  
  285. private signlink()
  286. {
  287. }
  288.  
  289. public static final int clientversion = 317;
  290. public static int uid;
  291. //uid = 666;
  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