Xeno-rat
Loading...
Searching...
No Matches
xeno_rat_server.Compression Class Reference
Collaboration diagram for xeno_rat_server.Compression:

Static Public Member Functions

static byte[] Compress (byte[] buffer)
 Compresses the input buffer using the LZNT1 compression format and returns the compressed data.
 
static byte[] Decompress (byte[] buffer, int original_size)
 Decompresses the input buffer using the LZNT1 compression format and returns the decompressed data.
 

Private Member Functions

static uint RtlGetCompressionWorkSpaceSize (ushort CompressionFormat, out uint pNeededBufferSize, out uint Unknown)
 Retrieves the size of the workspace required for compression.
 
static uint RtlDecompressBuffer (ushort CompressionFormat, byte[] UncompressedBuffer, int UncompressedBufferSize, byte[] CompressedBuffer, int CompressedBufferSize, out int FinalUncompressedSize)
 Decompresses a buffer using the specified compression format and returns the decompressed data.
 
static uint RtlCompressBuffer (ushort CompressionFormat, byte[] SourceBuffer, int SourceBufferLength, byte[] DestinationBuffer, int DestinationBufferLength, uint Unknown, out int pDestinationSize, IntPtr WorkspaceBuffer)
 Compresses the input buffer using the specified compression format and returns the compressed data in the destination buffer.
 
static IntPtr LocalAlloc (int uFlags, IntPtr sizetdwBytes)
 Allocates the specified number of bytes in the local heap and returns a pointer to the allocated memory.
 
static IntPtr LocalFree (IntPtr hMem)
 Frees the memory block allocated by LocalAlloc and LocalReAlloc and invalidates the handle.
 

Static Private Attributes

const ushort COMPRESSION_FORMAT_LZNT1 = 2
 
const ushort COMPRESSION_ENGINE_MAXIMUM = 0x100
 

Member Function Documentation

◆ Compress()

static byte[] xeno_rat_server.Compression.Compress ( byte[] buffer)
inlinestatic

Compresses the input buffer using the LZNT1 compression format and returns the compressed data.

Parameters
bufferThe input buffer to be compressed.
Returns
The compressed data in the LZNT1 format.
Exceptions
System.ExceptionThrown when the compression process fails.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Decompress()

static byte[] xeno_rat_server.Compression.Decompress ( byte[] buffer,
int original_size )
inlinestatic

Decompresses the input buffer using the LZNT1 compression format and returns the decompressed data.

Parameters
bufferThe compressed data to be decompressed.
original_sizeThe size of the original data before compression.
Returns
The decompressed data as a byte array.

This method decompresses the input buffer using the LZNT1 compression format and returns the decompressed data as a new byte array. The size of the original data before compression must be provided as the original_size parameter.

Exceptions
InvalidOperationExceptionThrown when the decompression operation fails or the input buffer is invalid.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LocalAlloc()

static IntPtr xeno_rat_server.Compression.LocalAlloc ( int uFlags,
IntPtr sizetdwBytes )
private

Allocates the specified number of bytes in the local heap and returns a pointer to the allocated memory.

Parameters
uFlagsThe memory allocation attributes. This parameter specifies the allocation and access protection attributes of the memory block.
sizetdwBytesThe size of the memory block, in bytes. If this parameter is zero, the LocalAlloc function allocates a zero-length item and returns a valid pointer.
Returns
A pointer to the newly allocated memory, or IntPtr.Zero if the function fails.
Exceptions
OutOfMemoryExceptionThe LocalAlloc function has insufficient memory to satisfy the request.
ArgumentExceptionThe LocalAlloc function could not allocate the requested number of bytes.
Here is the caller graph for this function:

◆ LocalFree()

static IntPtr xeno_rat_server.Compression.LocalFree ( IntPtr hMem)
private

Frees the memory block allocated by LocalAlloc and LocalReAlloc and invalidates the handle.

Parameters
hMemA handle to the local memory object.
Returns
If the function succeeds, the return value is NULL. If the function fails, the return value is equal to a handle to the local memory object. To get extended error information, call GetLastError.
Here is the caller graph for this function:

◆ RtlCompressBuffer()

static uint xeno_rat_server.Compression.RtlCompressBuffer ( ushort CompressionFormat,
byte[] SourceBuffer,
int SourceBufferLength,
byte[] DestinationBuffer,
int DestinationBufferLength,
uint Unknown,
out int pDestinationSize,
IntPtr WorkspaceBuffer )
private

Compresses the input buffer using the specified compression format and returns the compressed data in the destination buffer.

Parameters
CompressionFormatThe compression format to be used.
SourceBufferThe input buffer to be compressed.
SourceBufferLengthThe length of the input buffer.
DestinationBufferThe buffer to store the compressed data.
DestinationBufferLengthThe length of the destination buffer.
UnknownUnknown parameter.
pDestinationSizeThe size of the compressed data in the destination buffer.
WorkspaceBufferWorkspace buffer for compression.
Returns
The status of the compression operation.

This method compresses the input buffer using the specified compression format and stores the compressed data in the destination buffer. The compression process modifies the original data in place.

Here is the caller graph for this function:

◆ RtlDecompressBuffer()

static uint xeno_rat_server.Compression.RtlDecompressBuffer ( ushort CompressionFormat,
byte[] UncompressedBuffer,
int UncompressedBufferSize,
byte[] CompressedBuffer,
int CompressedBufferSize,
out int FinalUncompressedSize )
private

Decompresses a buffer using the specified compression format and returns the decompressed data.

Parameters
CompressionFormatThe compression format used for the input buffer.
UncompressedBufferThe buffer containing the uncompressed data.
UncompressedBufferSizeThe size of the uncompressed data buffer.
CompressedBufferThe buffer containing the compressed data to be decompressed.
CompressedBufferSizeThe size of the compressed data buffer.
FinalUncompressedSizeWhen this method returns, contains the size of the decompressed data.
Returns
The status of the decompression operation. Zero indicates success; otherwise, an error occurred.

This method decompresses the data in the input buffer CompressedBuffer using the specified compression format CompressionFormat . The decompressed data is stored in the output buffer UncompressedBuffer . The size of the decompressed data is stored in the output parameter FinalUncompressedSize .

Here is the caller graph for this function:

◆ RtlGetCompressionWorkSpaceSize()

static uint xeno_rat_server.Compression.RtlGetCompressionWorkSpaceSize ( ushort CompressionFormat,
out uint pNeededBufferSize,
out uint Unknown )
private

Retrieves the size of the workspace required for compression.

Parameters
CompressionFormatThe compression format.
pNeededBufferSizeReceives the size of the workspace required for compression.
UnknownReceives an unknown value.
Returns
The status of the operation.
Here is the caller graph for this function:

Member Data Documentation

◆ COMPRESSION_ENGINE_MAXIMUM

const ushort xeno_rat_server.Compression.COMPRESSION_ENGINE_MAXIMUM = 0x100
staticprivate

◆ COMPRESSION_FORMAT_LZNT1

const ushort xeno_rat_server.Compression.COMPRESSION_FORMAT_LZNT1 = 2
staticprivate

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