|
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.
|
|
|
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.
|
|
◆ 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
-
buffer | The input buffer to be compressed. |
- Returns
- The compressed data in the LZNT1 format.
- Exceptions
-
System.Exception | Thrown when the compression process fails. |
◆ 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
-
buffer | The compressed data to be decompressed. |
original_size | The 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
-
InvalidOperationException | Thrown when the decompression operation fails or the input buffer is invalid. |
◆ 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
-
uFlags | The memory allocation attributes. This parameter specifies the allocation and access protection attributes of the memory block. |
sizetdwBytes | The 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
-
OutOfMemoryException | The LocalAlloc function has insufficient memory to satisfy the request. |
ArgumentException | The LocalAlloc function could not allocate the requested number of bytes. |
◆ 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
-
hMem | A 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.
◆ 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
-
CompressionFormat | The compression format to be used. |
SourceBuffer | The input buffer to be compressed. |
SourceBufferLength | The length of the input buffer. |
DestinationBuffer | The buffer to store the compressed data. |
DestinationBufferLength | The length of the destination buffer. |
Unknown | Unknown parameter. |
pDestinationSize | The size of the compressed data in the destination buffer. |
WorkspaceBuffer | Workspace 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.
◆ 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
-
CompressionFormat | The compression format used for the input buffer. |
UncompressedBuffer | The buffer containing the uncompressed data. |
UncompressedBufferSize | The size of the uncompressed data buffer. |
CompressedBuffer | The buffer containing the compressed data to be decompressed. |
CompressedBufferSize | The size of the compressed data buffer. |
FinalUncompressedSize | When 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 .
◆ 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
-
CompressionFormat | The compression format. |
pNeededBufferSize | Receives the size of the workspace required for compression. |
Unknown | Receives an unknown value. |
- Returns
- The status of the operation.
◆ 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:
- /Users/sumansaurabh/Documents/my-startup/xeno-rat/xeno rat server/Compression.cs