Skip to content

Instantly share code, notes, and snippets.

@karolherbst
Last active September 2, 2015 00:49
Show Gist options
  • Save karolherbst/5e4bffe5a7e4e6bd372d to your computer and use it in GitHub Desktop.
Save karolherbst/5e4bffe5a7e4e6bd372d to your computer and use it in GitHub Desktop.
if [[ -z "${CARD}" ]]; then
CARD='0'
fi
chipset=$(nvalist | head -$((${CARD} + 1)) | tail -1 | cut -d\ -f3)
nvapeek -c"${CARD}" $1 $2 | while read line; do
reg=$(echo $line | cut -d: -f1)
if [ ! "$reg" == "..." ]; then
for i in {2..5}; do
value=$(echo $line | cut -d\ -f$i)
if [ ! "$value" == "00000000" ]; then
reg_new=$(echo 16o$((0x$reg + 0x4 * ($i * 2)))p | /usr/bin/dc)
printf "$reg_new $value "
lookup -a"${chipset}" $reg_new $value
fi
done
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment