Xeno-rat
Loading...
Searching...
No Matches
xeno_rat_server.Forms.Registry_Manager Class Reference
Inheritance diagram for xeno_rat_server.Forms.Registry_Manager:
Collaboration diagram for xeno_rat_server.Forms.Registry_Manager:

Public Member Functions

 Registry_Manager (Node _client)
 
void TempOnDisconnect (Node node)
 Executes the specified action when the given node is disconnected.
 
async Task StartAdd ()
 Asynchronously starts the process of adding registry information to the tree view.
 
async Task< RegInfoGetRegInfo (string path)
 Retrieves registration information for the specified path.
 
async Task< bool > DeleteRegSubKey (string path)
 Deletes a registry subkey and returns a boolean indicating whether the operation was successful.
 
async Task< bool > DeleteRegKey (string path, string key)
 Deletes a registry key at the specified path and key and returns a boolean indicating whether the operation was successful.
 

Static Public Member Functions

static RegInfo DeserializeRegInfo (byte[] data)
 Deserializes the byte array data into a RegInfo object.
 

Protected Member Functions

override void Dispose (bool disposing)
 Releases the unmanaged resources used by the component and optionally releases the managed resources.
 

Private Member Functions

async void treeView1_BeforeExpand (object sender, TreeViewCancelEventArgs e)
 Handles the BeforeExpand event of the treeView1 control.
 
void treeView1_AfterSelect (object sender, TreeViewEventArgs e)
 Updates the listView1 based on the selected node in treeView1.
 
void listView1_SelectedIndexChanged (object sender, EventArgs e)
 Occurs when the selected index of the ListView changes.
 
async void button1_Click (object sender, EventArgs e)
 Clears the text in textBox1, clears the items in listView1, clears the nodes in treeView1, and then starts the asynchronous operation StartAdd().
 
void treeView1_Click (object sender, EventArgs e)
 Event handler for the Click event of the treeView1 control.
 
void treeView1_NodeMouseClick (object sender, TreeNodeMouseClickEventArgs e)
 Handles the event when a node in the tree view is clicked with the mouse.
 
void InitializeComponent ()
 Initializes the components of the form, setting up the tree view, list view, labels, text box, and button.
 

Private Attributes

Node client
 
System.ComponentModel.IContainer components = null
 Required designer variable.
 
System.Windows.Forms.TreeView treeView1
 
System.Windows.Forms.ListView listView1
 
System.Windows.Forms.ColumnHeader columnHeader1
 
System.Windows.Forms.ColumnHeader columnHeader2
 
System.Windows.Forms.ColumnHeader columnHeader3
 
System.Windows.Forms.Label label1
 
System.Windows.Forms.TextBox textBox1
 
System.Windows.Forms.Button button1
 

Static Private Attributes

static readonly Dictionary< byte, string > TypeIdentifierReverseMap
 

Constructor & Destructor Documentation

◆ Registry_Manager()

xeno_rat_server.Forms.Registry_Manager.Registry_Manager ( Node _client)
inline
Here is the call graph for this function:

Member Function Documentation

◆ button1_Click()

async void xeno_rat_server.Forms.Registry_Manager.button1_Click ( object sender,
EventArgs e )
inlineprivate

Clears the text in textBox1, clears the items in listView1, clears the nodes in treeView1, and then starts the asynchronous operation StartAdd().

Parameters
senderThe object that raised the event.
eThe event data.

This method clears the text in textBox1, the items in listView1, and the nodes in treeView1 to prepare for the asynchronous operation StartAdd(). It then awaits the completion of StartAdd() to continue with further operations.

Here is the call graph for this function:

◆ DeleteRegKey()

async Task< bool > xeno_rat_server.Forms.Registry_Manager.DeleteRegKey ( string path,
string key )
inline

Deletes a registry key at the specified path and key and returns a boolean indicating whether the operation was successful.

Parameters
pathThe path of the registry key to be deleted.
keyThe name of the registry key to be deleted.
Returns
True if the registry key was successfully deleted; otherwise, false.

