Files
linux-kernel-module-cheat/rootfs_overlay/virt_to_phys.sh
2017-07-14 13:01:24 +01:00

9 lines
226 B
Bash
Executable File

#!/bin/sh
set -ex
insmod /virt_to_phys.ko
cat /sys/kernel/debug/lkmc_virt_to_phys
addr=$(grep virt_to_phys /sys/kernel/debug/lkmc_virt_to_phys | cut -d ' ' -f 2)
devmem2 "$addr"
devmem2 "$addr" w 0x87654321
rmmod virt_to_phys