Skip to content

mprotect ¤

Functions:

Attributes:

parser module-attribute ¤

parser = ArgumentParser(
    description="\nCalls the mprotect syscall and prints its result value.\n\nNote that the mprotect syscall may fail for various reasons\n(see `man mprotect`) and a non-zero error return value\ncan be decoded with the `errno <value>` command.\n\nExamples:\n    mprotect $rsp 4096 PROT_READ|PROT_WRITE|PROT_EXEC\n    mprotect $rsp 4096 rwx\n    mprotect $rsp 4096 7\n    mprotect some_symbol 0x1000 PROT_NONE\n"
)

SYS_MPROTECT module-attribute ¤

SYS_MPROTECT = 125

prot_dict module-attribute ¤

prot_dict = {'PROT_NONE': 0, 'PROT_READ': 1, 'PROT_WRITE': 2, 'PROT_EXEC': 4}

prot_str_to_val ¤

prot_str_to_val(protstr: str) -> int

Converts a protection string to an integer. Formats include: - A positive integer, like 3 - A combination of r, w, and x, like rw - A combination of PROT_READ, PROT_WRITE, and PROT_EXEC, like PROT_READ|PROT_WRITE

prot_val_to_str ¤

prot_val_to_str(protval: int) -> str

mprotect ¤

mprotect(addr, length, prot) -> None