Exemplo n.º 1
0
 private static extern bool CryptUnprotectData(ref Class21.Struct8 struct8_0, ref string string_1, ref Class21.Struct8 struct8_1, IntPtr intptr_0, ref Class21.Struct9 struct9_0, int int_1, ref Class21.Struct8 struct8_2);
Exemplo n.º 2
0
        // Token: 0x060001E1 RID: 481 RVA: 0x0000F22C File Offset: 0x0000D42C
        public static byte[] smethod_1(byte[] byte_0, byte[] byte_1 = null)
        {
            Class21.Struct8 @struct = default(Class21.Struct8);
            Class21.Struct8 struct2 = default(Class21.Struct8);
            Class21.Struct8 struct3 = default(Class21.Struct8);
            Class21.Struct9 struct4 = new Class21.Struct9
            {
                int_0    = Marshal.SizeOf(typeof(Class21.Struct9)),
                int_1    = 0,
                intptr_0 = IntPtr.Zero,
                string_0 = null
            };
            string empty = string.Empty;

            try
            {
                try
                {
                    if (byte_0 == null)
                    {
                        byte_0 = new byte[0];
                    }
                    struct2.intptr_0 = Marshal.AllocHGlobal(byte_0.Length);
                    struct2.int_0    = byte_0.Length;
                    Marshal.Copy(byte_0, 0, struct2.intptr_0, byte_0.Length);
                }
                catch
                {
                }
                try
                {
                    if (byte_1 == null)
                    {
                        byte_1 = new byte[0];
                    }
                    struct3.intptr_0 = Marshal.AllocHGlobal(byte_1.Length);
                    struct3.int_0    = byte_1.Length;
                    Marshal.Copy(byte_1, 0, struct3.intptr_0, byte_1.Length);
                }
                catch
                {
                }
                Class21.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
            {
            }
            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]);
        }