volatility3.framework.symbols.linux.kallsyms module
- class KASConfig(num_syms_address, names_address, token_table_address, token_index_address, offsets_address, relative_base_address, _stext, markers_address=None, addresses_address=None, _sinittext=None, _einittext=None, _etext=None, _end=None, mod_tree=None, module_addr_min=None, module_addr_max=None, start_ksymtab=None, stop_ksymtab=None, bpf_tree_address=None, seqs_of_names_address=None, num_syms_type_size=None, markers_type_size=None, kernel_symbol_size=None)[source]
Bases:
objectKallsyms configuration class
- class KASSymbol(name, type, address, size, module_name, exported=False, subsystem=None)[source]
Bases:
KASSymbolBasic
- class Kallsyms(context, layer_name, module_name, kas_config=None, progress_callback=None)[source]
Bases:
VersionableInterfaceKallsyms API class
Initialize the Kallsyms API
- Parameters:
context (
ContextInterface) – The context used to access memory layers and symbolslayer_name (
str) – The name of layer within the context in which the module existsmodule_name (
str) – The name of the kernel module on which to operatekas_config (
KASConfig) – The KAllSyms configurationprogress_callback (
Optional[Callable[[float,str],None]]) – Method that is called periodically during scanning to update progress
- bpf_lookup_address(address)[source]
Search for a BPF symbol based on its memory address.
Based on bpf_address_lookup() and __bpf_address_lookup()
- core_lookup_address(address)[source]
Search for a symbol by its memory address within the kernel core.
Based on kallsyms_lookup_buildid.
- ftrace_lookup_address(address)[source]
Search for a ftrace symbol based on its address.
Based on ftrace_mod_address_lookup()
- get_core_symbols(progress_callback=None)[source]
Yield each kernel core symbol
- Parameters:
progress_callback (
Optional[Callable[[float,str],None]]) – Method that is called periodically during scanning to update progress- Return type:
Based on kallsyms_on_each_symbol()
- Yields:
KASSymbol objects
- get_modules_symbols(name=None)[source]
Yield each symbol from the kernel modules. This function iterates over the symbols of the kernel modules and yields them as KASSymbol objects.
name (optional): If specified, the symbol name used to filter the symbols.
- lookup_address(address)[source]
Search for a symbol by its memory address.
This function scans kernel core, module symbols, BPF symbols, and Ftrace symbols to locate the first symbol matching the specified address. Note that multiple symbols (aliased symbols) can share the same memory address, so this method returns the first match found.
Based on kallsyms_lookup.
- lookup_name(name)[source]
Search symbols by name. WARNING: This function is super slow. The kernel does not index the symbols by name, so the it is a linear search.
Based on kallsyms_lookup_name
- module_lookup_address(address, module=None)[source]
Search for a symbol within kernel modules based on its memory address. If a module object is provided, it will only search in that module. Otherwise, it will try to first find the module to where the provided address belong to.
Based on module_address_lookup.
- Parameters:
- Return type:
- Returns:
The matching KASSymbol if found; otherwise, returns None
- version = (1, 0, 0)