Exemplo n.º 1
0
 private void listLog_DoubleClick(object sender, EventArgs e)
 {
     using (InformationBox info = new InformationBox(Program.HackerWindow.Log[listLog.SelectedIndices[0]].Value))
     {
         info.ShowDialog();
     }
 }
Exemplo n.º 2
0
        private void buttonDiagnostics_Click(object sender, EventArgs e)
        {
            InformationBox box = new InformationBox(Program.GetDiagnosticInformation());

            box.DefaultFileName = "Process Hacker Diagnostics Info";
            box.ShowDialog();
        }
Exemplo n.º 3
0
 private void buttonDiagnostics_Click(object sender, EventArgs e)
 {
     using (InformationBox box = new InformationBox(Program.GetDiagnosticInformation()))
     {
         box.DefaultFileName = "Process Hacker Diagnostics Info";
         box.ShowDialog();
     }
 }
Exemplo n.º 4
0
        private void buttonChangelog_Click(object sender, EventArgs e)
        {
            try
            {
                InformationBox box = new InformationBox(System.IO.File.ReadAllText(Application.StartupPath + "\\CHANGELOG.txt"));

                box.ShowSaveButton = false;
                box.Title          = "Process Hacker Changelog";
                box.ShowDialog();
            }
            catch (Exception ex)
            {
                PhUtils.ShowException("Unable to view the changelog", ex);
            }
        }
Exemplo n.º 5
0
        private void buttonChangelog_Click(object sender, EventArgs e)
        {
            try
            {
                InformationBox box = new InformationBox(System.IO.File.ReadAllText(Application.StartupPath + "\\CHANGELOG.txt"));

                box.ShowSaveButton = false;
                box.Title = "Process Hacker Changelog";
                box.ShowDialog();
            }
            catch (Exception ex)
            {
                PhUtils.ShowException("Unable to view the changelog", ex);
            }
        }
Exemplo n.º 6
0
        private void listLog_DoubleClick(object sender, EventArgs e)
        {
            InformationBox info = new InformationBox(Program.HackerWindow.Log[listLog.SelectedIndices[0]].Value);

            info.ShowDialog();
        }
Exemplo n.º 7
0
        private void buttonValues_Click(object sender, EventArgs e)
        {
            string         values = "";
            InformationBox valuesForm;
            long           addr  = hexBoxMemory.SelectionStart;
            long           space = hexBoxMemory.ByteProvider.Length - hexBoxMemory.SelectionStart;

            if (space >= 1)
            {
                values += "\r\n\r\n8-bit Integer: " + hexBoxMemory.ByteProvider.ReadByte(addr).ToString();
            }

            if (space >= 2)
            {
                ushort value = 0;

                value   = (ushort)(hexBoxMemory.ByteProvider.ReadByte(addr + 1) << 8 | hexBoxMemory.ByteProvider.ReadByte(addr));
                values += "\r\n\r\n16-bit Integer, little-endian, unsigned: " + value.ToString();
                values += "\r\n16-bit Integer, little-endian, signed: " + ((short)value).ToString();

                value   = (ushort)(hexBoxMemory.ByteProvider.ReadByte(addr) << 8 | hexBoxMemory.ByteProvider.ReadByte(addr + 1));
                values += "\r\n16-bit Integer, big-endian, unsigned: " + value.ToString();
                values += "\r\n16-bit Integer, big-endian, signed: " + ((short)value).ToString();
            }

            if (space >= 4)
            {
                uint value = 0;

                value = ((uint)hexBoxMemory.ByteProvider.ReadByte(addr + 3) << 24) +
                        ((uint)hexBoxMemory.ByteProvider.ReadByte(addr + 2) << 16) +
                        ((uint)hexBoxMemory.ByteProvider.ReadByte(addr + 1) << 8) +
                        ((uint)hexBoxMemory.ByteProvider.ReadByte(addr));
                values += "\r\n\r\n32-bit Integer, little-endian, unsigned: " + value.ToString();
                values += "\r\n32-bit Integer, little-endian, signed: " + ((int)value).ToString();

                value = ((uint)hexBoxMemory.ByteProvider.ReadByte(addr) << 24) +
                        ((uint)hexBoxMemory.ByteProvider.ReadByte(addr + 1) << 16) +
                        ((uint)hexBoxMemory.ByteProvider.ReadByte(addr + 2) << 8) +
                        ((uint)hexBoxMemory.ByteProvider.ReadByte(addr + 3));
                values += "\r\n32-bit Integer, big-endian, unsigned: " + value.ToString();
                values += "\r\n32-bit Integer, big-endian, signed: " + ((int)value).ToString();
            }

            if (space >= 8)
            {
                ulong value = 0;

                value = ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 7) << 56) |
                        ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 6) << 48) |
                        ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 5) << 40) |
                        ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 4) << 32) |
                        ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 3) << 24) |
                        ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 2) << 16) |
                        ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 1) << 8) |
                        ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr));
                values += "\r\n\r\n64-bit Integer, little-endian, unsigned: " + value.ToString();
                values += "\r\n64-bit Integer, little-endian, signed: " + ((long)value).ToString();

                value = ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr) << 56) |
                        ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 1) << 48) |
                        ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 2) << 40) |
                        ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 3) << 32) |
                        ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 4) << 24) |
                        ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 5) << 16) |
                        ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 6) << 8) |
                        ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 7));
                values += "\r\n64-bit Integer, big-endian, unsigned: " + value.ToString();
                values += "\r\n64-bit Integer, big-endian, signed: " + ((long)value).ToString();
            }

            valuesForm = new InformationBox(values.Trim());
            valuesForm.ShowDialog();
        }