This method sends a delete operation request to the server using the specified path and key. If the operation is successful, it returns true; otherwise, it returns false.

Here is the call graph for this function:

◆ DeleteRegSubKey()

async Task< bool > xeno_rat_server.Forms.Registry_Manager.DeleteRegSubKey ( string path)
inline

Deletes a registry subkey and returns a boolean indicating whether the operation was successful.

Parameters
pathThe path of the registry subkey to be deleted.
Returns
True if the registry subkey was successfully deleted; otherwise, false.

This method sends a delete opcode followed by the UTF-8 encoded path to the registry subkey to the client using asynchronous operations. It then awaits the response from the client and returns a boolean indicating whether the deletion operation was successful.

Here is the call graph for this function:

◆ DeserializeRegInfo()

static RegInfo xeno_rat_server.Forms.Registry_Manager.DeserializeRegInfo ( byte[] data)
inlinestatic

Deserializes the byte array data into a RegInfo object.

Parameters
dataThe byte array containing the serialized RegInfo data.
Returns
The deserialized RegInfo object.

This method deserializes the byte array data into a RegInfo object by reading the data using a BinaryReader and populating the RegInfo properties based on the data read. It handles various types of registry values such as REG_SZ, REG_EXPAND_SZ, REG_BINARY, REG_DWORD, REG_MULTI_SZ, and REG_QWORD, and populates the RegInfo object with the corresponding values.

Here is the caller graph for this function:

◆ Dispose()

override void xeno_rat_server.Forms.Registry_Manager.Dispose ( bool disposing)
inlineprotected

Releases the unmanaged resources used by the component and optionally releases the managed resources.

Parameters
disposingtrue to release both managed and unmanaged resources; false to release only unmanaged resources.

This method releases the unmanaged resources used by the component and optionally releases the managed resources. If disposing is true, this method releases all resources held by any managed objects that this Component references. This method is called by the public Dispose() method and the Finalize method.

◆ GetRegInfo()

async Task< RegInfo > xeno_rat_server.Forms.Registry_Manager.GetRegInfo ( string path)
inline

Retrieves registration information for the specified path.

Parameters
pathThe path for which registration information is to be retrieved.
Returns
The registration information for the specified path .
Exceptions
ArgumentNullExceptionThrown when the path is null.
InvalidOperationExceptionThrown when the operation is invalid for the current state of the object.

This method sends the specified path to the client using the SendAsync method and then receives a response. If the response indicates success, it deserializes the received data to obtain the registration information. If the response indicates failure, it returns null.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitializeComponent()

void xeno_rat_server.Forms.Registry_Manager.InitializeComponent ( )
inlineprivate

Initializes the components of the form, setting up the tree view, list view, labels, text box, and button.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listView1_SelectedIndexChanged()

void xeno_rat_server.Forms.Registry_Manager.listView1_SelectedIndexChanged ( object sender,
EventArgs e )
inlineprivate

Occurs when the selected index of the ListView changes.

Parameters
senderThe source of the event.
eAn EventArgs that contains the event data.

◆ StartAdd()

async Task xeno_rat_server.Forms.Registry_Manager.StartAdd ( )
inline

Asynchronously starts the process of adding registry information to the tree view.

This method asynchronously retrieves registry information for "HKLM" and "HKCU" hives using the GetRegInfo method, and then populates the tree view with the retrieved information. The retrieved information for each hive is added as a new TreeNode to the tree view, and then subkeys under each hive are added as child nodes to the respective hive nodes. The tree view is updated once all the nodes are added.

Exceptions
ExceptionThrown when there is an error retrieving or populating registry information.
Returns
A Task representing the asynchronous operation.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TempOnDisconnect()

void xeno_rat_server.Forms.Registry_Manager.TempOnDisconnect ( Node node)
inline

Executes the specified action when the given node is disconnected.

Parameters
nodeThe node to be checked for disconnection.

This method checks if the provided node is the same as the client node, and if it is not disposed. If both conditions are met, it invokes the specified action to close the connection.

