- a phone like redmi note 11
- kernel source code from Xiaomi_Kernel_OpenSource
- a kernel product of compiled success(don't forget open support of kprobe at arch/arm64/configs/xxxx_defconfig)
CONFIG_KPROBES=y CONFIG_HAVE_KPROBES=y CONFIG_KPROBE_EVENTS=y
- git clone https://github.com/tcc0lin/android_kprobe_hook_architecture
- cd android_kprobe_hook_architecture
- modify path on Makefile
KERNEL_OUT=/xxxxx/xiaomi_kernel_opensource-selene-r-oss/out TOOLCHAIN=/xxxxx/android_prebuilts_gcc_linux-x86_aarch64_aarch64-linux-android-4.9-lineage-19.1/bin/aarch64-linux-android-
- build
then you can get the following file
make
Sample.ko Sample.mod.c Sample.mod.o Sample.o
- install LKM
insmod Sample.ko