Classes | |
struct | OS_MEMORY_AT_ADDR_INFORMATION |
Enumerations | |
enum | OS_PAGE_PROTECTION_TYPE { OS_PAGE_PROTECTION_TYPE_NOACCESS = 0, OS_PAGE_PROTECTION_TYPE_READ = (1<<0), OS_PAGE_PROTECTION_TYPE_WRITE = (1<<1), OS_PAGE_PROTECTION_TYPE_EXECUTE = (1<<2), OS_PAGE_PROTECTION_TYPE_GUARD = (1<<3) } |
enum | OS_MEMORY_FLAGS { OS_MEMORY_FLAGS_PRIVATE = 0, OS_MEMORY_FLAGS_FIXED_ADDRESS = (1<<0), OS_MEMORY_FLAGS_STACK = (1<<1), OS_MEMORY_FLAGS_SHARED = (1<<3) } |
Functions | |
OS_RETURN_CODE | OS_AllocateMemory (NATIVE_PID processId, UINT protectionType, USIZE size, OS_MEMORY_FLAGS flags, VOID **base) |
OS_RETURN_CODE | OS_MapFileToMemory (NATIVE_PID processId, UINT protectionType, USIZE size, OS_MEMORY_FLAGS flags, NATIVE_FD fd, UINT64 offset, VOID **base) |
OS_RETURN_CODE | OS_FreeMemory (NATIVE_PID processId, VOID *base, USIZE size) |
OS_RETURN_CODE | OS_GetPageSize (USIZE *size) |
OS_RETURN_CODE | OS_QueryMemory (NATIVE_PID processId, VOID *memoryAddr, OS_MEMORY_AT_ADDR_INFORMATION *info) |
OS_RETURN_CODE | OS_ProtectMemory (NATIVE_PID processId, VOID *base, USIZE size, UINT newProtectionType) |
|
|
Page protection types |
|
Allocates size bytes of memory in the process identified by processId with protectionType protection.
|
|
Free's size bytes of memory at base address in the process identified by processId.
|
|
Query the system page size.
|
|
Maps a file into memory, similar to mmap (see man page of mmap(2)).
|
|
Changes protection for the target process's memory page(s) containing any part of the address range in the interval [base, base+size-1]. base must be aligned to a page boundary.
The processId is irrelevant as it is only applicable on the current process. On Unix system, memory protection can only be changed for the current process' memory space. The given pid is expected to be that of the current process. Hence the behavior of this function in case 'processId' is not of the current process is not defined. Windows: Windows supports memory protection change on a different process memory space.
|
|
Retrieves the information on the memory block containing memoryAddr.
|