Skip to content

symbol ¤

Classes:

Functions:

Attributes:

POSSIBLE_ZONE_NAMES module-attribute ¤

POSSIBLE_ZONE_NAMES = ("DMA", "DMA32", "Normal", "HighMem", "Movable", "Device")

COMMON_TYPES module-attribute ¤

COMMON_TYPES = '\n#include <stdint.h>\n#include <stddef.h>\n#include <linux/version.h>\ntypedef unsigned char u8;\ntypedef char s8;\ntypedef unsigned short u16;\ntypedef unsigned int u32;\ntypedef long long s64;\ntypedef unsigned long u64;\n#define bool int\n#if UINTPTR_MAX == 0xffffffff\n    typedef int16_t arch_word_t;\n#else\n    typedef int32_t arch_word_t;\n#endif\ntypedef struct {\n    unsigned int val;\n} kuid_t;\ntypedef struct {\n    unsigned int val;\n} kgid_t;\ntypedef int pid_t;\ntypedef struct {\n    int counter;\n} atomic_t;\ntypedef struct refcount_struct {\n\tatomic_t refs;\n} refcount_t;\n\nstruct list_head {\n    struct list_head *next, *prev;\n};\nstruct hlist_node {\n\tstruct hlist_node *next, **pprev;\n};\nstruct kmem_cache;\nenum pageflags {\n\tPG_locked,\t\t/* Page is locked. Don\'t touch. */\n\tPG_writeback,\t\t/* Page is under writeback */\n\tPG_referenced,\n\tPG_uptodate,\n\tPG_dirty,\n\tPG_lru,\n\tPG_head,\t\t/* Must be in bit 6 */\n\tPG_waiters,\t\t/* Page has waiters, check its waitqueue. Must be bit #7 and in the same byte as "PG_locked" */\n\tPG_active,\n\tPG_workingset,\n\tPG_owner_priv_1,\t/* Owner use. If pagecache, fs may use */\n\tPG_owner_2,\t\t/* Owner use. If pagecache, fs may use */\n\tPG_arch_1,\n\tPG_reserved,\n\tPG_private,\t\t/* If pagecache, has fs-private data */\n\tPG_private_2,\t\t/* If pagecache, has fs aux data */\n\tPG_reclaim,\t\t/* To be reclaimed asap */\n\tPG_swapbacked,\t\t/* Page is backed by RAM/swap */\n\tPG_unevictable,\t\t/* Page is "unevictable"  */\n\tPG_dropbehind,\t\t/* drop pages on IO completion */\n};\n#define POINTER_SIZE (sizeof(void *))\n'

P module-attribute ¤

P = ParamSpec('P')

NeedLookup ¤

ArchSymbols ¤

ArchSymbols()

Methods:

Attributes:

node_data_heuristic_func instance-attribute ¤

node_data_heuristic_func = 'first_online_pgdat'

slab_caches_heuristic_func instance-attribute ¤

slab_caches_heuristic_func = 'slab_next'

per_cpu_offset_heuristic_func instance-attribute ¤

per_cpu_offset_heuristic_func = 'nr_iowait_cpu'

modules_heuristic_func instance-attribute ¤

modules_heuristic_func = 'find_module_all'

db_list_heuristic_func instance-attribute ¤

db_list_heuristic_func = (
    "dma_buf_file_release"
    if (not krelease or krelease >= (5, 10))
    else "dma_buf_release"
)

prog_idr_heuristic_func instance-attribute ¤

prog_idr_heuristic_func = 'bpf_prog_free_id'

map_idr_heuristic_func instance-attribute ¤

map_idr_heuristic_func = 'bpf_map_free_id'

current_task_heuristic_func instance-attribute ¤

current_task_heuristic_func = 'common_cpu_up'

disass ¤

disass(name: str) -> str | None

regex ¤

regex(s: str, pattern: str, nth: int) -> Match[Any] | None

node_data ¤

node_data() -> int | type[NeedLookup]

slab_caches ¤

slab_caches() -> type[NeedLookup]

per_cpu_offset ¤

per_cpu_offset() -> type[NeedLookup]

modules ¤

modules() -> type[NeedLookup]

db_list ¤

db_list() -> int | type[NeedLookup] | None

map_idr ¤

map_idr() -> type[NeedLookup]

prog_idr ¤

prog_idr() -> type[NeedLookup]

current_task ¤

current_task() -> type[NeedLookup]

x86_64Symbols ¤

x86_64Symbols()

Bases: ArchSymbols

Methods:

Attributes:

node_data_heuristic_func instance-attribute ¤

node_data_heuristic_func = 'first_online_pgdat'

slab_caches_heuristic_func instance-attribute ¤

slab_caches_heuristic_func = 'slab_next'

per_cpu_offset_heuristic_func instance-attribute ¤

per_cpu_offset_heuristic_func = 'nr_iowait_cpu'

modules_heuristic_func instance-attribute ¤

modules_heuristic_func = 'find_module_all'

db_list_heuristic_func instance-attribute ¤

db_list_heuristic_func = (
    "dma_buf_file_release"
    if (not krelease or krelease >= (5, 10))
    else "dma_buf_release"
)

