Skip to content

Instantly share code, notes, and snippets.

@jfogarty
Created October 2, 2019 16:10
Show Gist options
  • Save jfogarty/d986dff1184399d67f912da34baa71a5 to your computer and use it in GitHub Desktop.
Save jfogarty/d986dff1184399d67f912da34baa71a5 to your computer and use it in GitHub Desktop.
Recover a file from extended RAM under a hypervisor guest OS
function chr() {
printf \\$(printf '%03o' $((16#$1)) )
}
addr=$((16#302100000))
cx=$(devmem $addr w)
c=$((16#${cx:2}))
echo "- The file size is $c bytes."
a=$((addr + 4))
for (( i=0; i<$c; i++)) ; do
ch=$(devmem $((a + i)) b)
chr ${ch:2} >> AID_OPC.xml
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment