Xeno-rat
|
Classes | |
struct | RECT |
Public Member Functions | |
Imaging_handler (string DesktopName) | |
void | Dispose () |
Disposes the resources associated with the current object. | |
Bitmap | Screenshot () |
Takes a screenshot of the desktop and returns it as a Bitmap. | |
Public Attributes | |
IntPtr | Desktop = IntPtr.Zero |
Private Types | |
enum | DESKTOP_ACCESS : uint { DESKTOP_NONE = 0 , DESKTOP_READOBJECTS = 0x0001 , DESKTOP_CREATEWINDOW = 0x0002 , DESKTOP_CREATEMENU = 0x0004 , DESKTOP_HOOKCONTROL = 0x0008 , DESKTOP_JOURNALRECORD = 0x0010 , DESKTOP_JOURNALPLAYBACK = 0x0020 , DESKTOP_ENUMERATE = 0x0040 , DESKTOP_WRITEOBJECTS = 0x0080 , DESKTOP_SWITCHDESKTOP = 0x0100 , GENERIC_ALL } |
enum | GetWindowType : uint { GW_HWNDFIRST = 0 , GW_HWNDLAST = 1 , GW_HWNDNEXT = 2 , GW_HWNDPREV = 3 , GW_OWNER = 4 , GW_CHILD = 5 , GW_ENABLEDPOPUP = 6 } |
enum | DeviceCap { VERTRES = 10 , DESKTOPVERTRES = 117 } |
Private Member Functions | |
static IntPtr | GetDC (IntPtr hWnd) |
Retrieves a handle to a device context (DC) for the entire window, including title bar, menus, and scroll bars. A window device context permits painting anywhere in a window, because the origin of the device context is the upper-left corner of the window instead of the client area. | |
static bool | SetThreadDesktop (IntPtr hDesktop) |
Sets the desktop of the calling thread to the specified desktop. | |
static IntPtr | OpenDesktop (string lpszDesktop, int dwFlags, bool fInherit, uint dwDesiredAccess) |
Opens the specified desktop object. | |
static IntPtr | CreateDesktop (string lpszDesktop, IntPtr lpszDevice, IntPtr pDevmode, int dwFlags, uint dwDesiredAccess, IntPtr lpsa) |
Creates a new desktop with the specified name and returns a handle to the desktop. | |
static IntPtr | GetDesktopWindow () |
Retrieves a handle to the desktop window. The desktop window covers the entire screen. The desktop window is the area on top of which other windows are painted. | |
static bool | GetWindowRect (IntPtr hwnd, out RECT lpRect) |
Retrieves the dimensions of the bounding rectangle of the specified window. | |
static bool | IsWindowVisible (IntPtr hWnd) |
Determines whether the specified window is visible. | |
static bool | PrintWindow (IntPtr hwnd, IntPtr hDC, uint nFlags) |
The PrintWindow function retrieves the contents of a window or control that is currently being displayed on the screen. | |
static IntPtr | GetWindow (IntPtr hWnd, GetWindowType uCmd) |
Retrieves a handle to the window that has the specified relationship to the specified window. | |
static IntPtr | GetTopWindow (IntPtr hWnd) |
Retrieves a handle to the top-level window whose class name and window name match the specified strings. | |
static bool | ReleaseDC (IntPtr hWnd, IntPtr hDC) |
Releases the device context (DC) that is associated with a specific window. | |
static IntPtr | CreateCompatibleDC (IntPtr hdc) |
Creates a memory device context (DC) compatible with the specified device. | |
static IntPtr | CreateCompatibleBitmap (IntPtr hdc, int nWidth, int nHeight) |
Creates a bitmap compatible with the specified device context (DC) and returns a handle to the bitmap. | |
static IntPtr | SelectObject (IntPtr hdc, IntPtr hgdiobj) |
Selects an object into the specified device context (DC). | |
static bool | DeleteObject (IntPtr hObject) |
Deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object. | |
static bool | DeleteDC (IntPtr hdc) |
Deletes a device context (DC) from memory. | |
static bool | CloseDesktop (IntPtr hDesktop) |
Closes the specified desktop. | |
static int | GetDeviceCaps (IntPtr hdc, int nIndex) |
Retrieves device-specific information for the specified device. | |
bool | DrawApplication (IntPtr hWnd, Graphics ModifiableScreen, IntPtr DC) |
Captures the application window and draws it on the specified graphics object. | |
void | DrawTopDown (IntPtr owner, Graphics ModifiableScreen, IntPtr DC) |
Draws the windows from top to bottom on the screen. | |
void | DrawHwnd (IntPtr hWnd, Graphics ModifiableScreen, IntPtr DC) |
Draws the specified window on the given graphics object using the provided device context. | |
Static Private Member Functions | |
static float | GetScalingFactor () |
Retrieves the scaling factor of the screen. | |
|
private |
|
private |
|
private |
|
inline |
|
private |
Closes the specified desktop.
hDesktop | A handle to the desktop to be closed. |
true
if the function succeeds; otherwise, false
.This method closes the desktop identified by the handle hDesktop .
|
private |
Creates a bitmap compatible with the specified device context (DC) and returns a handle to the bitmap.
hdc | A handle to the device context (DC) of a window or a printer. |
nWidth | The width, in pixels, of the bitmap. |
nHeight | The height, in pixels, of the bitmap. |
|
private |
Creates a memory device context (DC) compatible with the specified device.
hdc | A handle to the device context of the window or printer to be used for the compatible DC. |
This method creates a memory device context (DC) that is compatible with the specified device context (DC). The memory DC can be used as a target for BitBlt operations.
|
private |
Creates a new desktop with the specified name and returns a handle to the desktop.
lpszDesktop | The name of the new desktop. |
lpszDevice | Reserved; must be NULL. |
pDevmode | Reserved; must be NULL. |
dwFlags | The desktop creation options. For a list of values, see https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-createdesktopw. |
dwDesiredAccess | The access to the desktop. For a list of values, see https://docs.microsoft.com/en-us/windows/win32/secauthz/access-mask. |
lpsa | Reserved; must be NULL. |
System.ComponentModel.Win32Exception | Thrown when the function fails to create the desktop. The exception contains the error code returned by GetLastError. |
|
private |
Deletes a device context (DC) from memory.
hdc | A handle to the device context (DC) to be deleted. |
|
private |
Deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object.
hObject | A handle to the object to be deleted. |
|
inline |
Disposes the resources associated with the current object.
This method closes the desktop associated with the current object and performs garbage collection to release any remaining resources.
|
inlineprivate |
Captures the application window and draws it on the specified graphics object.
hWnd | A handle to the window to be captured. |
ModifiableScreen | The graphics object on which the captured window will be drawn. |
DC | A handle to the device context of the window. |
This method captures the specified window using the PrintWindow function and draws it on the specified graphics object. It also takes into account the scaling factor to ensure proper rendering on high DPI displays.
|
inlineprivate |
Draws the specified window on the given graphics object using the provided device context.
hWnd | The handle to the window to be drawn. |
ModifiableScreen | The graphics object on which the window will be drawn. |
DC | The device context used for drawing. |
This method checks if the specified window is visible. If it is, it proceeds to draw the application associated with the window using the provided graphics object and device context. If the operating system version is less than 6, it also draws the top-down view of the window.
|
inlineprivate |
Draws the windows from top to bottom on the screen.
owner | The handle to the owner window. |
ModifiableScreen | The graphics object representing the screen. |
DC | The device context handle. |
This method retrieves the top window owned by the specified owner window and draws each window from top to bottom on the screen using the specified graphics object and device context handle.
|
private |
Retrieves a handle to a device context (DC) for the entire window, including title bar, menus, and scroll bars. A window device context permits painting anywhere in a window, because the origin of the device context is the upper-left corner of the window instead of the client area.
hWnd | A handle to the window with a device context that is to be retrieved. |
|
private |
Retrieves a handle to the desktop window. The desktop window covers the entire screen. The desktop window is the area on top of which other windows are painted.
|
private |
Retrieves device-specific information for the specified device.
hdc | A handle to the device context. |
nIndex | The value to be retrieved. |
|
inlinestaticprivate |
Retrieves the scaling factor of the screen.
This method retrieves the scaling factor of the screen by comparing the logical and physical screen heights. It uses the Graphics class to obtain the device context of the desktop and then calculates the scaling factor using the obtained heights. The scaling factor is then returned as a float value.
|
private |
Retrieves a handle to the top-level window whose class name and window name match the specified strings.
hWnd | A handle to a window. The search for a child window begins at this window and proceeds through child windows. |
|
private |
Retrieves a handle to the window that has the specified relationship to the specified window.
hWnd | A handle to the window whose relationship is to be retrieved. |
uCmd | The relationship between the specified window and the window whose handle is to be retrieved. |
|
private |
Retrieves the dimensions of the bounding rectangle of the specified window.
hwnd | A handle to the window. |
lpRect | A pointer to a RECT structure that receives the screen coordinates of the upper-left and lower-right corners of the window. |
System.Runtime.InteropServices.ExternalException | Thrown when the function fails to retrieve the window dimensions. |
|
private |
Determines whether the specified window is visible.
hWnd | A handle to the window to be tested. |
true
if the specified window is visible, false
otherwise.
|
private |
Opens the specified desktop object.
lpszDesktop | The name of the desktop to be opened. |
dwFlags | Reserved; set to 0. |
fInherit | If this value is TRUE, processes created by this process will inherit the handle. Otherwise, the processes do not inherit this handle. |
dwDesiredAccess | The access to the desktop. For a list of access rights, see Desktop Security and Access Rights. |
|
private |
The PrintWindow function retrieves the contents of a window or control that is currently being displayed on the screen.
hwnd | A handle to the window or control from which to retrieve the contents. |
hDC | A handle to a device context (DC) for the client area of the window or control. |
nFlags | The drawing options. This parameter can be used to control how the window contents are retrieved. |
|
private |
Releases the device context (DC) that is associated with a specific window.
hWnd | A handle to the window whose DC is to be released. |
hDC | A handle to the DC to be released. |
|
inline |
Takes a screenshot of the desktop and returns it as a Bitmap.
|
private |
Selects an object into the specified device context (DC).
hdc | A handle to the device context. |
hgdiobj | A handle to the object to be selected. |
|
private |
Sets the desktop of the calling thread to the specified desktop.
hDesktop | A handle to the desktop to be set. |
System.ComponentModel.Win32Exception | Thrown when an error occurs while setting the desktop. |
IntPtr Hidden_handler.Imaging_handler.Desktop = IntPtr.Zero |