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

Public Member Functions

 ProcessManager (Node _client)
 
async Task RecvThread ()
 Asynchronously receives data from the client and processes it.
 

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

void PopulateTreeView (ProcessNode node, TreeNode parentNode)
 Populates the tree view with the process node and its children.
 
void DisplayProcessTree (List< ProcessNode > processList)
 Displays the process tree in a tree view control.
 
async void killPid (int pid)
 Sends a kill command to the specified process ID.
 
void treeView1_NodeMouseClick (object sender, TreeNodeMouseClickEventArgs e)
 Handles the mouse click event on a tree node, and displays a context menu to kill the associated process if the right mouse button is clicked.
 
void ProcessManager_Load (object sender, EventArgs e)
 Event handler for the load event of the ProcessManager form.
 
void ProcessManager_Load_1 (object sender, EventArgs e)
 Event handler for the Load event of the ProcessManager form.
 
void ProcessManager_Load_2 (object sender, EventArgs e)
 Event handler for the Load event of the ProcessManager form.
 
void ProcessManager_Load_3 (object sender, EventArgs e)
 Event handler for the Load event of the ProcessManager form.
 
void treeView1_AfterSelect (object sender, TreeViewEventArgs e)
 Event handler for the AfterSelect event of the treeView1 control.
 
async void button1_Click (object sender, EventArgs e)
 Toggles the pause state and sends a corresponding signal to the client.
 
void InitializeComponent ()
 Initializes the components of the form including a tree view and a button.
 

Static Private Member Functions

static List< ProcessNodeDeserializeProcessList (byte[] serializedData)
 Deserializes the byte array into a list of ProcessNode objects.
 
static ProcessNode DeserializeProcessNode (BinaryReader reader)
 Deserializes a ProcessNode from the provided BinaryReader and returns the deserialized ProcessNode.
 

Private Attributes

Node client
 
bool paused = false
 
System.ComponentModel.IContainer components = null
 Required designer variable.
 
System.Windows.Forms.TreeView treeView1
 
System.Windows.Forms.Button button1
 

Constructor & Destructor Documentation

◆ ProcessManager()

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

Member Function Documentation

◆ button1_Click()

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

Toggles the pause state and sends a corresponding signal to the client.

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

This method toggles the pause state of the application. If the application is currently not paused, it sends a signal to the client to pause, and vice versa. The method uses the client to send a corresponding byte signal to the client.

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

◆ DeserializeProcessList()

static List< ProcessNode > xeno_rat_server.Forms.ProcessManager.DeserializeProcessList ( byte[] serializedData)
inlinestaticprivate

Deserializes the byte array into a list of ProcessNode objects.

Parameters
serializedDataThe byte array containing the serialized process data.
Returns
A list of ProcessNode objects deserialized from the serializedData .
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeserializeProcessNode()

static ProcessNode xeno_rat_server.Forms.ProcessManager.DeserializeProcessNode ( BinaryReader reader)
inlinestaticprivate

Deserializes a ProcessNode from the provided BinaryReader and returns the deserialized ProcessNode.

Parameters
readerThe BinaryReader used for deserialization.
Returns
The deserialized ProcessNode.

This method deserializes a ProcessNode from the provided BinaryReader. It reads the process ID, child count, file path, file description, and name from the reader, and then recursively deserializes child nodes if present. The deserialized ProcessNode is returned with its properties set based on the data read from the BinaryReader.

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

◆ DisplayProcessTree()

void xeno_rat_server.Forms.ProcessManager.DisplayProcessTree ( List< ProcessNode > processList)
inlineprivate

Displays the process tree in a tree view control.

Parameters
processListThe list of process nodes to be displayed.

This method updates the tree view control by clearing its nodes, then populating it with the process tree represented by the input list of process nodes. The process tree is represented as a hierarchical structure, where each node may have child nodes. The method uses the BeginUpdate and EndUpdate methods to optimize the performance of the tree view control when updating its nodes.

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

◆ Dispose()

override void xeno_rat_server.Forms.ProcessManager.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 disposes of all managed resources. If disposing is false, this method releases only the unmanaged resources.

