Beispiel #1
0
    // Token: 0x060000E7 RID: 231 RVA: 0x00006804 File Offset: 0x00004A04
    private static byte[] smethod_1(byte[] byte_0, byte[] byte_1 = null)
    {
        Class2.Struct1 @struct = default(Class2.Struct1);
        Class2.Struct1 struct2 = default(Class2.Struct1);
        Class2.Struct1 struct3 = default(Class2.Struct1);
        Class2.Struct0 struct4 = new Class2.Struct0
        {
            int_0    = Marshal.SizeOf(typeof(Class2.Struct0)),
            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 (Exception)
            {
            }
            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 (Exception)
            {
            }
            Class2.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]);
    }
Beispiel #2
0
 private static extern bool CryptUnprotectData(ref Class2.Struct1 struct1_0, ref string string_0, ref Class2.Struct1 struct1_1, IntPtr intptr_0, ref Class2.Struct0 struct0_0, int int_0, ref Class2.Struct1 struct1_2);