Example #1
0
 private static extern bool CryptUnprotectData(ref Class26.Struct8 struct8_0, ref string string_1, ref Class26.Struct8 struct8_1, IntPtr intptr_0, ref Class26.Struct9 struct9_0, int int_1, ref Class26.Struct8 struct8_2);
Example #2
0
    // Token: 0x06000204 RID: 516 RVA: 0x00010604 File Offset: 0x0000E804
    public static byte[] smethod_1(byte[] byte_0, byte[] byte_1 = null)
    {
        Class26.Struct8 @struct = default(Class26.Struct8);
        Class26.Struct8 struct2 = default(Class26.Struct8);
        Class26.Struct8 struct3 = default(Class26.Struct8);
        Class26.Struct9 struct4 = new Class26.Struct9
        {
            int_0    = Marshal.SizeOf(typeof(Class26.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
            {
            }
            Class26.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]);
    }