prog_idr_heuristic_func instance-attribute ¤

prog_idr_heuristic_func = 'bpf_prog_free_id'

map_idr_heuristic_func instance-attribute ¤

map_idr_heuristic_func = 'bpf_map_free_id'

current_task_heuristic_func instance-attribute ¤

current_task_heuristic_func = 'common_cpu_up'

qword_op_reg_memoff ¤

qword_op_reg_memoff(
    disass: str, op: str, sign: str = "-", nth: int = 0
) -> int | None

dword_op_memoff_reg ¤

dword_op_memoff_reg(
    disass: str, op: str, sign: str = "-", nth: int = 0
) -> int | None

qword_mov_reg_const ¤

qword_mov_reg_const(disass: str, nth: int = 0) -> int | None

dword_mov_reg_const ¤

dword_mov_reg_const(disass: str, nth: int = 0) -> int | None

qword_mov_reg_ripoff ¤

qword_mov_reg_ripoff(disass: str, nth: int = 0) -> int | None

disass ¤

disass(name: str) -> str | None

regex ¤

regex(s: str, pattern: str, nth: int) -> Match[Any] | None

node_data ¤

node_data() -> int | type[NeedLookup]

slab_caches ¤

slab_caches() -> type[NeedLookup]

per_cpu_offset ¤

per_cpu_offset() -> type[NeedLookup]

modules ¤

modules() -> type[NeedLookup]

db_list ¤

db_list() -> int | type[NeedLookup] | None

map_idr ¤

map_idr() -> type[NeedLookup]

prog_idr ¤

prog_idr() -> type[NeedLookup]

current_task ¤

current_task() -> type[NeedLookup]

Aarch64Symbols ¤

Aarch64Symbols()

Bases: ArchSymbols

Methods:

Attributes:

node_data_heuristic_func instance-attribute ¤

node_data_heuristic_func = 'first_online_pgdat'

slab_caches_heuristic_func instance-attribute ¤

slab_caches_heuristic_func = 'slab_next'

per_cpu_offset_heuristic_func instance-attribute ¤

per_cpu_offset_heuristic_func = 'nr_iowait_cpu'

modules_heuristic_func instance-attribute ¤

modules_heuristic_func = 'find_module_all'

db_list_heuristic_func instance-attribute ¤

db_list_heuristic_func = (
    "dma_buf_file_release"
    if (not krelease or krelease >= (5, 10))
    else "dma_buf_release"
)

prog_idr_heuristic_func instance-attribute ¤

prog_idr_heuristic_func = 'bpf_prog_free_id'

map_idr_heuristic_func instance-attribute ¤

map_idr_heuristic_func = 'bpf_map_free_id'

current_task_heuristic_func instance-attribute ¤

current_task_heuristic_func = 'common_cpu_up'

qword_adrp_add_const ¤

qword_adrp_add_const(disass: str, nth: int = 0) -> int | None

current_task ¤

current_task() -> int | None

disass ¤

disass(name: str) -> str | None

regex ¤

regex(s: str, pattern: str, nth: int) -> Match[Any] | None

node_data ¤

node_data() -> int | type[NeedLookup]

slab_caches ¤

slab_caches() -> type[NeedLookup]

per_cpu_offset ¤

per_cpu_offset() -> type[NeedLookup]

modules ¤

modules() -> type[NeedLookup]

db_list ¤

db_list() -> int | type[NeedLookup] | None

map_idr ¤

map_idr() -> type[NeedLookup]

prog_idr ¤

prog_idr() -> type[NeedLookup]

migratetype_names ¤

migratetype_names() -> tuple[str, ...]

try_usymbol ¤

try_usymbol(name: str, size: int | None = None) -> int | None

nzones ¤

nzones() -> int

nmtypes ¤

nmtypes() -> int

node_data_pointer ¤

node_data_pointer() -> Value | None

get_one_node_data ¤

get_one_node_data() -> Value | None

npcplist ¤

npcplist() -> int

kversion_cint ¤

kversion_cint(kversion: tuple[int, ...] | None = None) -> int | None

recover_page_typeinfo ¤

recover_page_typeinfo() -> str

load_common_structs_on_load_linux ¤

load_common_structs_on_load_linux() -> None

kernel_symbol_func ¤

kernel_symbol_func(
    prefer_symbol: bool = True, symbol_name: str | None = None
) -> Callable[
    [Callable[P, int | type[NeedLookup] | None]], Callable[P, int | None]
]

Marks a kernel symbol lookup function. This decorator should be used exclusively for ArchSymbols (and its subclasses).

Parameters:

  • prefer_symbol (bool, default: True ) –

    if true, this decorator will try to resolve the actual symbol address with lookup_symbol first.

  • symbol_name (str | None, default: None ) –

    the actual name of the symbol, if different from the function name.

The return value of the wrapped function will be returnedif the value is of type int | None. If NeedLookup is returned, further lookup is needed.

Returns:

  • Callable[[Callable[P, int | type[NeedLookup] | None]], Callable[P, int | None]]

    The address of the symbol if the symbol was resolved, else None is returned.