コード例 #1
0
        // Token: 0x06001E3A RID: 7738 RVA: 0x00061D90 File Offset: 0x0005FF90
        private static void smethod_2(Class321 pd, BinaryWriter write_stream, uint add_length, byte[] add_buffer, uint copy_length, uint copy_pos)
        {
            if (add_length == 0U && copy_length == 0U)
            {
                return;
            }
            uint num = 0U;

            while (add_length > 65535U)
            {
                Class292.smethod_1(write_stream, 65535U, add_buffer, num);
                num        += 65535U;
                add_length -= 65535U;
                Class292.smethod_0(pd, write_stream, 0U, 0U);
            }
            Class292.smethod_1(write_stream, add_length, add_buffer, num);
            while (copy_length > 65535U)
            {
                Class292.smethod_0(pd, write_stream, 65535U, copy_pos);
                copy_pos    += 65535U;
                copy_length -= 65535U;
                Class292.smethod_1(write_stream, 0U, null, 0U);
            }
            Class292.smethod_0(pd, write_stream, copy_length, copy_pos);
        }
コード例 #2
0
        // Token: 0x06001E42 RID: 7746 RVA: 0x000620F8 File Offset: 0x000602F8
        private static void smethod_10(byte[] buffer_orig, uint length_orig, uint[] hash_table, uint[] link_table)
        {
            int num = 0;

            while ((long)num < 16777216L)
            {
                hash_table[num] = uint.MaxValue;
                num++;
            }
            int num2 = 0;

            while ((long)num2 < (long)((ulong)length_orig))
            {
                link_table[num2] = uint.MaxValue;
                num2++;
            }
            if (length_orig < 9U)
            {
                return;
            }
            uint num3 = 0U;

            while ((ulong)num3 < (ulong)((long)(buffer_orig.Length - 9)))
            {
                uint num4 = Class292.smethod_9(buffer_orig, num3);
                link_table[(int)((UIntPtr)num3)] = hash_table[(int)((UIntPtr)num4)];
                hash_table[(int)((UIntPtr)num4)] = num3;
                num3 += 1U;
            }
        }
コード例 #3
0
        // Token: 0x06001E4B RID: 7755 RVA: 0x000628E8 File Offset: 0x00060AE8
        public static void smethod_17(Stream compressed_patch_stream, string destination_file, uint?overrideExpectedStartingFileLength, Struct43 overrideExpectedStartingHash, uint?overrideExpectedResultingFileLength, Struct43 overrideExpectedResultingHash, EventHandler <EventArgs9> progressChanged)
        {
            string text = destination_file + ".tmp";

            try
            {
                using (MemoryStream memoryStream = new MemoryStream())
                {
                    Class219.smethod_0(compressed_patch_stream, memoryStream, false);
                    memoryStream.Position = 0L;
                    Class234.smethod_14(destination_file, text, true);
                    using (Stream stream = File.Open(text, FileMode.Open, FileAccess.Read, FileShare.None))
                    {
                        using (Stream stream2 = File.Open(destination_file, FileMode.Create, FileAccess.ReadWrite, FileShare.None))
                        {
                            Class292 @class = new Class292();
                            if (progressChanged != null)
                            {
                                @class.ProgressChanged += progressChanged;
                            }
                            @class.method_1(stream, memoryStream, stream2, overrideExpectedStartingFileLength, overrideExpectedStartingHash, overrideExpectedResultingFileLength, overrideExpectedResultingHash, false, false);
                        }
                    }
                }
            }
            finally
            {
                if (File.Exists(text))
                {
                    File.Delete(text);
                }
            }
        }
