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(); }
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); * }*/ }
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"); } } } }
private void copyToolStripMenuItem1_Click(object sender, EventArgs e) { TextboxHighlighting textbox = GetCurrentTextbox(); if (textbox != null) { Clipboard.SetText(textbox.SelectedText.Replace("\n", "\r\n")); } }
private void pasteToolStripMenuItem1_Click(object sender, EventArgs e) { TextboxHighlighting textbox = GetCurrentTextbox(); if (textbox != null) { textbox.SelectedText = Clipboard.GetText(); } }
private void executeToolStripMenuItem_Click(object sender, EventArgs e) { try { TextboxHighlighting textbox = GetCurrentTextbox(); if (textbox != null) { AssemblerCompiler compiler = Build(textbox.Text, true, true); } } catch { } }
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; }
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}"; }
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); }
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 { } }