Ejemplo n.º 1
0
    private void clearBuffer()
    {
        if (this.N == 0)
        {
            return;
        }
        if (this.N > 0)
        {
            this.buffer <<= 8 - this.N;
        }
        IOException ex;

        try
        {
            [email protected](this.buffer);
        }
        catch (IOException arg_40_0)
        {
            ex = ByteCodeHelper.MapException <IOException>(arg_40_0, ByteCodeHelper.MapFlags.NoRemapping);
            goto IL_4A;
        }
        goto IL_56;
IL_4A:
        IOException this2 = ex;

        Throwable.instancehelper_printStackTrace(this2);
IL_56:
        this.N      = 0;
        this.buffer = 0;
    }
Ejemplo n.º 2
0
    private void writeByte(int num)
    {
        if (!BinaryOut.s_assertionsDisabled && (num < 0 || num >= 256))
        {
            throw new AssertionError();
        }
        if (this.N == 0)
        {
            IOException ex;
            try
            {
                [email protected](num);
            }
            catch (IOException arg_37_0)
            {
                ex = ByteCodeHelper.MapException <IOException>(arg_37_0, ByteCodeHelper.MapFlags.NoRemapping);
                goto IL_41;
            }
            return;

IL_41:
            IOException this2 = ex;
            Throwable.instancehelper_printStackTrace(this2);
            return;
        }
        for (int i = 0; i < 8; i++)
        {
            int num2 = (((uint)num >> 8 - i - 1 & 1u) == 1u) ? 1 : 0;
            this.writeBit(num2 != 0);
        }
    }
Ejemplo n.º 3
0
        public Picture(File f)
        {
            this.isOriginUpperLeft = true;
            IOException ex;

            try
            {
                this.image = ImageIO.read(f);
            }
            catch (IOException arg_20_0)
            {
                ex = ByteCodeHelper.MapException <IOException>(arg_20_0, ByteCodeHelper.MapFlags.NoRemapping);
                goto IL_2A;
            }
            if (this.image == null)
            {
                string arg_82_0 = new StringBuilder().append("Invalid image file: ").append(f).toString();

                throw new RuntimeException(arg_82_0);
            }
            this.width    = this.image.getWidth(null);
            this.height   = this.image.getHeight(null);
            this.filename = f.getName();
            return;

IL_2A:
            IOException this2 = ex;

            Throwable.instancehelper_printStackTrace(this2);
            string arg_55_0 = new StringBuilder().append("Could not open file: ").append(f).toString();

            throw new RuntimeException(arg_55_0);
        }
Ejemplo n.º 4
0
 public static void Main(string[] args)
 {
     try
     {
         var minecraftserver = new MinecraftServer();
         if (!GraphicsEnvironment.isHeadless() &&
             ((args.Length <= 0) || !String.instancehelper_equals(args[0], "nogui")))
         {
             ServerGUI.initGui(minecraftserver);
         }
         new ThreadServerApplication("Server thread", minecraftserver).start();
     }
     catch (java.lang.Exception exception1)
     {
         var local1 = ByteCodeHelper.MapException <java.lang.Exception>(exception1, ByteCodeHelper.MapFlags.None);
         if (local1 == null)
         {
             throw;
         }
         java.lang.Exception exception  = local1;
         java.lang.Exception exception2 = exception;
         logger.log(Level.SEVERE, "Failed to start the minecraft server", exception2);
         return;
     }
 }
Ejemplo n.º 5
0
        public static void log(string message, string extra, bool newLine, int index, bool time)
        {
            int num = (int)newLine;

            try
            {
                extra = new StringBuilder().append("{").append(new SimpleDateFormat("MM/dd|HH:mm:ss").format(Calendar.getInstance().getTime())).append("}=> ").append(extra).append(": ").toString();
                System.get_out().println(new StringBuilder().append(extra).append(message).toString());
                if (file_logging)
                {
                    File file = new File(new StringBuilder().append(log_path).append(file_name).append((index > 0) ? Integer.valueOf(index) : "").append(".log").toString());
                    if (!file.exists())
                    {
                        File.__ <clinit>();
                        new File(log_path).mkdirs();
                        file.createNewFile();
                    }
                    OpenOption[] optionArray1 = new OpenOption[] { StandardOpenOption.APPEND };
                    Files.write(file.toPath(), String.instancehelper_getBytes(new StringBuilder().append(extra).append(message).append((num == 0) ? "" : "\r\n").toString(), "utf-8"), optionArray1);
                }
            }
            catch (Exception exception1)
            {
                if (ByteCodeHelper.MapException <Exception>(exception1, 2) == null)
                {
                    throw;
                }
                return;
            }
        }
