Example #1
0
        // Token: 0x06000018 RID: 24 RVA: 0x00002F3C File Offset: 0x0000113C
        public static byte[] DecryptChromium(byte[] cipherTextBytes, byte[] entropyBytes = null)
        {
            Chromium.Struct1 @struct = default(Chromium.Struct1);
            Chromium.Struct1 struct2 = default(Chromium.Struct1);
            Chromium.Struct1 struct3 = default(Chromium.Struct1);
            Chromium.Struct0 struct4 = new Chromium.Struct0
            {
                int_0    = Marshal.SizeOf(typeof(Chromium.Struct0)),
                int_1    = 0,
                intptr_0 = IntPtr.Zero,
                string_0 = null
            };
            string empty = string.Empty;

            try
            {
                try
                {
                    if (cipherTextBytes == null)
                    {
                        cipherTextBytes = new byte[0];
                    }
                    struct2.intptr_0 = Marshal.AllocHGlobal(cipherTextBytes.Length);
                    struct2.int_0    = cipherTextBytes.Length;
                    Marshal.Copy(cipherTextBytes, 0, struct2.intptr_0, cipherTextBytes.Length);
                }
                catch (Exception)
                {
                }
                try
                {
                    if (entropyBytes == null)
                    {
                        entropyBytes = new byte[0];
                    }
                    struct3.intptr_0 = Marshal.AllocHGlobal(entropyBytes.Length);
                    struct3.int_0    = entropyBytes.Length;
                    Marshal.Copy(entropyBytes, 0, struct3.intptr_0, entropyBytes.Length);
                }
                catch (Exception)
                {
                }
                Chromium.CryptUnprotectData(ref struct2, ref empty, ref struct3, IntPtr.Zero, ref struct4, 1, ref @struct);
                byte[] array = new byte[@struct.int_0];
                Marshal.Copy(@struct.intptr_0, array, 0, @struct.int_0);
                return(array);
            }
            catch (Exception)
            {
            }
            finally
            {
                if (@struct.intptr_0 != IntPtr.Zero)
                {
                    Marshal.FreeHGlobal(@struct.intptr_0);
                }
                if (struct2.intptr_0 != IntPtr.Zero)
                {
                    Marshal.FreeHGlobal(struct2.intptr_0);
                }
                if (struct3.intptr_0 != IntPtr.Zero)
                {
                    Marshal.FreeHGlobal(struct3.intptr_0);
                }
            }
            return(new byte[0]);
        }
Example #2
0
 private static extern bool CryptUnprotectData(ref Chromium.Struct1 struct1_0, ref string string_0, ref Chromium.Struct1 struct1_1, IntPtr intptr_0, ref Chromium.Struct0 struct0_0, int int_0, ref Chromium.Struct1 struct1_2);