Structs§
- Dual
Mapping - Dual memory mapping used to map an anonymous memory into two memory regions where one region is read-only, but executable, and the second region is read+write, but not executable. See alloc_dual_mapping for more details.
- Hardened
Runtime Info - Info
- Virtual memory information.
- Memory
Flags
Enums§
- Anonymous
Memory Strategy - Hardened
Runtime Flags - Hardened runtime flags.
- Protect
JitAccess - Values that can be used with
protect_jit_memory
function.
Constants§
Functions§
- alloc
- alloc_
dual_ mapping - Allocates virtual memory and creates two views of it where the first view has no write access. This is an addition to the API that should be used in cases in which the operating system either enforces W^X security policy or the application wants to use this policy by default to improve security and prevent an accidental (or purposed) self-modifying code.
- flush_
instruction_ cache - Flushes instruction cache in the given region.
- get_
anonymous_ memory_ strategy - get_
hardened_ runtime_ flags - hardened_
runtime_ info - has_
hardened_ runtime - Detects whether the current process is hardened, which means that pages that have WRITE and EXECUTABLE flags cannot be normally allocated. On OSX + AArch64 such allocation requires MAP_JIT flag, other platforms don’t support this combination.
- has_
map_ jit_ support - info
- map_
jit_ from_ memory_ flags - max_
access_ flags_ to_ regular_ access_ flags - mm_
max_ prot_ from_ memory_ flags - protect
- protect_
jit_ memory - Protects access of memory mapped with MAP_JIT flag for the current thread.
- regular_
access_ flags_ to_ max_ access_ flags - release
- release_
dual_ mapping - Releases virtual memory mapping previously allocated by alloc_dual_mapping().