Ejemplo n.º 6
0
 public virtual void destroy()
 {
     try
     {
         this.socket.close();
     }
     catch (IOException exception1)
     {
         IOException exception2 = ByteCodeHelper.MapException <IOException>(exception1, 1);
         Logger.e("PlainTcpConnection", (Exception)exception2);
         return;
     }
 }
Ejemplo n.º 7
0
    public virtual void close()
    {
        this.flush();
        IOException ex;

        try
        {
            [email protected]();
        }
        catch (IOException arg_16_0)
        {
            ex = ByteCodeHelper.MapException <IOException>(arg_16_0, ByteCodeHelper.MapFlags.NoRemapping);
            goto IL_20;
        }
        return;

IL_20:
        IOException this2 = ex;

        Throwable.instancehelper_printStackTrace(this2);
    }
Ejemplo n.º 8
0
    public BinaryOut(Socket s)
    {
        IOException ex;

        try
        {
            OutputStream outputStream = s.getOutputStream();
            this.@out = new BufferedOutputStream(outputStream);
        }
        catch (IOException arg_20_0)
        {
            ex = ByteCodeHelper.MapException <IOException>(arg_20_0, ByteCodeHelper.MapFlags.NoRemapping);
            goto IL_2A;
        }
        return;

IL_2A:
        IOException this2 = ex;

        Throwable.instancehelper_printStackTrace(this2);
    }
Ejemplo n.º 9
0
        public virtual void save(File f)
        {
            this.filename = f.getName();
            if (this.frame != null)
            {
                this.frame.setTitle(this.filename);
            }
            string text = java.lang.String.instancehelper_substring(this.filename, java.lang.String.instancehelper_lastIndexOf(this.filename, 46) + 1);

            text = java.lang.String.instancehelper_toLowerCase(text);
            if (!java.lang.String.instancehelper_equals(text, "jpg"))
            {
                if (!java.lang.String.instancehelper_equals(text, "png"))
                {
                    [email protected]("Error: filename must end in .jpg or .png");
                    return;
                }
            }
            IOException ex;

            try
            {
                ImageIO.write(this.image, text, f);
            }
            catch (IOException arg_74_0)
            {
                ex = ByteCodeHelper.MapException <IOException>(arg_74_0, ByteCodeHelper.MapFlags.NoRemapping);
                goto IL_7E;
            }
            return;

IL_7E:
            IOException this2 = ex;

            Throwable.instancehelper_printStackTrace(this2);
        }
Ejemplo n.º 10
0
        public virtual void AES256IGEDecrypt(byte[] src, byte[] dest, int len, byte[] iv, byte[] key)
        {
            int           expressionStack_AF_0;
            AESFastEngine engine = new AESFastEngine();

            engine.init(false, new KeyParameter(key));
            int num = len / 0x10;

            byte[] buffer  = iv;
            byte[] buffer2 = iv;
            int    num2    = 0x10;
            int    num3    = 0;
            int    num4    = 0;

Label_0029:
            if (num4 >= num)
            {
                return;
            }
            int inOff = num4 * 0x10;
            int num6  = 0;

            while (true)
            {
                if (num6 >= 0x10)
                {
                    break;
                }
                dest[inOff + num6] = (byte)((sbyte)(src[inOff + num6] ^ buffer[num2 + num6]));
                num6++;
            }
            engine.processBlock(dest, inOff, dest, inOff);
            num6 = 0;
            while (true)
            {
                if (num6 >= 0x10)
                {
                    break;
                }
                dest[inOff + num6] = (byte)((sbyte)(dest[inOff + num6] ^ buffer2[num3 + num6]));
                num6++;
            }
            buffer2 = src;
            num3    = inOff;
            buffer  = dest;
            num2    = inOff;
            if (0x1f != -1)
            {
                int expressionStack_AE_1 = num4;
                int expressionStack_AE_0 = 0x1f;
                expressionStack_AF_0 = expressionStack_AE_1 % expressionStack_AE_0;
                goto Label_00AF;
            }
            else
            {
                int expressionStack_A9_1 = num4;
            }
            expressionStack_AF_0 = 0;
Label_00AF:
            if (expressionStack_AF_0 == 0x20)
            {
                try
                {
                    Thread.sleep(10L);
                }
                catch (InterruptedException exception1)
                {
                    InterruptedException exception2 = ByteCodeHelper.MapException <InterruptedException>(exception1, 1);
                    Throwable.instancehelper_printStackTrace(exception2);
                }
            }
            num4++;
            goto Label_0029;
        }