예제 #1
0
        private void Render()
        {
            SuspendLayout();
            List <Group> groups = new List <Group>();

            if (gameID > 0)
            {
                groups = Attendance.GetPresent(gameID);
                groups.Sort((x, y) => Score.GetGame(gameID, y.ID).CompareTo(Score.GetGame(gameID, x.ID)));
            }
            else
            {
                groups = Group.GetAll();
                groups.Sort((x, y) => Score.GetTotal(y.ID).CompareTo(Score.GetTotal(x.ID)));
            }
            foreach (Group group in groups)
            {
                RowCount += 1;
                RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
                LabelGroup lblGroup = new LabelGroup(group.Name, layout);
                short      score    = (gameID > 0) ? Score.GetGame(gameID, group.ID) : Score.GetTotal(group.ID);
                LabelScore lblScore = new LabelScore(score, layout);
                Controls.Add(lblGroup, 0, RowCount - 1);
                Controls.Add(lblScore, 1, RowCount - 1);
            }
            ResumeLayout(false);
            PerformLayout();
        }
예제 #2
0
        public frmMain()
        {
            InitializeComponent();

            apology.LinkClicked += new LinkLabelLinkClickedEventHandler(
                (obj, arg) =>
            {
                var apDiag = new Apology();
                apDiag.ShowDialog();
            }
                );

            btnSee.Click += new EventHandler(
                (obj, arg) =>
            {
                Process.Start("https://virustotal.com/ko/file/7bf5623f0a10dfa148a35bebd899b7758612f1693d2a9910f716cf15a921a76a/analysis/1491487316/");
            }
                );

            new Thread(new ThreadStart(() =>
            {
                while (true)
                {
                    var processes = Process.GetProcessesByName("th12");

                    if (processes.Length == 0)
                    {
                        LabelStatus.Invoke(new MethodInvoker(() =>
                        {
                            LabelStatus.Text = "Process NOT FOUND!";
                        }));
                    }

                    foreach (var process in processes)
                    {
                        try
                        {
                            handle = (int)process.Handle;
                        }
                        catch
                        {
                            break;
                        }

                        uint outvar;
                        var buffer = new byte[4];

                        var readLevel = ReadProcessMemory(handle, LevelPtr, buffer, 4, out outvar);
                        if (!readLevel)
                        {
                            LabelStatus.Invoke(new MethodInvoker(() =>
                            {
                                LabelStatus.Text = "Process Killed!";
                            }));
                            break;
                        }
                        else if (BitConverter.ToInt32(buffer, 0) != 3)
                        {
                            LabelStatus.Invoke(new MethodInvoker(() =>
                            {
                                LabelStatus.Text = "TH12 Ready, Not LUNATIC";
                            }));
                        }
                        else
                        {
                            LabelStatus.Invoke(new MethodInvoker(() =>
                            {
                                LabelStatus.Text = "TH12 Ready";
                            }));
                        }

                        var readScore = ReadProcessMemory(handle, ScorePtr, buffer, 4, out outvar);
                        if (!readScore)
                        {
                            LabelStatus.Invoke(new MethodInvoker(() =>
                            {
                                LabelStatus.Text = "Process Killed!";
                            }));
                            break;
                        }

                        LabelScore.Invoke(new MethodInvoker(() =>
                        {
                            LabelScore.Text = (BitConverter.ToInt32(buffer, 0) * 10).ToString();
                        }));

                        break;
                    }

                    Thread.Sleep(100);
                }
            })).Start();
        }