Last active
October 22, 2019 10:30
-
-
Save b1tninja/35cb36f65be698dca14e745da46c7fb7 to your computer and use it in GitHub Desktop.
kcrctab from /dev/mem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
offsets=($(egrep "__kcrctab" /proc/kallsyms | cut -d " " -f 1 | sort -u)); | |
for ((i=0; i<$((${#offsets[@]}-1)); i++)); do | |
start=$((0x${offsets[$i]})); | |
stop=$((0x${offsets[(($i+1))]})); | |
len=$(($stop-$start)); | |
dd if=/dev/mem bs=${len} skip=${start} count=1 status=none; | |
done | od --endian little -t x4 -w4 -A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"${OBJCOPY}" -I binary -O elf32-littlearm --add-section '.modinfo'=<(sed -re "s/(vermagic=)[^\0]*/\1$(modinfo -F vermagic "${KNOWNGOOD}")/" <("${OBJCOPY}" -j '.modinfo' -I elf32-littlearm -O binary "${FIXUP}" /dev/stdout)) "${FIXUP}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment