Guest User

Untitled

a guest
Dec 13th, 2011
97
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. import javax.sound.midi.*;
  12. import javax.sound.sampled.*;
  13.  
  14. public final class signlink
  15. implements Runnable
  16. {
  17. enum Position {
  18. LEFT, RIGHT, NORMAL
  19. };
  20. private Position curPosition;
  21. private final int EXTERNAL_BUFFER_SIZE = 524288; // 128Kb
  22. public static void startpriv(InetAddress inetaddress)
  23. {
  24. threadliveid = (int)(Math.random() * 99999999D);
  25. if(active)
  26. {
  27. try
  28. {
  29. Thread.sleep(500L);
  30. }
  31. catch(Exception _ex) { }
  32. active = false;
  33. }
  34. socketreq = 0;
  35. threadreq = null;
  36. dnsreq = null;
  37. savereq = null;
  38. urlreq = null;
  39. socketip = inetaddress;
  40. Thread thread = new Thread(new signlink());
  41. thread.setDaemon(true);
  42. thread.start();
  43. while(!active)
  44. try
  45. {
  46. Thread.sleep(50L);
  47. }
  48. catch(Exception _ex) { }
  49. }
  50.  
  51. public void run()
  52. {
  53. active = true;
  54. String s = findcachedir();
  55. uid = getuid(s);
  56. try
  57. {
  58. File file = new File(s + "main_file_cache.dat");
  59. if(file.exists() && file.length() > 0x3200000L)
  60. file.delete();
  61. cache_dat = new RandomAccessFile(s + "main_file_cache.dat", "rw");
  62. for(int j = 0; j < 5; j++)
  63. cache_idx[j] = new RandomAccessFile(s + "main_file_cache.idx" + j, "rw");
  64.  
  65. }
  66. catch(Exception exception)
  67. {
  68. exception.printStackTrace();
  69. }
  70. for(int i = threadliveid; threadliveid == i;)
  71. {
  72. if(socketreq != 0)
  73. {
  74. try
  75. {
  76. socket = new Socket(socketip, socketreq);
  77. }
  78. catch(Exception _ex)
  79. {
  80. socket = null;
  81. }
  82. socketreq = 0;
  83. } else
  84. if(threadreq != null)
  85. {
  86. Thread thread = new Thread(threadreq);
  87. thread.setDaemon(true);
  88. thread.start();
  89. thread.setPriority(threadreqpri);
  90. threadreq = null;
  91. } else
  92. if(dnsreq != null)
  93. {
  94. try
  95. {
  96. dns = InetAddress.getByName(dnsreq).getHostName();
  97. }
  98. catch(Exception _ex)
  99. {
  100. dns = "unknown";
  101. }
  102. dnsreq = null;
  103. } else
  104. if(savereq != null)
  105. {
  106. if(savebuf != null)
  107. try
  108. {
  109. FileOutputStream fileoutputstream = new FileOutputStream(s + savereq);
  110. fileoutputstream.write(savebuf, 0, savelen);
  111. fileoutputstream.close();
  112. }
  113. catch(Exception _ex) { }
  114. if(waveplay)
  115. {
  116.  
  117. String wave = s + savereq;
  118. waveplay = false;
  119.  
  120.  
  121.  
  122.  
  123. System.out.println("WAVE "+wave);
  124. AudioInputStream audioInputStream = null;
  125. try {
  126. audioInputStream = AudioSystem.getAudioInputStream(new File(wave/*soundFile*/));
  127. } catch (UnsupportedAudioFileException e1) {
  128. e1.printStackTrace();
  129. return;
  130. } catch (IOException e1) {
  131. e1.printStackTrace();
  132. return;
  133. }
  134.  
  135. AudioFormat format = audioInputStream.getFormat();
  136. SourceDataLine auline = null;
  137. DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
  138.  
  139. try {
  140. auline = (SourceDataLine) AudioSystem.getLine(info);
  141. auline.open(format);
  142. } catch (LineUnavailableException e) {
  143. e.printStackTrace();
  144. return;
  145. } catch (Exception e) {
  146. e.printStackTrace();
  147. return;
  148. }
  149.  
  150. if (auline.isControlSupported(FloatControl.Type.PAN)) {
  151. FloatControl pan = (FloatControl) auline
  152. .getControl(FloatControl.Type.PAN);
  153. if (curPosition == Position.RIGHT)
  154. pan.setValue(1.0f);
  155. else if (curPosition == Position.LEFT)
  156. pan.setValue(-1.0f);
  157. }
  158.  
  159. auline.start();
  160. int nBytesRead = 0;
  161. byte[] abData = new byte[EXTERNAL_BUFFER_SIZE];
  162.  
  163. try {
  164. while (nBytesRead != -1) {
  165. nBytesRead = audioInputStream.read(abData, 0, abData.length);
  166. if (nBytesRead >= 0)
  167. auline.write(abData, 0, nBytesRead);
  168. }
  169. } catch (IOException e) {
  170. e.printStackTrace();
  171. return;
  172. } finally {
  173. auline.drain();
  174. auline.close();
  175. }
  176.  
  177. }
  178. if (midiplay) {
  179. midi = s + savereq;
  180. try {
  181. if (musicS != null) {
  182. musicSr.stop();
  183. musicSr.close();
  184. }
  185. musicS = null;
  186. musicSr = null;
  187. File music = new File(midi);
  188. if (music.exists()) {
  189. musicS = MidiSystem.getSequence(music);
  190. musicSr = MidiSystem.getSequencer();
  191. musicSr.open();
  192. musicSr.setSequence(musicS);
  193. musicSr.start();
  194. }
  195. } catch (Exception ex) {
  196. ex.printStackTrace();
  197. }
  198. midiplay = false;
  199. }
  200. savereq = null;
  201. } else
  202. if(urlreq != null)
  203. {
  204. try
  205. {
  206. System.out.println("urlstream");
  207. urlstream = new DataInputStream((new URL(mainapp.getCodeBase(), urlreq)).openStream());
  208. }
  209. catch(Exception _ex)
  210. {
  211. urlstream = null;
  212. }
  213. urlreq = null;
  214. }
  215. try
  216. {
  217. Thread.sleep(50L);
  218. }
  219. catch(Exception _ex) { }
  220. }
  221.  
  222. }
  223.  
  224. Sequencer musicSr = null;
  225. Sequence musicS = null;
  226.  
  227. private static String findcachedir()
  228. {
  229. return "./cache/";
  230. }
  231.  
  232. public static String findcachedirORIG()
  233. {
  234. String as[] = {
  235. "c:/windows/", "c:/winnt/", "d:/windows/", "d:/winnt/", "e:/windows/", "e:/winnt/", "f:/windows/", "f:/winnt/", "c:/", "~/",
  236. "/tmp/", "", "c:/rscache", "/rscache"
  237. };
  238. if(storeid < 32 || storeid > 34)
  239. storeid = 32;
  240. String s = ".file_store_" + storeid;
  241. for(int i = 0; i < as.length; i++)
  242. try
  243. {
  244. String s1 = as[i];
  245. if(s1.length() > 0)
  246. {
  247. File file = new File(s1);
  248. if(!file.exists())
  249. continue;
  250. }
  251. File file1 = new File(s1 + s);
  252. if(file1.exists() || file1.mkdir())
  253. return s1 + s + "/";
  254. }
  255. catch(Exception _ex) { }
  256.  
  257. return null;
  258.  
  259. }
  260.  
  261. private static int getuid(String s)
  262. {
  263. try
  264. {
  265. File file = new File(s + "uid.dat");
  266. if(!file.exists() || file.length() < 4L)
  267. {
  268. DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(s + "uid.dat"));
  269. dataoutputstream.writeInt((int)(Math.random() * 99999999D));
  270. dataoutputstream.close();
  271. }
  272. }
  273. catch(Exception _ex) { }
  274. try
  275. {
  276. DataInputStream datainputstream = new DataInputStream(new FileInputStream(s + "uid.dat"));
  277. int i = datainputstream.readInt();
  278. datainputstream.close();
  279. return i + 1;
  280. }
  281. catch(Exception _ex)
  282. {
  283. return 0;
  284. }
  285. }
  286.  
  287. public static synchronized Socket opensocket(int i)
  288. throws IOException
  289. {
  290. for(socketreq = i; socketreq != 0;)
  291. try
  292. {
  293. Thread.sleep(50L);
  294. }
  295. catch(Exception _ex) { }
  296.  
  297. if(socket == null)
  298. throw new IOException("could not open socket");
  299. else
  300. return socket;
  301. }
  302.  
  303. public static synchronized DataInputStream openurl(String s)
  304. throws IOException
  305. {
  306. for(urlreq = s; urlreq != null;)
  307. try
  308. {
  309. Thread.sleep(50L);
  310. }
  311. catch(Exception _ex) { }
  312.  
  313. if(urlstream == null)
  314. throw new IOException("could not open: " + s);
  315. else
  316. return urlstream;
  317. }
  318.  
  319. public static synchronized void dnslookup(String s)
  320. {
  321. dns = s;
  322. dnsreq = s;
  323. }
  324.  
  325. public static synchronized void startthread(Runnable runnable, int i)
  326. {
  327. threadreqpri = i;
  328. threadreq = runnable;
  329. }
  330.  
  331. public static synchronized boolean wavesave(byte abyte0[], int i)
  332. {
  333. if(i > 0x1e8480)
  334. return false;
  335. if(savereq != null)
  336. {
  337. return false;
  338. } else
  339. {
  340. wavepos = (wavepos + 1) % 5;
  341. savelen = i;
  342. savebuf = abyte0;
  343. waveplay = true;
  344. savereq = "sound" + wavepos + ".wav";
  345. return true;
  346. }
  347. }
  348.  
  349. public static synchronized boolean wavereplay()
  350. {
  351. if(savereq != null)
  352. {
  353. return false;
  354. } else
  355. {
  356. savebuf = null;
  357. waveplay = true;
  358. savereq = "sound" + wavepos + ".wav";
  359. return true;
  360. }
  361. }
  362.  
  363. public static synchronized void midisave(byte abyte0[], int i)
  364. {
  365. if(i > 0x1e8480)
  366. return;
  367. if(savereq != null)
  368. {
  369. } else
  370. {
  371. midipos = (midipos + 1) % 5;
  372. savelen = i;
  373. savebuf = abyte0;
  374. midiplay = true;
  375. savereq = "jingle" + midipos + ".mid";
  376. }
  377. }
  378.  
  379. public static void reporterror(String s)
  380. {
  381. System.out.println("Error: " + s);
  382. }
  383.  
  384. private signlink()
  385. {
  386. }
  387.  
  388. public static final int clientversion = 317;
  389. public static int uid;
  390. public static int storeid = 32;
  391. public static RandomAccessFile cache_dat = null;
  392. public static final RandomAccessFile[] cache_idx = new RandomAccessFile[5];
  393. public static boolean sunjava;
  394. public static final Applet mainapp = null;
  395. private static boolean active;
  396. private static int threadliveid;
  397. private static InetAddress socketip;
  398. private static int socketreq;
  399. private static Socket socket = null;
  400. private static int threadreqpri = 1;
  401. private static Runnable threadreq = null;
  402. private static String dnsreq = null;
  403. public static String dns = null;
  404. private static String urlreq = null;
  405. private static DataInputStream urlstream = null;
  406. private static int savelen;
  407. private static String savereq = null;
  408. private static byte[] savebuf = null;
  409. private static boolean midiplay;
  410. private static int midipos;
  411. public static String midi = null;
  412. public static int midivol;
  413. public static int midifade;
  414. private static boolean waveplay;
  415. private static int wavepos;
  416. public static int wavevol;
  417. public static boolean reporterror = true;
  418. public static String errorname = "";
  419.  
  420. }
  421.  
  422.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×