Example #1
0
        public override void vmethod_0()
        {
            if (_arrayList0 == null)
            {
                return;
            }
            if (_class1930 != null)
            {
                method_11();
            }
            long num  = _arrayList0.Count;
            var  num2 = 0L;

            foreach (Class193 @class in _arrayList0)
            {
                method_8(33639248);
                method_7(45);
                method_7(@class.method_11());
                method_7(@class.method_4());
                method_7((short)@class.method_27());
                method_8((int)@class.method_17());
                method_8((int)@class.method_25());
                if ([email protected]_14() && @class.method_23() < 4294967295L)
                {
                    method_8((int)@class.method_23());
                }
                else
                {
                    method_8(-1);
                }
                if ([email protected]_14() && @class.method_21() < 4294967295L)
                {
                    method_8((int)@class.method_21());
                }
                else
                {
                    method_8(-1);
                }
                var array = Class186.smethod_4(@class.method_4(), @class.method_20());
                if (array.Length > 65535)
                {
                    throw new ZipException("Name too long.");
                }
                var class2 = new Class202(@class.method_29());
                if (@class.method_16())
                {
                    class2.method_8();
                    if (@class.method_14() || @class.method_21() >= 4294967295L)
                    {
                        class2.method_12(@class.method_21());
                    }
                    if (@class.method_14() || @class.method_23() >= 4294967295L)
                    {
                        class2.method_12(@class.method_23());
                    }
                    if (@class.method_6() >= 4294967295L)
                    {
                        class2.method_12(@class.method_6());
                    }
                    class2.method_9(1);
                }
                else
                {
                    class2.method_13(1);
                }
                var array2 = class2.method_0();
                var array3 = (@class.method_32() != null)
                    ? Class186.smethod_4(@class.method_4(), @class.method_32())
                    : new byte[0];
                if (array3.Length > 65535)
                {
                    throw new ZipException("Comment too long.");
                }
                method_7(array.Length);
                method_7(array2.Length);
                method_7(array3.Length);
                method_7(0);
                method_7(0);
                if (@class.method_8() != -1)
                {
                    method_8(@class.method_8());
                }
                else if (@class.method_33())
                {
                    method_8(16);
                }
                else
                {
                    method_8(0);
                }
                if (@class.method_6() >= 4294967295L)
                {
                    method_8(-1);
                }
                else
                {
                    method_8((int)@class.method_6());
                }
                if (array.Length > 0)
                {
                    Stream0.Write(array, 0, array.Length);
                }
                if (array2.Length > 0)
                {
                    Stream0.Write(array2, 0, array2.Length);
                }
                if (array3.Length > 0)
                {
                    Stream0.Write(array3, 0, array3.Length);
                }
                num2 += 46 + array.Length + array2.Length + array3.Length;
            }
            using (var stream = new Stream25(Stream0))
            {
                stream.method_1(num, num2, _long1, _byte1);
            }
            _arrayList0 = null;
        }
