Guest User

Signlink.java

a guest
Apr 7th, 2013
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.00 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 static void setuid() {
  46. uid = 26342;
  47. }
  48. public void run()
  49. {
  50. active = true;
  51. String s = findcachedir();
  52. // uid = getuid(s);
  53. uid = 26342;
  54. try {
  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. } catch(Exception exception) {
  60. exception.printStackTrace();
  61. }
  62. for(int i = threadliveid; threadliveid == i;)
  63. {
  64. if(socketreq != 0)
  65. {
  66. try
  67. {
  68. socket = new Socket(socketip, socketreq);
  69. }
  70. catch(Exception _ex)
  71. {
  72. socket = null;
  73. }
  74. socketreq = 0;
  75. } else
  76. if(threadreq != null)
  77. {
  78. Thread thread = new Thread(threadreq);
  79. thread.setDaemon(true);
  80. thread.start();
  81. thread.setPriority(threadreqpri);
  82. threadreq = null;
  83. } else
  84. if(dnsreq != null)
  85. {
  86. try
  87. {
  88. dns = InetAddress.getByName(dnsreq).getHostName();
  89. }
  90. catch(Exception _ex)
  91. {
  92. dns = "unknown";
  93. }
  94. dnsreq = null;
  95. } else
  96. if(savereq != null)
  97. {
  98. if(savebuf != null)
  99. try
  100. {
  101. FileOutputStream fileoutputstream = new FileOutputStream(s + savereq);
  102. fileoutputstream.write(savebuf, 0, savelen);
  103. fileoutputstream.close();
  104. }
  105. catch(Exception _ex) { }
  106. if(waveplay)
  107. {
  108. String wave = s + savereq;
  109. waveplay = false;
  110. }
  111. if(midiplay)
  112. {
  113. midi = s + savereq;
  114. midiplay = false;
  115. }
  116. savereq = null;
  117. } else
  118. if(urlreq != null)
  119. {
  120. try
  121. {
  122. System.out.println("urlstream");
  123. urlstream = new DataInputStream((new URL(mainapp.getCodeBase(), urlreq)).openStream());
  124. }
  125. catch(Exception _ex)
  126. {
  127. urlstream = null;
  128. }
  129. urlreq = null;
  130. }
  131. try
  132. {
  133. Thread.sleep(50L);
  134. }
  135. catch(Exception _ex) { }
  136. }
  137.  
  138. }
  139.  
  140. public static String findcachedir() {
  141. String as[] = {"C:/"};
  142. if(storeid < 32 || storeid > 34)
  143. storeid = 32;
  144. String s = "CridCacheV1";
  145. for(int i = 0; i < as.length; i++)
  146. try {
  147. String s1 = as[i];
  148. if(s1.length() > 0) {
  149. File file = new File(s1);
  150. if(!file.exists())
  151. continue;
  152. }
  153. File file1 = new File(s1 + s);
  154. if(file1.exists() || file1.mkdir())
  155. return s1 + s + "/";
  156. }
  157. catch(Exception _ex) { }
  158. return null;
  159. }
  160.  
  161. public static int getuid(String s) {
  162. return 26342;
  163. }
  164.  
  165. /* private static int getuid(String s)
  166. {
  167. try
  168. {
  169. File file = new File(s + "uid.dat");
  170. if(!file.exists() || file.length() < 4L)
  171. {
  172. DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(s + "uid.dat"));
  173. dataoutputstream.writeInt((int)(Math.random() * 99999999D));
  174. dataoutputstream.close();
  175. }
  176. }
  177. catch(Exception _ex) { }
  178. try
  179. {
  180. DataInputStream datainputstream = new DataInputStream(new FileInputStream(s + "uid.dat"));
  181. int i = datainputstream.readInt();
  182. datainputstream.close();
  183. return i + 1;
  184. }
  185. catch(Exception _ex)
  186. {
  187. return 0;
  188. }
  189. }*/
  190.  
  191. public static synchronized Socket opensocket(int i)
  192. throws IOException
  193. {
  194. for(socketreq = i; socketreq != 0;)
  195. try
  196. {
  197. Thread.sleep(50L);
  198. }
  199. catch(Exception _ex) { }
  200.  
  201. if(socket == null)
  202. throw new IOException("could not open socket");
  203. else
  204. return socket;
  205. }
  206.  
  207. public static synchronized DataInputStream openurl(String s)
  208. throws IOException
  209. {
  210. for(urlreq = s; urlreq != null;)
  211. try
  212. {
  213. Thread.sleep(50L);
  214. }
  215. catch(Exception _ex) { }
  216.  
  217. if(urlstream == null)
  218. throw new IOException("could not open: " + s);
  219. else
  220. return urlstream;
  221. }
  222.  
  223. public static synchronized void dnslookup(String s)
  224. {
  225. dns = s;
  226. dnsreq = s;
  227. }
  228.  
  229. public static synchronized void startthread(Runnable runnable, int i)
  230. {
  231. threadreqpri = i;
  232. threadreq = runnable;
  233. }
  234.  
  235. public static synchronized boolean wavesave(byte abyte0[], int i)
  236. {
  237. /*if(i > 0x1e8480)
  238. return false;
  239. if(savereq != null)
  240. {
  241. return false;
  242. } else
  243. {
  244. wavepos = (wavepos + 1) % 5;
  245. savelen = i;
  246. savebuf = abyte0;
  247. waveplay = true;
  248. savereq = "sound" + wavepos + ".wav";
  249. return true;
  250. }*/
  251. return false;
  252. }
  253.  
  254. public static synchronized boolean wavereplay()
  255. {
  256. if(savereq != null)
  257. {
  258. return false;
  259. } else
  260. {
  261. savebuf = null;
  262. waveplay = true;
  263. savereq = "sound" + wavepos + ".wav";
  264. return true;
  265. }
  266. }
  267.  
  268. public static synchronized void midisave(byte abyte0[], int i)
  269. {
  270. /*if(i > 0x1e8480)
  271. return;
  272. if(savereq != null)
  273. {
  274. } else
  275. {
  276. midipos = (midipos + 1) % 5;
  277. savelen = i;
  278. savebuf = abyte0;
  279. midiplay = true;
  280. savereq = "jingle" + midipos + ".mid";
  281. }*/
  282. }
  283.  
  284. public static void reporterror(String s)
  285. {
  286. System.out.println("Error: " + s);
  287. }
  288.  
  289. private signlink()
  290. {
  291. }
  292.  
  293. public static final int clientversion = 317;
  294. public static int uid;
  295. public static int storeid = 32;
  296. public static RandomAccessFile cache_dat = null;
  297. public static final RandomAccessFile[] cache_idx = new RandomAccessFile[5];
  298. public static boolean sunjava;
  299. public static Applet mainapp = null;
  300. private static boolean active;
  301. private static int threadliveid;
  302. private static InetAddress socketip;
  303. private static int socketreq;
  304. private static Socket socket = null;
  305. private static int threadreqpri = 1;
  306. private static Runnable threadreq = null;
  307. private static String dnsreq = null;
  308. public static String dns = null;
  309. private static String urlreq = null;
  310. private static DataInputStream urlstream = null;
  311. private static int savelen;
  312. private static String savereq = null;
  313. private static byte[] savebuf = null;
  314. private static boolean midiplay;
  315. private static int midipos;
  316. public static String midi = null;
  317. public static int midivol;
  318. public static int midifade;
  319. private static boolean waveplay;
  320. private static int wavepos;
  321. public static int wavevol;
  322. public static boolean reporterror = true;
  323. public static String errorname = "";
  324.  
  325. }
Advertisement
Add Comment
Please, Sign In to add comment