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

Public Member Functions

 CustomPictureBox (Node _client)
 
static short GetKeyState (int nVirtKey)
 Retrieves the status of the specified virtual key. The status specifies whether the key is up, down, or toggled on or off.
 
static bool IsClipboardFormatAvailable (uint format)
 Determines whether the specified clipboard format is available.
 
static bool OpenClipboard (IntPtr hWndNewOwner)
 Opens the clipboard for examination and prevents other applications from modifying the clipboard content.
 
static IntPtr GetClipboardData (uint uFormat)
 Retrieves data from the clipboard in a specified format.
 
static bool CloseClipboard ()
 Closes the clipboard.
 
static int ToAscii (uint uVirtKey, uint uScanCode, byte[] lpKeyState, out uint lpChar, uint uFlags)
 Translates the specified virtual-key code and keyboard state to the corresponding character or characters.
 
Point TranslateCoordinates (Point originalCoords, Size originalScreenSize, PictureBox targetControl)
 Translates the coordinates from the original screen size to the target control's image size and returns the translated coordinates.
 
void TriggerWndProc (ref Message m)
 Triggers the window procedure for processing Windows messages.
 

Static Public Member Functions

static void GetClipboardFormat ()
 Retrieves the data format currently on the clipboard and performs corresponding actions based on the format.
 
static char GetModifiedKey (char c)
 Gets the modified key corresponding to the input character.
 
static bool IsAlphaNumeric (char c)
 Checks if the input character is alphanumeric.
 

Static Public Attributes

const uint CF_TEXT = 1
 
const uint CF_BITMAP = 2
 
const uint CF_UNICODETEXT = 13
 
const uint CF_HDROP = 15
 

Protected Member Functions

override void WndProc (ref Message m)
 Overrides the WndProc method to handle window messages and sends corresponding data to the client.
 

Private Member Functions

static short VkKeyScan (char c)
 Translates a Unicode character to the corresponding virtual-key code and shift state for the current keyboard.
 
Point UnzoomedAndAdjusted (PictureBox pictureBox, Point scaledPoint)
 Translates and unzooms the given point based on the zoom factor and displayed image rectangle of the PictureBox.
 
Rectangle GetImageDisplayRectangle (PictureBox pictureBox)
 Gets the display rectangle for the image in the specified PictureBox.
 

Private Attributes

Node client
 

Constructor & Destructor Documentation

◆ CustomPictureBox()

xeno_rat_server.Forms.CustomPictureBox.CustomPictureBox ( Node _client)
inline

Member Function Documentation

◆ CloseClipboard()

static bool xeno_rat_server.Forms.CustomPictureBox.CloseClipboard ( )

Closes the clipboard.

Returns
True if the clipboard is closed successfully; otherwise, false.
Here is the caller graph for this function:

◆ GetClipboardData()

static IntPtr xeno_rat_server.Forms.CustomPictureBox.GetClipboardData ( uint uFormat)

Retrieves data from the clipboard in a specified format.

Parameters
uFormatThe format of the data to be retrieved from the clipboard.
Returns
The handle to the data in the specified format, or IntPtr.Zero if the clipboard is empty or does not contain data in the specified format.
Here is the caller graph for this function:

◆ GetClipboardFormat()

static void xeno_rat_server.Forms.CustomPictureBox.GetClipboardFormat ( )
inlinestatic

Retrieves the data format currently on the clipboard and performs corresponding actions based on the format.

This method checks the available clipboard formats and retrieves the data accordingly. If the clipboard contains text data, it retrieves and processes the text. If the clipboard contains bitmap data, it retrieves and processes the bitmap. If the clipboard contains Unicode text data, it retrieves and processes the Unicode text.

Exceptions
System.Runtime.InteropServices.ExternalExceptionThrown when an error occurs while accessing the clipboard.
Here is the call graph for this function:

◆ GetImageDisplayRectangle()

Rectangle xeno_rat_server.Forms.CustomPictureBox.GetImageDisplayRectangle ( PictureBox pictureBox)
inlineprivate

Gets the display rectangle for the image in the specified PictureBox.

Parameters
pictureBoxThe PictureBox control containing the image.
Returns
A Rectangle representing the display area for the image.

This method calculates and returns the display rectangle for the image based on the PictureBox's SizeMode property. If the SizeMode is Normal, the display rectangle is set to the full size of the image. If the SizeMode is StretchImage, the display rectangle is set to the client area of the PictureBox. If the SizeMode is anything else, the display rectangle is calculated based on the zoom factor and centering within the client area.

Here is the caller graph for this function:

◆ GetKeyState()

static short xeno_rat_server.Forms.CustomPictureBox.GetKeyState ( int nVirtKey)

Retrieves the status of the specified virtual key. The status specifies whether the key is up, down, or toggled on or off.

Parameters
nVirtKeyThe virtual-key code.
Returns
The return value specifies the status of the specified virtual key, as follows: If the high-order bit is 1, the key is down; otherwise, it is up. If the low-order bit is 1, the key is toggled. A key, such as the CAPS LOCK key, is toggled if it is turned on. The key is off and untoggled if the low-order bit is 0.
Here is the caller graph for this function:

◆ GetModifiedKey()

static char xeno_rat_server.Forms.CustomPictureBox.GetModifiedKey ( char c)
inlinestatic

Gets the modified key corresponding to the input character.

Parameters
cThe input character for which the modified key is to be retrieved.
Returns
The modified key corresponding to the input character, taking into account any shift key pressed.

