Guest User

Untitled

a guest
Aug 25th, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 8.74 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.  
  5. import java.math.BigInteger;
  6. import sign.signlink;
  7.  
  8. public final class Stream extends NodeSub {
  9.  
  10.     public static Stream create() {
  11.         synchronized(nodeList) {
  12.             Stream stream = null;
  13.             if(anInt1412 > 0) {
  14.                 anInt1412--;
  15.                 stream = (Stream) nodeList.popHead();
  16.             }
  17.             if(stream != null) {
  18.                 stream.currentOffset = 0;
  19.                 return stream;
  20.             }
  21.         }
  22.         Stream stream_1 = new Stream();
  23.         stream_1.currentOffset = 0;
  24.         stream_1.buffer = new byte[5000];
  25.         return stream_1;
  26.     }
  27.  
  28.     private Stream() {
  29.     }
  30.  
  31.     public Stream(byte abyte0[]) {
  32.         buffer = abyte0;
  33.             currentOffset = 0;
  34.     }
  35.  
  36.     public void createFrame(int i) {
  37.         //System.out.println("Frame: " + i);
  38.         buffer[currentOffset++] = (byte)(i + encryption.getNextKey());
  39.     }
  40.  
  41.     public void writeWordBigEndian(int i) {
  42.         buffer[currentOffset++] = (byte)i;
  43.     }
  44.  
  45.     public void writeWord(int i) {
  46.         buffer[currentOffset++] = (byte)(i >> 8);
  47.         buffer[currentOffset++] = (byte)i;
  48.     }
  49.  
  50.     public void method400(int i) {
  51.         buffer[currentOffset++] = (byte)i;
  52.         buffer[currentOffset++] = (byte)(i >> 8);
  53.     }
  54.  
  55.     public void writeDWordBigEndian(int i) {
  56.         buffer[currentOffset++] = (byte)(i >> 16);
  57.         buffer[currentOffset++] = (byte)(i >> 8);
  58.         buffer[currentOffset++] = (byte)i;
  59.     }
  60.  
  61.     public void writeDWord(int i) {
  62.         buffer[currentOffset++] = (byte)(i >> 24);
  63.         buffer[currentOffset++] = (byte)(i >> 16);
  64.         buffer[currentOffset++] = (byte)(i >> 8);
  65.         buffer[currentOffset++] = (byte)i;
  66.     }
  67.  
  68.     public void method403(int j) {
  69.         buffer[currentOffset++] = (byte)j;
  70.         buffer[currentOffset++] = (byte)(j >> 8);
  71.         buffer[currentOffset++] = (byte)(j >> 16);
  72.         buffer[currentOffset++] = (byte)(j >> 24);
  73.     }
  74.  
  75.     public void writeQWord(long l) {
  76.         try {
  77.             buffer[currentOffset++] = (byte)(int)(l >> 56);
  78.             buffer[currentOffset++] = (byte)(int)(l >> 48);
  79.             buffer[currentOffset++] = (byte)(int)(l >> 40);
  80.             buffer[currentOffset++] = (byte)(int)(l >> 32);
  81.             buffer[currentOffset++] = (byte)(int)(l >> 24);
  82.             buffer[currentOffset++] = (byte)(int)(l >> 16);
  83.             buffer[currentOffset++] = (byte)(int)(l >> 8);
  84.             buffer[currentOffset++] = (byte)(int)l;
  85.         } catch(RuntimeException runtimeexception) {
  86.             signlink.reporterror("14395, " + 5 + ", " + l + ", " + runtimeexception.toString());
  87.             throw new RuntimeException();
  88.         }
  89.     }
  90.  
  91.     public void writeString(String s) {
  92.         //s.getBytes(0, s.length(), buffer, currentOffset); //deprecated
  93.         System.arraycopy(s.getBytes(), 0, buffer, currentOffset, s.length());
  94.         currentOffset += s.length();
  95.         buffer[currentOffset++] = 10;
  96.     }
  97.  
  98.     public void writeBytes(byte abyte0[], int i, int j) {
  99.         for(int k = j; k < j + i; k++)
  100.             buffer[currentOffset++] = abyte0[k];
  101.     }
  102.  
  103.     public void writeBytes(int i) {
  104.         buffer[currentOffset - i - 1] = (byte)i;
  105.     }
  106.  
  107.     public int readUnsignedByte() {
  108.         return buffer[currentOffset++] & 0xff;
  109.     }
  110.  
  111.     public byte readSignedByte() {
  112.         return buffer[currentOffset++];
  113.     }
  114.  
  115.     public int readUnsignedWord() {
  116.         currentOffset += 2;
  117.         return ((buffer[currentOffset - 2] & 0xff) << 8) + (buffer[currentOffset - 1] & 0xff);
  118.     }
  119.  
  120.     public int readSignedWord() {
  121.         currentOffset += 2;
  122.         int i = ((buffer[currentOffset - 2] & 0xff) << 8) + (buffer[currentOffset - 1] & 0xff);
  123.         if(i > 32767)
  124.             i -= 0x10000;
  125.         return i;
  126.     }
  127.  
  128.     public int read3Bytes()     {
  129.         currentOffset += 3;
  130.         return ((buffer[currentOffset - 3] & 0xff) << 16) + ((buffer[currentOffset - 2] & 0xff) << 8) + (buffer[currentOffset - 1] & 0xff);
  131.     }
  132.  
  133.     public int readDWord() {
  134.         currentOffset += 4;
  135.         return ((buffer[currentOffset - 4] & 0xff) << 24) + ((buffer[currentOffset - 3] & 0xff) << 16) + ((buffer[currentOffset - 2] & 0xff) << 8) + (buffer[currentOffset - 1] & 0xff);
  136.     }
  137.  
  138.     public long readQWord() {
  139.         long l = (long) readDWord() & 0xffffffffL;
  140.         long l1 = (long) readDWord() & 0xffffffffL;
  141.         return (l << 32) + l1;
  142.     }
  143.  
  144.     public String readString() {
  145.         int i = currentOffset;
  146.         while(buffer[currentOffset++] != 10) ;
  147.         return new String(buffer, i, currentOffset - i - 1);
  148.     }
  149.  
  150.     public byte[] readBytes() {
  151.         int i = currentOffset;
  152.         while(buffer[currentOffset++] != 10) ;
  153.         byte abyte0[] = new byte[currentOffset - i - 1];
  154.         System.arraycopy(buffer, i, abyte0, i - i, currentOffset - 1 - i);
  155.         return abyte0;
  156.     }
  157.  
  158.     public void readBytes(int i, int j, byte abyte0[]) {
  159.         for(int l = j; l < j + i; l++)
  160.             abyte0[l] = buffer[currentOffset++];
  161.     }
  162.  
  163.     public void initBitAccess() {
  164.         bitPosition = currentOffset * 8;
  165.     }
  166.  
  167.     public int readBits(int i) {
  168.         int k = bitPosition >> 3;
  169.         int l = 8 - (bitPosition & 7);
  170.         int i1 = 0;
  171.         bitPosition += i;
  172.         for(; i > l; l = 8)
  173.         {
  174.             i1 += (buffer[k++] & anIntArray1409[l]) << i - l;
  175.             i -= l;
  176.         }
  177.         if(i == l)
  178.             i1 += buffer[k] & anIntArray1409[l];
  179.         else
  180.             i1 += buffer[k] >> l - i & anIntArray1409[i];
  181.         return i1;
  182.     }
  183.  
  184.     public void finishBitAccess()   {
  185.         currentOffset = (bitPosition + 7) / 8;
  186.     }
  187.  
  188.     public int method421() {
  189.         int i = buffer[currentOffset] & 0xff;
  190.         if(i < 128)
  191.             return readUnsignedByte() - 64;
  192.         else
  193.             return readUnsignedWord() - 49152;
  194.     }
  195.  
  196.     public int method422() {
  197.         int i = buffer[currentOffset] & 0xff;
  198.         if(i < 128)
  199.             return readUnsignedByte();
  200.         else
  201.             return readUnsignedWord() - 32768;
  202.     }
  203.  
  204.     public void doKeys() {
  205.         int i = currentOffset;
  206.         currentOffset = 0;
  207.         byte abyte0[] = new byte[i];
  208.         readBytes(i, 0, abyte0);
  209.         BigInteger biginteger2 = new BigInteger(abyte0);
  210.         BigInteger biginteger3 = biginteger2/*.modPow(biginteger, biginteger1)*/;
  211.         byte abyte1[] = biginteger3.toByteArray();
  212.         currentOffset = 0;
  213.         writeWordBigEndian(abyte1.length);
  214.         writeBytes(abyte1, abyte1.length, 0);
  215.     }
  216.  
  217.     public void method424(int i) {
  218.         buffer[currentOffset++] = (byte)(-i);
  219.     }
  220.  
  221.     public void method425(int j) {
  222.         buffer[currentOffset++] = (byte)(128 - j);
  223.     }
  224.  
  225.     public int method426() {
  226.             return buffer[currentOffset++] - 128 & 0xff;
  227.     }
  228.  
  229.     public int method427() {
  230.         return -buffer[currentOffset++] & 0xff;
  231.     }
  232.  
  233.     public int method428() {
  234.         return 128 - buffer[currentOffset++] & 0xff;
  235.     }
  236.  
  237.     public byte method429() {
  238.             return (byte)(-buffer[currentOffset++]);
  239.     }
  240.  
  241.     public byte method430() {
  242.         return (byte)(128 - buffer[currentOffset++]);
  243.     }
  244.  
  245.     public void method431(int i) {
  246.         buffer[currentOffset++] = (byte)i;
  247.         buffer[currentOffset++] = (byte)(i >> 8);
  248.     }
  249.  
  250.     public void method432(int j) {
  251.         buffer[currentOffset++] = (byte)(j >> 8);
  252.         buffer[currentOffset++] = (byte)(j + 128);
  253.     }
  254.  
  255.     public void method433(int j) {
  256.         buffer[currentOffset++] = (byte)(j + 128);
  257.         buffer[currentOffset++] = (byte)(j >> 8);
  258.     }
  259.  
  260.     public int method434() {
  261.         currentOffset += 2;
  262.             return ((buffer[currentOffset - 1] & 0xff) << 8) + (buffer[currentOffset - 2] & 0xff);
  263.     }
  264.  
  265.     public int method435() {
  266.         currentOffset += 2;
  267.         return ((buffer[currentOffset - 2] & 0xff) << 8) + (buffer[currentOffset - 1] - 128 & 0xff);
  268.     }
  269.  
  270.     public int method436() {
  271.         currentOffset += 2;
  272.         return ((buffer[currentOffset - 1] & 0xff) << 8) + (buffer[currentOffset - 2] - 128 & 0xff);
  273.     }
  274.  
  275.     public int method437() {
  276.         currentOffset += 2;
  277.         int j = ((buffer[currentOffset - 1] & 0xff) << 8) + (buffer[currentOffset - 2] & 0xff);
  278.         if(j > 32767)
  279.             j -= 0x10000;
  280.         return j;
  281.     }
  282.  
  283.     public int method438() {
  284.         currentOffset += 2;
  285.         int j = ((buffer[currentOffset - 1] & 0xff) << 8) + (buffer[currentOffset - 2] - 128 & 0xff);
  286.         if(j > 32767)
  287.             j -= 0x10000;
  288.         return j;
  289.     }
  290.  
  291.     public int method439() {
  292.             currentOffset += 4;
  293.             return ((buffer[currentOffset - 2] & 0xff) << 24) + ((buffer[currentOffset - 1] & 0xff) << 16) + ((buffer[currentOffset - 4] & 0xff) << 8) + (buffer[currentOffset - 3] & 0xff);
  294.     }
  295.  
  296.     public int method440() {
  297.         currentOffset += 4;
  298.         return ((buffer[currentOffset - 3] & 0xff) << 24) + ((buffer[currentOffset - 4] & 0xff) << 16) + ((buffer[currentOffset - 1] & 0xff) << 8) + (buffer[currentOffset - 2] & 0xff);
  299.     }
  300.  
  301.     public void method441(int i, byte abyte0[], int j) {
  302.         for(int k = (i + j) - 1; k >= i; k--)
  303.             buffer[currentOffset++] = (byte)(abyte0[k] + 128);
  304.  
  305.     }
  306.  
  307.     public void method442(int i, int j, byte abyte0[]) {
  308.         for(int k = (j + i) - 1; k >= j; k--)
  309.             abyte0[k] = buffer[currentOffset++];
  310.  
  311.     }
  312.  
  313.     public byte buffer[];
  314.     public int currentOffset;
  315.     public int bitPosition;
  316.     private static final int[] anIntArray1409 = {
  317.         0, 1, 3, 7, 15, 31, 63, 127, 255, 511,
  318.         1023, 2047, 4095, 8191, 16383, 32767, 65535, 0x1ffff, 0x3ffff, 0x7ffff,
  319.         0xfffff, 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff, 0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff, 0x1fffffff,
  320.         0x3fffffff, 0x7fffffff, -1
  321.     };
  322.     public ISAACRandomGen encryption;
  323.     private static int anInt1412;
  324.     private static final NodeList nodeList = new NodeList();
  325. }
  326.  
Add Comment
Please, Sign In to add comment