コード例 #4
0
        // Token: 0x06001E44 RID: 7748 RVA: 0x00062274 File Offset: 0x00060474
        public static void smethod_12(Class321 pd, Enum81 type, BinaryWriter write_stream, uint offset_orig, uint offset_new, Stream stream_orig, Stream stream_new)
        {
            switch (type)
            {
            case Enum81.const_1:
                if (!Class136.smethod_3(stream_orig, stream_new))
                {
                    type = Enum81.const_0;
                }
                break;

            case Enum81.const_2:
                if (!Class132.smethod_1(stream_orig, stream_new))
                {
                    type = Enum81.const_0;
                }
                break;
            }
            switch (type)
            {
            case Enum81.const_1:
                Class136.smethod_0(pd, write_stream, offset_orig, offset_new, stream_orig, stream_new);
                return;

            case Enum81.const_2:
                Class132.smethod_2(pd, write_stream, offset_orig, offset_new, stream_orig, stream_new);
                return;

            default:
                Class292.smethod_11(pd, write_stream, offset_orig, stream_orig, stream_new);
                return;
            }
        }
コード例 #5
0
 // Token: 0x06001E3C RID: 7740 RVA: 0x00061EAC File Offset: 0x000600AC
 public static void smethod_4(Class321 pd, BinaryWriter write_stream, uint add_length, byte[] add_buffer, uint start_pos, uint copy_length, uint copy_pos)
 {
     if (add_length != 0U)
     {
         if (pd.uint_3 != 0U)
         {
             Class292.smethod_3(pd, write_stream);
         }
         byte[] array = new byte[add_length];
         Array.Copy(add_buffer, (long)((ulong)start_pos), array, 0L, (long)((ulong)add_length));
         pd.queue_0.Enqueue(array);
     }
     if (copy_length != 0U)
     {
         if (pd.uint_3 == 0U)
         {
             pd.uint_4 = copy_pos;
             pd.uint_3 = copy_length;
             return;
         }
         if (pd.uint_4 + pd.uint_3 == copy_pos)
         {
             pd.uint_3 += copy_length;
             return;
         }
         Class292.smethod_3(pd, write_stream);
         pd.uint_4 = copy_pos;
         pd.uint_3 = copy_length;
     }
 }
コード例 #6
0
        // Token: 0x06001E46 RID: 7750 RVA: 0x00062378 File Offset: 0x00060578
        private static Enum81 smethod_14(string file1, string file2)
        {
            Enum81 @enum = Class292.smethod_15(file1);
            Enum81 enum2 = Class292.smethod_15(file2);

            if (@enum != enum2)
            {
                return(Enum81.const_0);
            }
            return(@enum);
        }
コード例 #7
0
 // Token: 0x06001E45 RID: 7749 RVA: 0x000622F0 File Offset: 0x000604F0
 public static void smethod_13(string originalFile, string newFile, string patchFile)
 {
     using (Stream stream = File.Open(originalFile, FileMode.Open, FileAccess.Read, FileShare.None))
     {
         using (Stream stream2 = File.Open(newFile, FileMode.Open, FileAccess.Read, FileShare.None))
         {
             using (Stream stream3 = File.Open(patchFile, FileMode.Create, FileAccess.Write, FileShare.None))
             {
                 Class292.smethod_16(stream, stream2, stream3, Class292.smethod_14(originalFile, newFile));
             }
         }
     }
 }
コード例 #8
0
        // Token: 0x06001E43 RID: 7747 RVA: 0x00062160 File Offset: 0x00060360
        private static void smethod_11(Class321 pd, BinaryWriter write_stream, uint offset_orig, Stream stream_orig, Stream stream_new)
        {
            uint num  = (uint)stream_orig.Length;
            uint num2 = (uint)stream_new.Length;

            stream_orig.Position = 0L;
            stream_new.Position  = 0L;
            byte[] array  = new byte[num];
            byte[] array2 = new byte[num2];
            stream_orig.smethod_6(array);
            stream_new.smethod_6(array2);
            uint[] link_table = new uint[num];
            if (pd.uint_6 == null)
            {
                pd.uint_6 = new uint[16777216];
            }
            Class292.smethod_10(array, num, pd.uint_6, link_table);
            uint num3 = 0U;
            uint num4 = 0U;

            if (num2 >= 9U)
            {
                while (num3 < num2 - 9U)
                {
                    uint   num5 = 0U;
                    ushort num6 = 0;
                    Class292.smethod_6(num3, ref num5, ref num6, pd.uint_6, link_table, array, num, array2, num2);
                    if (num6 < 9)
                    {
                        num3 += 1U;
                    }
                    else
                    {
                        int add_length = (int)(num3 - num4);
                        Class292.smethod_4(pd, write_stream, (uint)add_length, array2, num4, (uint)num6, num5 + offset_orig);
                        num3 += (uint)num6;
                        num4  = num3;
                    }
                }
            }
            if (num4 != num2)
            {
                uint num7 = num2 - num4;
                Class292.smethod_4(pd, write_stream, num7, array2, num4, 0U, 0U);
                num4 += num7;
            }
        }
