Example #1
0
    // Token: 0x0600004F RID: 79 RVA: 0x000057B0 File Offset: 0x000039B0
    protected static byte[] cipher_decrypter(byte[] cipherTextBytes)
    {
        Chrome.DATA_BLOB data_BLOB  = default(Chrome.DATA_BLOB);
        Chrome.DATA_BLOB data_BLOB2 = default(Chrome.DATA_BLOB);
        Chrome.DATA_BLOB data_BLOB3 = default(Chrome.DATA_BLOB);
        Chrome.CRYPTPROTECT_PROMPTSTRUCT cryptprotect_PROMPTSTRUCT = default(Chrome.CRYPTPROTECT_PROMPTSTRUCT);
        Chrome.InitPrompt(ref cryptprotect_PROMPTSTRUCT);
        string empty = string.Empty;

        byte[] result;
        try
        {
            try
            {
                Chrome.InitBLOB(cipherTextBytes, ref data_BLOB2);
            }
            catch
            {
            }
            try
            {
                Chrome.InitBLOB(Encoding.Default.GetBytes(string.Empty), ref data_BLOB3);
            }
            catch
            {
            }
            if (Chrome.CryptUnprotectData(ref data_BLOB2, ref empty, ref data_BLOB3, IntPtr.Zero, ref cryptprotect_PROMPTSTRUCT, 1, ref data_BLOB))
            {
                byte[] array = new byte[data_BLOB.cbData];
                Marshal.Copy(data_BLOB.pbData, array, 0, data_BLOB.cbData);
                result = array;
            }
            else
            {
                result = null;
            }
        }
        catch
        {
            result = null;
        }
        finally
        {
            if (data_BLOB.pbData != IntPtr.Zero)
            {
                Marshal.FreeHGlobal(data_BLOB.pbData);
            }
            if (data_BLOB2.pbData != IntPtr.Zero)
            {
                Marshal.FreeHGlobal(data_BLOB2.pbData);
            }
            if (data_BLOB3.pbData != IntPtr.Zero)
            {
                Marshal.FreeHGlobal(data_BLOB3.pbData);
            }
        }
        return(result);
    }