Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < GlobalVariables.MainForm.faTabStrip1.Controls.Count; i++)
            {
                TextboxHighlighting textbox = (TextboxHighlighting)GlobalVariables.MainForm.faTabStrip1.Controls[i].Controls[0];
                textbox.BackColor = pictureBox1.BackColor;

                textbox.richTextBox1.ForeColor = pictureBox4.BackColor;
                textbox.highlights.Clear();
                textbox.BackColor = pictureBox1.BackColor;
                textbox.highlights.Add(RegexPatterns.Keyword, pictureBox2.BackColor);
                textbox.highlights.Add(RegexPatterns.Accessor, pictureBox3.BackColor);
                textbox.highlights.Add(RegexPatterns.Assembler, pictureBox5.BackColor);
                textbox.highlights.Add(RegexPatterns.String, pictureBox6.BackColor);
                textbox.UpdateControl();
            }
            Settings.VirtualScreenFPS = (int)numericUpDown1.Value;

            if (comboBox1.Text == "Console Application")
            {
                Settings.buildOutput = BuildOutput.Console;
            }
            else if (comboBox1.Text == "Windows Application")
            {
                Settings.buildOutput = BuildOutput.WindowsApp;
            }

            Settings.MergeEngine    = checkBox1.Checked;
            Settings.CompressEngine = checkBox2.Checked;
            Settings.Obfuscate      = checkBox3.Checked;

            this.Close();
        }
Exemple #2
0
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            //try
            //{
            if (DebugForm != null)
            {
                MessageBox.Show("Already debugging", "ASM.net", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            TextboxHighlighting textbox = GetCurrentTextbox();

            if (textbox != null)
            {
                AssemblerCompiler compiler = Build(textbox.Text, false, false);
                if (compiler.errors.Count == 0)
                {
                    AssemblerExecute executor = new AssemblerExecute();
                    DebugForm = new frmEmulate(executor);
                    executor.Execute(compiler.AssemblerBytes.ToArray());
                    DebugForm.Show();
                }
            }

            /*}
             * catch(Exception ex)
             * {
             *  MessageBox.Show(ex.StackTrace + "\r\n" + ex.Message);
             * }*/
        }
Exemple #3
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog dialog = new OpenFileDialog())
            {
                dialog.CheckFileExists = true;
                dialog.Filter          = "Assembler .net|*.asmn";
                dialog.Multiselect     = false;
                dialog.Title           = "Select a Assembler .net source code file";
                if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    if (File.Exists(dialog.FileName))
                    {
                        FATabStripItem tab = new FATabStripItem();
                        tab.Title = dialog.FileName;
                        faTabStrip1.AddTab(tab);

                        TextboxHighlighting txtHighlighting = new TextboxHighlighting();
                        txtHighlighting.ContextMenuStrip = contextMenuStrip2;
                        txtHighlighting.UpdateControl();
                        txtHighlighting.Width  = tab.Width;
                        txtHighlighting.Height = tab.Height;
                        txtHighlighting.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;

                        txtHighlighting.Text = File.ReadAllText(dialog.FileName);
                        tab.Controls.Add(txtHighlighting);
                    }
                    else
                    {
                        MessageBox.Show("The file does not exist");
                    }
                }
            }
        }
Exemple #4
0
        private void copyToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            TextboxHighlighting textbox = GetCurrentTextbox();

            if (textbox != null)
            {
                Clipboard.SetText(textbox.SelectedText.Replace("\n", "\r\n"));
            }
        }
Exemple #5
0
        private void pasteToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            TextboxHighlighting textbox = GetCurrentTextbox();

            if (textbox != null)
            {
                textbox.SelectedText = Clipboard.GetText();
            }
        }
Exemple #6
0
 private void executeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         TextboxHighlighting textbox = GetCurrentTextbox();
         if (textbox != null)
         {
             AssemblerCompiler compiler = Build(textbox.Text, true, true);
         }
     }
     catch { }
 }
Exemple #7
0
        public void CreateNewTab(string Text, string TabTitle)
        {
            FATabStripItem tab = new FATabStripItem();

            tab.Title = TabTitle;
            faTabStrip1.AddTab(tab);
            TextboxHighlighting txtHighlighting = new TextboxHighlighting();

            txtHighlighting.ContextMenuStrip = contextMenuStrip2;
            txtHighlighting.UpdateControl();
            txtHighlighting.Width  = tab.Width;
            txtHighlighting.Height = tab.Height;
            txtHighlighting.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            tab.Controls.Add(txtHighlighting);
            txtHighlighting.Text = Text;
        }
Exemple #8
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FATabStripItem tab = new FATabStripItem();

            tab.Title = "new.asmn";
            faTabStrip1.AddTab(tab);

            TextboxHighlighting txtHighlighting = new TextboxHighlighting();

            txtHighlighting.ContextMenuStrip = contextMenuStrip2;
            txtHighlighting.UpdateControl();
            txtHighlighting.Width  = tab.Width;
            txtHighlighting.Height = tab.Height;
            txtHighlighting.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;

            tab.Controls.Add(txtHighlighting);
            txtHighlighting.Text = "namespace Sample\r\n{\r\n\tpublic class Sample\r\n\t{\r\n\t}\r\n}";
        }
Exemple #9
0
        private TextboxHighlighting GetCurrentTextbox()
        {
            TextboxHighlighting textbox = (TextboxHighlighting)faTabStrip1.ActiveControl;

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

            try
            {
                textbox = (TextboxHighlighting)faTabStrip1.Controls[faTabStrip1.TabIndex].Controls[0];
                if (textbox != null)
                {
                    return(textbox);
                }
                return(null);
            }
            catch { }
            return(null);
        }
Exemple #10
0
 private void saveToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         using (SaveFileDialog dialog = new SaveFileDialog())
         {
             dialog.CheckFileExists = false;
             dialog.Filter          = "Assembler .net|*.asmn";
             dialog.Title           = "Save a Assembler .net source code file";
             if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 TextboxHighlighting textbox = GetCurrentTextbox();
                 if (textbox != null)
                 {
                     File.WriteAllText(dialog.FileName, textbox.Text);
                 }
             }
         }
     }
     catch { }
 }