function::probefunc - Linux


Overview

probefunc is a Linux command used for exploring kernel functions. It provides detailed information about the kernel functions, including their address, size, and other properties. This command is particularly useful for debugging, reverse engineering, and security analysis.

Syntax

probefunc [options] <function-name>

Options/Flags

  • -a, –addr: Print the kernel address of the function.
  • -d, –disasm: Disassemble the function and print the assembly code.
  • -f, –function: Specify the kernel function to probe.
  • -g, –global: Search for global symbols with the specified name, not just function symbols.
  • -h, –help: Print usage information.
  • -l, –length: Print the length of the function in bytes.
  • -n, –name: Print only the name of the function.

Examples

To print the kernel address of the sys_clone function:

probefunc -a sys_clone

To disassemble the sys_open function:

probefunc -d sys_open

To search for all global symbols with the name __init:

probefunc -g __init

Common Issues

One common issue when using probefunc is that it may fail to find a function if the kernel has been modified. To resolve this, you can use the -g option to search for global symbols instead of function symbols.

Integration

probefunc can be integrated with other Linux commands and tools for advanced tasks. For example, you can use it with the objdump command to disassemble a kernel image:

objdump -d $(probefunc -a sys_clone)

Related Commands

  • objdump: Disassemble kernel images.
  • nm: List symbols in a kernel image.
  • ksyms: Print kernel symbol information.