◆ InitializeComponent()

void xeno_rat_server.Forms.ProcessManager.InitializeComponent ( )
inlineprivate

Initializes the components of the form including a tree view and a button.

This method initializes the components of the form, including a tree view and a button. It sets various properties such as location, size, text, and event handlers for the tree view and button controls. The method also sets the size, font, and event handlers for the form itself.

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

◆ killPid()

async void xeno_rat_server.Forms.ProcessManager.killPid ( int pid)
inlineprivate

Sends a kill command to the specified process ID.

Parameters
pidThe process ID to be killed.
Exceptions
ExceptionThrown when an error occurs while sending the kill command.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PopulateTreeView()

void xeno_rat_server.Forms.ProcessManager.PopulateTreeView ( ProcessNode node,
TreeNode parentNode )
inlineprivate

Populates the tree view with the process node and its children.

Parameters
nodeThe process node to be added to the tree view.
parentNodeThe parent node under which the process node should be added.

This method populates the tree view with the given process node and its children. It creates a tree node for the process node, including its name, PID, file path, and file description. If a parent node is provided, the tree node for the process node is added as a child to the parent node. If no parent node is provided, the tree node for the process node is added to the root of the tree view. The method then recursively populates the tree view with the children of the process node. Finally, if no parent node is provided, the tree view is updated to reflect the changes.

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

◆ ProcessManager_Load()

void xeno_rat_server.Forms.ProcessManager.ProcessManager_Load ( object sender,
EventArgs e )
inlineprivate

Event handler for the load event of the ProcessManager form.

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

This method is called when the ProcessManager form is loaded. It can be used to perform any initialization or setup tasks for the form.

Here is the caller graph for this function:

◆ ProcessManager_Load_1()

void xeno_rat_server.Forms.ProcessManager.ProcessManager_Load_1 ( object sender,
EventArgs e )
inlineprivate

Event handler for the Load event of the ProcessManager form.

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

◆ ProcessManager_Load_2()

void xeno_rat_server.Forms.ProcessManager.ProcessManager_Load_2 ( object sender,
EventArgs e )
inlineprivate

Event handler for the Load event of the ProcessManager form.

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

This method is called when the ProcessManager form is loaded. It can be used to perform any necessary initialization or setup for the form.

◆ ProcessManager_Load_3()

void xeno_rat_server.Forms.ProcessManager.ProcessManager_Load_3 ( object sender,
EventArgs e )
inlineprivate

Event handler for the Load event of the ProcessManager form.

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

This method is triggered when the ProcessManager form is loaded. It does not perform any specific actions at this time.

◆ RecvThread()

async Task xeno_rat_server.Forms.ProcessManager.RecvThread ( )
inline

Asynchronously receives data from the client and processes it.

This method continuously receives data from the connected client using asynchronous operations. If the received data is null and the object is not disposed, it closes the connection and returns. If the method is paused, it continues to the next iteration without processing the received data. The received data is deserialized into a list of ProcessNode objects and then displayed as a process tree.

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

◆ treeView1_AfterSelect()

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

Event handler for the AfterSelect event of the treeView1 control.

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

This event is raised when a tree node is selected. It occurs after the selected node has changed and the treeView1 control has been updated.

Here is the caller graph for this function:

◆ treeView1_NodeMouseClick()

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

Handles the mouse click event on a tree node, and displays a context menu to kill the associated process if the right mouse button is clicked.

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, it creates a context menu with an option to kill the process associated with the clicked tree node. If the process node is successfully retrieved from the clicked tree node, a context menu is displayed with an option to kill the associated process. When the context menu item is clicked, it triggers the killPid method with the process ID as a parameter to terminate the process. If an exception occurs during the process node retrieval or context menu creation, a message box displaying "something went wrong..." is shown.

Exceptions
ExceptionThrown when an error occurs during the retrieval of the process node or context menu creation.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ button1

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

◆ client

Node xeno_rat_server.Forms.ProcessManager.client
private

◆ components

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

Required designer variable.

◆ paused

bool xeno_rat_server.Forms.ProcessManager.paused = false
private

◆ treeView1

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

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