This method retrieves the modified key corresponding to the input character by considering any shift key pressed. If no key translates to the input character, the method returns the input character itself.

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

◆ IsAlphaNumeric()

static bool xeno_rat_server.Forms.CustomPictureBox.IsAlphaNumeric ( char c)
inlinestatic

Checks if the input character is alphanumeric.

Parameters
cThe character to be checked.
Returns
True if the input character is alphanumeric, otherwise false.
Here is the caller graph for this function:

◆ IsClipboardFormatAvailable()

static bool xeno_rat_server.Forms.CustomPictureBox.IsClipboardFormatAvailable ( uint format)

Determines whether the specified clipboard format is available.

Parameters
formatThe format to check for availability.
Returns
True if the specified clipboard format is available; otherwise, false.
Here is the caller graph for this function:

◆ OpenClipboard()

static bool xeno_rat_server.Forms.CustomPictureBox.OpenClipboard ( IntPtr hWndNewOwner)

Opens the clipboard for examination and prevents other applications from modifying the clipboard content.

Parameters
hWndNewOwnerA handle to the window that will own the clipboard.
Returns
True if the function succeeds; otherwise, false.
Here is the caller graph for this function:

◆ ToAscii()

static int xeno_rat_server.Forms.CustomPictureBox.ToAscii ( uint uVirtKey,
uint uScanCode,
byte[] lpKeyState,
out uint lpChar,
uint uFlags )

Translates the specified virtual-key code and keyboard state to the corresponding character or characters.

Parameters
uVirtKeyThe virtual-key code to be translated.
uScanCodeThe hardware scan code of the key to be translated.
lpKeyStateAn array of 256 bytes containing the current keyboard state.
lpCharWhen the function returns, contains the character corresponding to the specified key code.
uFlagsThe behavior of the function. This parameter can be 0 or 1.
Returns
Returns 1 if the specified key is a dead-key character; otherwise, it returns 0.

This method translates the specified virtual-key code and keyboard state to the corresponding character or characters. It is used to translate a virtual-key code into the corresponding character value for the current keyboard layout. If the specified key is a dead-key character, the return value is 1; otherwise, it is 0.

Here is the caller graph for this function:

◆ TranslateCoordinates()

Point xeno_rat_server.Forms.CustomPictureBox.TranslateCoordinates ( Point originalCoords,
Size originalScreenSize,
PictureBox targetControl )
inline

Translates the coordinates from the original screen size to the target control's image size and returns the translated coordinates.

Parameters
originalCoordsThe original coordinates to be translated.
originalScreenSizeThe original screen size.
targetControlThe target control to which the coordinates are being translated.
Returns
The translated coordinates on the target control's image.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TriggerWndProc()

void xeno_rat_server.Forms.CustomPictureBox.TriggerWndProc ( ref Message m)
inline

Triggers the window procedure for processing Windows messages.

Parameters
mA reference to the message to be processed.

This method triggers the window procedure for processing Windows messages by calling the WndProc method and passing a reference to the message to be processed.

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

◆ UnzoomedAndAdjusted()

Point xeno_rat_server.Forms.CustomPictureBox.UnzoomedAndAdjusted ( PictureBox pictureBox,
Point scaledPoint )
inlineprivate

Translates and unzooms the given point based on the zoom factor and displayed image rectangle of the PictureBox.

Parameters
pictureBoxThe PictureBox control used for displaying the image.
scaledPointThe point with scaled coordinates.
Returns
The translated and unzoomed Point based on the zoom factor and displayed image rectangle of the PictureBox.

This method calculates the zoom factor based on the client size of the PictureBox and the dimensions of the displayed image. It then translates and unzooms the coordinates of the given point to match the original image size.

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

◆ VkKeyScan()

static short xeno_rat_server.Forms.CustomPictureBox.VkKeyScan ( char c)
private

Translates a Unicode character to the corresponding virtual-key code and shift state for the current keyboard.

Parameters
cThe Unicode character to be translated.
Returns
The low-order byte specifies the virtual-key code, and the high-order byte specifies the shift state, which can be a combination of the following flag bits: 1 for SHIFT, 2 for CTRL, and 4 for ALT. If the function returns -1, the character is a dead key or is not translatable.
Here is the caller graph for this function:

◆ WndProc()

override void xeno_rat_server.Forms.CustomPictureBox.WndProc ( ref Message m)
inlineprotected

Overrides the WndProc method to handle window messages and sends corresponding data to the client.

Parameters
mA reference to the Message structure that contains the window message to process.

This method intercepts window messages and processes them based on the message type. If the Image property is not null, it processes mouse and keyboard events and sends the corresponding data to the client. For mouse events (e.g., left button down, right button up), it translates the coordinates, constructs a payload, and sends it asynchronously to the client. For keyboard events (e.g., key down, key up), it checks if the Shift or Caps Lock key is pressed, modifies the wParam accordingly, and sends the payload to the client.

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

Member Data Documentation

◆ CF_BITMAP

const uint xeno_rat_server.Forms.CustomPictureBox.CF_BITMAP = 2
static

◆ CF_HDROP

const uint xeno_rat_server.Forms.CustomPictureBox.CF_HDROP = 15
static

◆ CF_TEXT

const uint xeno_rat_server.Forms.CustomPictureBox.CF_TEXT = 1
static

◆ CF_UNICODETEXT

const uint xeno_rat_server.Forms.CustomPictureBox.CF_UNICODETEXT = 13
static

◆ client

Node xeno_rat_server.Forms.CustomPictureBox.client
private

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