C# Класс Binarysharp.MemoryManagement.Memory.MemoryCore

Static core class providing tools for memory editing.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Allocate ( SafeMemoryHandle processHandle, int size, MemoryProtectionFlags protectionFlags = MemoryProtectionFlags.ExecuteReadWrite, MemoryAllocationFlags allocationFlags = MemoryAllocationFlags.Commit ) : IntPtr

Reserves a region of memory within the virtual address space of a specified process.

ChangeProtection ( SafeMemoryHandle processHandle, IntPtr address, int size, MemoryProtectionFlags protection ) : MemoryProtectionFlags

Changes the protection on a region of committed pages in the virtual address space of a specified process.

CloseHandle ( IntPtr handle ) : void

Closes an open object handle.

Free ( SafeMemoryHandle processHandle, IntPtr address ) : void

Releases a region of memory within the virtual address space of a specified process.

NtQueryInformationProcess ( SafeMemoryHandle processHandle ) : ProcessBasicInformation

etrieves information about the specified process.

OpenProcess ( ProcessAccessFlags accessFlags, int processId ) : SafeMemoryHandle

Opens an existing local process object.

Query ( SafeMemoryHandle processHandle, IntPtr addressFrom, IntPtr addressTo ) : IEnumerable

Retrieves information about a range of pages within the virtual address space of a specified process.

Query ( SafeMemoryHandle processHandle, IntPtr baseAddress ) : MemoryBasicInformation

Retrieves information about a range of pages within the virtual address space of a specified process.

ReadBytes ( SafeMemoryHandle processHandle, IntPtr address, int size ) : byte[]

Reads an array of bytes in the memory form the target process.

WriteBytes ( SafeMemoryHandle processHandle, IntPtr address, byte byteArray ) : int

Writes data to an area of memory in a specified process.

Описание методов

Allocate() публичный статический Метод

Reserves a region of memory within the virtual address space of a specified process.
public static Allocate ( SafeMemoryHandle processHandle, int size, MemoryProtectionFlags protectionFlags = MemoryProtectionFlags.ExecuteReadWrite, MemoryAllocationFlags allocationFlags = MemoryAllocationFlags.Commit ) : IntPtr
processHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle The handle to a process.
size int The size of the region of memory to allocate, in bytes.
protectionFlags MemoryProtectionFlags The memory protection for the region of pages to be allocated.
allocationFlags MemoryAllocationFlags The type of memory allocation.
Результат System.IntPtr

ChangeProtection() публичный статический Метод

Changes the protection on a region of committed pages in the virtual address space of a specified process.
public static ChangeProtection ( SafeMemoryHandle processHandle, IntPtr address, int size, MemoryProtectionFlags protection ) : MemoryProtectionFlags
processHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the process whose memory protection is to be changed.
address System.IntPtr A pointer to the base address of the region of pages whose access protection attributes are to be changed.
size int The size of the region whose access protection attributes are changed, in bytes.
protection MemoryProtectionFlags The memory protection option.
Результат MemoryProtectionFlags

CloseHandle() публичный статический Метод

Closes an open object handle.
public static CloseHandle ( IntPtr handle ) : void
handle System.IntPtr A valid handle to an open object.
Результат void

Free() публичный статический Метод

Releases a region of memory within the virtual address space of a specified process.
public static Free ( SafeMemoryHandle processHandle, IntPtr address ) : void
processHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to a process.
address System.IntPtr A pointer to the starting address of the region of memory to be freed.
Результат void

NtQueryInformationProcess() публичный статический Метод

etrieves information about the specified process.
public static NtQueryInformationProcess ( SafeMemoryHandle processHandle ) : ProcessBasicInformation
processHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the process to query.
Результат Binarysharp.MemoryManagement.Native.ProcessBasicInformation

OpenProcess() публичный статический Метод

Opens an existing local process object.
public static OpenProcess ( ProcessAccessFlags accessFlags, int processId ) : SafeMemoryHandle
accessFlags ProcessAccessFlags The access level to the process object.
processId int The identifier of the local process to be opened.
Результат Binarysharp.MemoryManagement.Native.SafeMemoryHandle

Query() публичный статический Метод

Retrieves information about a range of pages within the virtual address space of a specified process.
public static Query ( SafeMemoryHandle processHandle, IntPtr addressFrom, IntPtr addressTo ) : IEnumerable
processHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the process whose memory information is queried.
addressFrom System.IntPtr A pointer to the starting address of the region of pages to be queried.
addressTo System.IntPtr A pointer to the ending address of the region of pages to be queried.
Результат IEnumerable

Query() публичный статический Метод

Retrieves information about a range of pages within the virtual address space of a specified process.
public static Query ( SafeMemoryHandle processHandle, IntPtr baseAddress ) : MemoryBasicInformation
processHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the process whose memory information is queried.
baseAddress System.IntPtr A pointer to the base address of the region of pages to be queried.
Результат Binarysharp.MemoryManagement.Native.MemoryBasicInformation

ReadBytes() публичный статический Метод

Reads an array of bytes in the memory form the target process.
public static ReadBytes ( SafeMemoryHandle processHandle, IntPtr address, int size ) : byte[]
processHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the process with memory that is being read.
address System.IntPtr A pointer to the base address in the specified process from which to read.
size int The number of bytes to be read from the specified process.
Результат byte[]

WriteBytes() публичный статический Метод

Writes data to an area of memory in a specified process.
public static WriteBytes ( SafeMemoryHandle processHandle, IntPtr address, byte byteArray ) : int
processHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the process memory to be modified.
address System.IntPtr A pointer to the base address in the specified process to which data is written.
byteArray byte A buffer that contains data to be written in the address space of the specified process.
Результат int