Standalone implementation of KPM support for Magisk/KernelSU
  • C 97.5%
  • Assembly 1.4%
  • Makefile 0.4%
  • Shell 0.3%
  • Linker Script 0.2%
  • Other 0.1%
Find a file
History 2026-08-30 09:50:25 +06:00
.github update version 2026-01-05 03:18:37 +06:00
doc src: some rebranding stuff 2026-01-02 04:19:38 +06:00
kernel kernel: fix stop_machine 2026-08-30 09:50:25 +06:00
kpms 11.2 2025-02-12 08:54:32 +08:00
tools scripts: add full complete build script 2026-01-15 11:38:26 +06:00
user kernel: user: fix uninitialized buffer causing garbage output in kpm_list 2026-01-20 21:59:00 +06:00
.clang-format 11.2 2025-02-12 08:54:32 +08:00
.gitignore scripts: add full complete build script 2026-01-15 11:38:26 +06:00
banner src: change banner 2026-01-01 08:20:05 +06:00
build.sh scripts: add full complete build script 2026-01-15 11:38:26 +06:00
doxyfile src: some rebranding stuff 2026-01-02 04:19:38 +06:00
LICENSE gplv2 2023-10-10 18:43:08 +08:00
README.md src: some rebranding stuff 2026-01-02 04:19:38 +06:00
revision update revision 2026-01-20 21:59:32 +06:00
version update version 2026-01-13 08:58:13 +06:00

KPatch-Next

Patching and hooking the Linux kernel with only stripped Linux kernel image.

 _  ______       _       _           _   _           _   
| |/ /  _ \ __ _| |_ ___| |__       | \ | | _____  _| |_ 
| ' /| |_) / _` | __/ __| '_ \ _____|  \| |/ _ \ \/ / __|
| . \|  __/ (_| | || (__| | | |_____| |\  |  __/>  <| |_ 
|_|\_\_|   \__,_|\__\___|_| |_|     |_| \_|\___/_/\_\\__|

  • Obtain all symbol information without source code and symbol information.
  • Inject arbitrary code into the kernel. (Static patching the kernel image or Runtime dynamic loading).
  • Kernel function inline hook and syscall table hook are provided.
  • Pure KPM module support for all root managers i.e Magisk & KernelSU/N (Except APatch).
  • Checkout our magisk/kernelsu module! KPatch-Next-Module

Requirement

CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y

or

CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=n (Initial support)

or

CONFIG_KALLSYMS=y

Supported Versions

Currently only supports arm64 architecture.

Linux 3.18 - 6.12 (theoretically)

Get Involved

More Information

Documentation

Credits

  • KernelPatch: Special thanks to the author for making this project possible.
  • vmlinux-to-elf: Some ideas for parsing kernel symbols.
  • android-inline-hook: Some code for fixing arm64 inline hook instructions.
  • tlsf: Memory allocator used for KPM. (Need another to allocate ROX memory.)

License

KPatch-Next is licensed under the GNU General Public License (GPL) 2.0 (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html).