Example #2
0
        public void method_10(Class193 class1931)
        {
            if (class1931 == null)
            {
                throw new ArgumentNullException("entry");
            }
            if (_arrayList0 == null)
            {
                throw new InvalidOperationException("ZipOutputStream was finished");
            }
            if (_class1930 != null)
            {
                method_11();
            }
            if (_arrayList0.Count == 2147483647)
            {
                throw new ZipException("Too many entries for Zip file");
            }
            var @enum = class1931.method_27();
            var int_  = _int0;

            class1931.method_5(class1931.method_4() & 2048);
            _bool2 = false;
            var flag = true;

            if (@enum == Enum31.Const0)
            {
                class1931.method_5(class1931.method_4() & -9);
                if (class1931.method_23() >= 0L)
                {
                    if (class1931.method_21() < 0L)
                    {
                        class1931.method_22(class1931.method_23());
                    }
                    else if (class1931.method_21() != class1931.method_23())
                    {
                        throw new ZipException("Method STORED, but compressed size != size");
                    }
                }
                else if (class1931.method_21() >= 0L)
                {
                    class1931.method_24(class1931.method_21());
                }
                if (class1931.method_21() < 0L || class1931.method_25() < 0L)
                {
                    if (method_0())
                    {
                        flag = false;
                    }
                    else
                    {
                        @enum = Enum31.Const1;
                        int_  = 0;
                    }
                }
            }
            if (@enum == Enum31.Const1)
            {
                if (class1931.method_21() == 0L)
                {
                    class1931.method_24(class1931.method_21());
                    class1931.method_26(0L);
                    @enum = Enum31.Const0;
                }
                else if (class1931.method_23() < 0L || class1931.method_21() < 0L || class1931.method_25() < 0L)
                {
                    flag = false;
                }
            }
            if (!flag)
            {
                if (!method_0())
                {
                    class1931.method_5(class1931.method_4() | 8);
                }
                else
                {
                    _bool2 = true;
                }
            }
            if (method_1() != null)
            {
                class1931.method_1(true);
                if (class1931.method_25() < 0L)
                {
                    class1931.method_5(class1931.method_4() | 8);
                }
            }
            class1931.method_7(_long1);
            class1931.method_28(@enum);
            _enum310 = @enum;
            _long3   = -1L;
            if (_enum300 == Enum30.Const1 || (class1931.method_21() < 0L && _enum300 == Enum30.Const2))
            {
                class1931.method_13();
            }
            method_8(67324752);
            method_7(class1931.method_11());
            method_7(class1931.method_4());
            method_7((byte)@enum);
            method_8((int)class1931.method_17());
            if (flag)
            {
                method_8((int)class1931.method_25());
                if (class1931.method_15())
                {
                    method_8(-1);
                    method_8(-1);
                }
                else
                {
                    method_8(class1931.method_0() ? ((int)class1931.method_23() + 12) : ((int)class1931.method_23()));
                    method_8((int)class1931.method_21());
                }
            }
            else
            {
                if (_bool2)
                {
                    _long2 = Stream0.Position;
                }
                method_8(0);
                if (_bool2)
                {
                    _long3 = Stream0.Position;
                }
                if (class1931.method_15() && _bool2)
                {
                    method_8(-1);
                    method_8(-1);
                }
                else
                {
                    method_8(0);
                    method_8(0);
                }
            }
            var array = Class186.smethod_4(class1931.method_4(), class1931.method_20());

            if (array.Length > 65535)
            {
                throw new ZipException("Entry name too long.");
            }
            var @class = new Class202(class1931.method_29());

            if (class1931.method_15() && (flag || _bool2))
            {
                @class.method_8();
                if (flag)
                {
                    @class.method_12(class1931.method_21());
                    @class.method_12(class1931.method_23());
                }
                else
                {
                    @class.method_12(-1L);
                    @class.method_12(-1L);
                }
                @class.method_9(1);
                if ([email protected]_6(1))
                {
                    throw new ZipException("Internal error cant find extra data");
                }
                if (_bool2)
                {
                    _long3 = @class.method_4();
                }
            }
            else
            {
                @class.method_13(1);
            }
            var array2 = @class.method_0();

            method_7(array.Length);
            method_7(array2.Length);
            if (array.Length > 0)
            {
                Stream0.Write(array, 0, array.Length);
            }
            if (class1931.method_15() && _bool2)
            {
                _long3 += Stream0.Position;
            }
            if (array2.Length > 0)
            {
                Stream0.Write(array2, 0, array2.Length);
            }
            _long1    += 30 + array.Length + array2.Length;
            _class1930 = class1931;
            _class1920.vmethod_1();
            if (@enum == Enum31.Const1)
            {
                Class1940.method_0();
                Class1940.method_7(int_);
            }
            _long0 = 0L;
            if (class1931.method_0())
            {
                if (class1931.method_25() < 0L)
                {
                    method_12(class1931.method_17() << 16);
                    return;
                }
                method_12(class1931.method_25());
            }
        }
Example #3
0
        public void method_31(bool bool1)
        {
            var @class = new Class202(_byte0);

            if (@class.method_6(1))
            {
                if ((_ushort1 & 255) < 45)
                {
                    throw new ZipException("Zip64 Extended information found but version is not valid");
                }
                _bool0 = true;
                if (@class.method_3() < 4)
                {
                    throw new ZipException("Extra data extended Zip64 information length is invalid");
                }
                if (bool1 || _ulong0 == 4294967295uL)
                {
                    _ulong0 = (ulong)@class.method_14();
                }
                if (bool1 || _ulong1 == 4294967295uL)
                {
                    _ulong1 = (ulong)@class.method_14();
                }
                if (!bool1 && _long1 == 4294967295L)
                {
                    _long1 = @class.method_14();
                }
            }
            else if ((_ushort1 & 255) >= 45 && (_ulong0 == 4294967295uL || _ulong1 == 4294967295uL))
            {
                throw new ZipException("Zip64 Extended information required but is missing.");
            }
            if (@class.method_6(10))
            {
                if (@class.method_3() < 8)
                {
                    throw new ZipException("NTFS Extra data invalid");
                }
                @class.method_15();
                while (@class.method_5() >= 4)
                {
                    var num  = @class.method_16();
                    var num2 = @class.method_16();
                    if (num == 1)
                    {
                        if (num2 >= 24)
                        {
                            var fileTime = @class.method_14();
                            @class.method_14();
                            @class.method_14();
                            method_19(DateTime.FromFileTime(fileTime));
                            return;
                        }
                        return;
                    }
                    @class.method_18(num2);
                }
            }
            else if (@class.method_6(21589))
            {
                var num3 = @class.method_3();
                var num4 = @class.method_17();
                if ((num4 & 1) != 0 && num3 >= 5)
                {
                    var seconds = @class.method_15();
                    method_19((new DateTime(1970, 1, 1, 0, 0, 0).ToUniversalTime() + new TimeSpan(0, 0, 0, seconds, 0))
                              .ToLocalTime());
                }
            }
        }