Exemplo n.º 8
0
        private static void VerifySettings()
        {
            try
            {
                var a = Properties.Settings.Default.AlwaysOnTop;
            }
            catch (Exception ex)
            {
                Logging.Log(ex);

                try { ThemingScope.Activate(); }
                catch { }

                BadConfig = true;

                if (OSVersion.HasTaskDialogs)
                {
                    TaskDialog td = new TaskDialog();

                    td.WindowTitle = "Process Hacker";
                    td.MainInstruction = "Process Hacker could not initialize the configuration manager";
                    td.Content = "The Process Hacker configuration file is corrupt or the configuration manager " +
                        "could not be initialized. Do you want Process Hacker to reset your settings?";
                    td.MainIcon = TaskDialogIcon.Warning;
                    td.CommonButtons = TaskDialogCommonButtons.Cancel;
                    td.Buttons = new TaskDialogButton[]
                    {
                        new TaskDialogButton((int)DialogResult.Yes, "Yes, reset the settings and restart Process Hacker"),
                        new TaskDialogButton((int)DialogResult.No, "No, attempt to start Process Hacker anyway"),
                        new TaskDialogButton((int)DialogResult.Retry, "Show me the error message")
                    };
                    td.UseCommandLinks = true;
                    td.Callback = (taskDialog, args, userData) =>
                    {
                        if (args.Notification == TaskDialogNotification.ButtonClicked)
                        {
                            if (args.ButtonId == (int)DialogResult.Yes)
                            {
                                taskDialog.SetMarqueeProgressBar(true);
                                taskDialog.SetProgressBarMarquee(true, 1000);

                                try
                                {
                                    DeleteSettings();
                                    System.Diagnostics.Process.Start(Application.ExecutablePath);
                                }
                                catch (Exception ex2)
                                {
                                    taskDialog.SetProgressBarMarquee(false, 1000);
                                    PhUtils.ShowException("Unable to reset the settings", ex2);
                                    return true;
                                }

                                return false;
                            }
                            else if (args.ButtonId == (int)DialogResult.Retry)
                            {
                                InformationBox box = new InformationBox(ex.ToString());

                                box.ShowDialog();

                                return true;
                            }
                        }

                        return false;
                    };

                    int result = td.Show();

                    if (result == (int)DialogResult.No)
                    {
                        return;
                    }
                }
                else
                {
                    if (MessageBox.Show("Process Hacker cannot start because your configuration file is corrupt. " +
                        "Do you want Process Hacker to reset your settings?", "Process Hacker", MessageBoxButtons.YesNo,
                        MessageBoxIcon.Exclamation) == DialogResult.Yes)
                    {
                        try
                        {
                            DeleteSettings();
                            MessageBox.Show("Process Hacker has reset your settings and will now restart.", "Process Hacker",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                            System.Diagnostics.Process.Start(Application.ExecutablePath);
                        }
                        catch (Exception ex2)
                        {
                            Logging.Log(ex2);

                            MessageBox.Show("Process Hacker could not reset your settings. Please delete the folder " +
                                "'wj32' in your Application Data/Local Application Data directories.",
                                "Process Hacker", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                    }
                }

                Win32.ExitProcess(0);
            }
        }
Exemplo n.º 9
0
        private void buttonValues_Click(object sender, EventArgs e)
        {
            string values = "";
            InformationBox valuesForm;
            long addr = hexBoxMemory.SelectionStart;
            long space = hexBoxMemory.ByteProvider.Length - hexBoxMemory.SelectionStart;

            if (space >= 1)
                values += "\r\n\r\n8-bit Integer: " + hexBoxMemory.ByteProvider.ReadByte(addr).ToString();

            if (space >= 2)
            {
                ushort value = 0;

                value = (ushort)(hexBoxMemory.ByteProvider.ReadByte(addr + 1) << 8 | hexBoxMemory.ByteProvider.ReadByte(addr));
                values += "\r\n\r\n16-bit Integer, little-endian, unsigned: " + value.ToString();
                values += "\r\n16-bit Integer, little-endian, signed: " + ((short)value).ToString();

                value = (ushort)(hexBoxMemory.ByteProvider.ReadByte(addr) << 8 | hexBoxMemory.ByteProvider.ReadByte(addr + 1));
                values += "\r\n16-bit Integer, big-endian, unsigned: " + value.ToString();
                values += "\r\n16-bit Integer, big-endian, signed: " + ((short)value).ToString();
            }

            if (space >= 4)
            {
                uint value = 0;

                value = ((uint)hexBoxMemory.ByteProvider.ReadByte(addr + 3) << 24) +
                    ((uint)hexBoxMemory.ByteProvider.ReadByte(addr + 2) << 16) +
                    ((uint)hexBoxMemory.ByteProvider.ReadByte(addr + 1) << 8) +
                    ((uint)hexBoxMemory.ByteProvider.ReadByte(addr));
                values += "\r\n\r\n32-bit Integer, little-endian, unsigned: " + value.ToString();
                values += "\r\n32-bit Integer, little-endian, signed: " + ((int)value).ToString();

                value = ((uint)hexBoxMemory.ByteProvider.ReadByte(addr) << 24) +
                     ((uint)hexBoxMemory.ByteProvider.ReadByte(addr + 1) << 16) +
                     ((uint)hexBoxMemory.ByteProvider.ReadByte(addr + 2) << 8) +
                     ((uint)hexBoxMemory.ByteProvider.ReadByte(addr + 3));
                values += "\r\n32-bit Integer, big-endian, unsigned: " + value.ToString();
                values += "\r\n32-bit Integer, big-endian, signed: " + ((int)value).ToString();
            }

            if (space >= 8)
            {
                ulong value = 0;

                value = ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 7) << 56) |
                    ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 6) << 48) |
                    ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 5) << 40) |
                    ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 4) << 32) |
                    ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 3) << 24) |
                    ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 2) << 16) |
                    ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 1) << 8) |
                    ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr));
                values += "\r\n\r\n64-bit Integer, little-endian, unsigned: " + value.ToString();
                values += "\r\n64-bit Integer, little-endian, signed: " + ((long)value).ToString();

                value = ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr) << 56) |
                    ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 1) << 48) |
                    ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 2) << 40) |
                    ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 3) << 32) |
                    ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 4) << 24) |
                    ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 5) << 16) |
                    ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 6) << 8) |
                    ((ulong)hexBoxMemory.ByteProvider.ReadByte(addr + 7));
                values += "\r\n64-bit Integer, big-endian, unsigned: " + value.ToString();
                values += "\r\n64-bit Integer, big-endian, signed: " + ((long)value).ToString();
            }

            valuesForm = new InformationBox(values.Trim());
            valuesForm.ShowDialog();
        }
Exemplo n.º 10
0
        private void buttonDiagnostics_Click(object sender, EventArgs e)
        {
            InformationBox box = new InformationBox(Program.GetDiagnosticInformation());

            box.ShowDialog();
        }