memory ¤
Reading, writing, and describing memory.
Classes:
-
Page–Represents the address space and page permissions of at least
Functions:
-
round_down–round_down(address, align) -> int
-
round_up–round_up(address, align) -> int
-
format_address–Format the given address as a string.
-
page_align–page_align(address) -> int
-
page_size_align– -
page_offset–
Attributes:
-
PAGE_SIZE– -
PAGE_MASK– -
align_down– -
align_up–
Page ¤
Page(
start: int,
size: int,
flags: int,
offset: int,
objfile: str = "",
in_darwin_shared_cache: bool = False,
)
Represents the address space and page permissions of at least one page of memory.
Methods:
Attributes:
-
vaddr– -
memsz– -
flags– -
offset– -
objfile–Possible non-empty values of
objfile: -
in_darwin_shared_cache(bool) –Whether this mapping is part of the Darwin Shared Cache.
-
start(int) –Mapping start address.
-
end(int) –Address beyond mapping. So the last effective address is self.end-1
-
is_stack(bool) – -
is_memory_mapped_file(bool) – -
read(bool) – -
write(bool) – -
execute(bool) – -
rw(bool) – -
wx(bool) – -
rwx(bool) – -
is_guard(bool) – -
permstr(str) –
objfile class-attribute instance-attribute ¤
Possible non-empty values of objfile: - Contains square brackets "[]" if it's not a memory mapped file. Examples: [stack], [vsyscall], [heap], [vdso] - A path to a file, such as /usr/lib/libc.so.6
in_darwin_shared_cache instance-attribute ¤
Whether this mapping is part of the Darwin Shared Cache.
This is an interesting property to know, as these entries may not be useful to us at all times, and having an easy way to filter them out is helpful..
end property ¤
Address beyond mapping. So the last effective address is self.end-1 It is the same as displayed in /proc/
round_down ¤
round_down(address, align) -> int
Round down address to the nearest increment of align.
round_up ¤
round_up(address, align) -> int
Round up address to the nearest increment of align.
format_address ¤
format_address(
vaddr: int,
memsz: int,
permstr: str,
offset: int,
objfile: str | None = None,
) -> str
Format the given address as a string.
page_align ¤
page_align(address) -> int
Round down address to the nearest page boundary.