コード例 #9
0
 // Token: 0x06001E48 RID: 7752 RVA: 0x000623E0 File Offset: 0x000605E0
 private static void smethod_16(Stream stream_orig, Stream stream_new, Stream stream_patch, Enum81 type)
 {
     using (Stream3 stream = new Stream3(stream_orig))
     {
         using (Stream3 stream2 = new Stream3(stream_new))
         {
             using (Stream3 stream3 = new Stream3(stream_patch))
             {
                 using (BinaryWriter binaryWriter = new BinaryWriter(stream3))
                 {
                     Class292.smethod_7(binaryWriter, stream, stream2);
                     Class321 @class = new Class321();
                     Class292.smethod_12(@class, type, binaryWriter, 0U, 0U, stream, stream2);
                     Class292.smethod_8(@class, binaryWriter);
                     @class.queue_0 = null;
                     @class.uint_6  = null;
                 }
             }
         }
     }
 }
コード例 #10
0
        // Token: 0x06001E3E RID: 7742 RVA: 0x00061FC4 File Offset: 0x000601C4
        private static void smethod_6(uint new_pos, ref uint copy_pos, ref ushort copy_length, uint[] hash_table, uint[] link_table, byte[] buffer_orig, uint length_orig, byte[] buffer_new, uint length_new)
        {
            copy_length = 0;
            uint num = Class292.smethod_9(buffer_new, new_pos);

            if (4294967295U == hash_table[(int)((UIntPtr)num)])
            {
                return;
            }
            copy_pos    = hash_table[(int)((UIntPtr)num)];
            copy_length = (ushort)Class292.smethod_5(buffer_new, new_pos, buffer_orig, copy_pos, Math.Min(Math.Min(length_new - new_pos, length_orig - copy_pos), 65535U), 0U);
            for (uint num2 = link_table[(int)((UIntPtr)copy_pos)]; num2 != 4294967295U; num2 = link_table[(int)((UIntPtr)num2)])
            {
                ushort num3 = (ushort)Class292.smethod_5(buffer_new, new_pos, buffer_orig, num2, Math.Min(Math.Min(length_new - new_pos, length_orig - num2), 65535U), (uint)copy_length);
                if (num3 > copy_length)
                {
                    copy_pos    = num2;
                    copy_length = num3;
                }
            }
        }
コード例 #11
0
        // Token: 0x06001E3B RID: 7739 RVA: 0x00061E24 File Offset: 0x00060024
        private static void smethod_3(Class321 pd, BinaryWriter write_stream)
        {
            IEnumerable <byte[]> queue_ = pd.queue_0;

            if (Class292.func_0 == null)
            {
                Class292.func_0 = new Func <byte[], int>(Class292.smethod_18);
            }
            uint num = (uint)queue_.Sum(Class292.func_0);

            byte[] array = new byte[num];
            int    num2  = 0;

            while (pd.queue_0.Count > 0)
            {
                byte[] array2 = pd.queue_0.Dequeue();
                array2.CopyTo(array, num2);
                num2 += array2.Length;
            }
            Class292.smethod_2(pd, write_stream, num, array, pd.uint_3, pd.uint_4);
            pd.uint_3 = 0U;
        }
コード例 #12
0
 // Token: 0x06001E40 RID: 7744 RVA: 0x0000B95F File Offset: 0x00009B5F
 private static void smethod_8(Class321 pd, BinaryWriter write_stream)
 {
     Class292.smethod_3(pd, write_stream);
     Class292.smethod_1(write_stream, 0U, null, 0U);
     Class292.smethod_0(pd, write_stream, 0U, 0U);
 }