Skip to content

memory ¤

Reading, writing, and describing memory.

Classes:

  • Page

    Represents the address space and page permissions of at least

Functions:

Attributes:

PAGE_SIZE module-attribute ¤

PAGE_SIZE = 4096

PAGE_MASK module-attribute ¤

PAGE_MASK = ~PAGE_SIZE - 1

align_down module-attribute ¤

align_down = round_down

align_up module-attribute ¤

align_up = round_up

Page ¤

Page(start: int, size: int, flags: int, offset: int, objfile: str = '')

Represents the address space and page permissions of at least one page of memory.

Methods:

Attributes:

vaddr class-attribute instance-attribute ¤

vaddr = start

memsz class-attribute instance-attribute ¤

memsz = size

flags class-attribute instance-attribute ¤

flags = flags

offset class-attribute instance-attribute ¤

offset = offset

objfile class-attribute instance-attribute ¤

objfile = objfile

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

start property ¤

start: int

Mapping start address.

end property ¤

end: int

Address beyond mapping. So the last effective address is self.end-1 It is the same as displayed in /proc//maps

is_stack property ¤

is_stack: bool

is_memory_mapped_file property ¤

is_memory_mapped_file: bool

read property ¤

read: bool

write property ¤

write: bool

execute property ¤

execute: bool

rw property ¤

rw: bool

wx property ¤

wx: bool

rwx property ¤

rwx: bool

is_guard property ¤

is_guard: bool

permstr property ¤

permstr: str

__str__ ¤

__str__() -> str

__repr__ ¤

__repr__() -> str

__contains__ ¤

__contains__(addr: int) -> bool

__eq__ ¤

__eq__(other: object) -> bool

__lt__ ¤

__lt__(other: object) -> bool

__hash__ ¤

__hash__() -> int

round_down ¤

round_down(address: int, align: int) -> int

round_down(address, align) -> int

Round down address to the nearest increment of align.

round_up ¤

round_up(address: int, align: int) -> int

round_up(address, align) -> int

Round up address to the nearest increment of align.

page_align ¤

page_align(address: int) -> int

page_align(address) -> int

Round down address to the nearest page boundary.

page_size_align ¤

page_size_align(address: int) -> int

page_offset ¤

page_offset(address: int) -> int