Here is the caller graph for this function:

◆ treeView1_AfterSelect()

void xeno_rat_server.Forms.Registry_Manager.treeView1_AfterSelect ( object sender,
TreeViewEventArgs e )
inlineprivate

Updates the listView1 based on the selected node in treeView1.

Parameters
senderThe object that raised the event.
eThe event data.

This method updates the listView1 based on the selected node in treeView1. It clears the listView1, retrieves the RegInfo associated with the selected node, and populates the listView1 with the values from the RegInfo. The method handles different types of registry values and displays them accordingly in the listView1.

Here is the caller graph for this function:

◆ treeView1_BeforeExpand()

async void xeno_rat_server.Forms.Registry_Manager.treeView1_BeforeExpand ( object sender,
TreeViewCancelEventArgs e )
inlineprivate

Handles the BeforeExpand event of the treeView1 control.

Parameters
senderThe source of the event.
eA TreeViewCancelEventArgs that contains the event data.

This method asynchronously retrieves registry information for each node being expanded in the treeView1 control. It sets the retrieved registry information as the Tag property of each node. If the retrieved registry information is null, the method continues to the next node. For each subkey in the retrieved registry information, a new TreeNode is added to the node being expanded, and the subkey is set as the Tag property of the new TreeNode.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ treeView1_Click()

void xeno_rat_server.Forms.Registry_Manager.treeView1_Click ( object sender,
EventArgs e )
inlineprivate

Event handler for the Click event of the treeView1 control.

Parameters
senderThe source of the event.
eAn EventArgs that contains the event data.
Here is the caller graph for this function:

◆ treeView1_NodeMouseClick()

void xeno_rat_server.Forms.Registry_Manager.treeView1_NodeMouseClick ( object sender,
TreeNodeMouseClickEventArgs e )
inlineprivate

Handles the event when a node in the tree view is clicked with the mouse.

Parameters
senderThe source of the event.
eA TreeNodeMouseClickEventArgs that contains the event data.

This method checks if the right mouse button is clicked and, if so, creates a context menu with options related to the clicked node. If an exception occurs during the process, a message box displaying "something went wrong..." is shown.

Here is the caller graph for this function:

Member Data Documentation

◆ button1

System.Windows.Forms.Button xeno_rat_server.Forms.Registry_Manager.button1
private

◆ client

Node xeno_rat_server.Forms.Registry_Manager.client
private

◆ columnHeader1

System.Windows.Forms.ColumnHeader xeno_rat_server.Forms.Registry_Manager.columnHeader1
private

◆ columnHeader2

System.Windows.Forms.ColumnHeader xeno_rat_server.Forms.Registry_Manager.columnHeader2
private

◆ columnHeader3

System.Windows.Forms.ColumnHeader xeno_rat_server.Forms.Registry_Manager.columnHeader3
private

◆ components

System.ComponentModel.IContainer xeno_rat_server.Forms.Registry_Manager.components = null
private

Required designer variable.

◆ label1

System.Windows.Forms.Label xeno_rat_server.Forms.Registry_Manager.label1
private

◆ listView1

System.Windows.Forms.ListView xeno_rat_server.Forms.Registry_Manager.listView1
private

◆ textBox1

System.Windows.Forms.TextBox xeno_rat_server.Forms.Registry_Manager.textBox1
private

◆ treeView1

System.Windows.Forms.TreeView xeno_rat_server.Forms.Registry_Manager.treeView1
private

◆ TypeIdentifierReverseMap

readonly Dictionary<byte, string> xeno_rat_server.Forms.Registry_Manager.TypeIdentifierReverseMap
staticprivate
Initial value:
= new Dictionary<byte, string>
{
{ 1, "REG_SZ" },
{ 2, "REG_EXPAND_SZ" },
{ 3, "REG_BINARY" },
{ 4, "REG_DWORD" },
{ 5, "REG_MULTI_SZ" },
{ 6, "REG_QWORD" },
{ 7, "Unknown" }
}

The documentation for this class was generated from the following files: