Skip to content

Instantly share code, notes, and snippets.

@0xBADCA7
Forked from nmcv/gdb_ascii_examine.txt
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xBADCA7/e08bc803c4783d9e07b7 to your computer and use it in GitHub Desktop.
Save 0xBADCA7/e08bc803c4783d9e07b7 to your computer and use it in GitHub Desktop.
define xac
dont-repeat
set $addr = (char *)($arg0)
set $endaddr = $addr + $arg1
while $addr < $endaddr
printf "%p: ", $addr
set $lineendaddr = $addr + 8
if $lineendaddr > $endaddr
set $lineendaddr = $endaddr
end
set $a = $addr
while $a < $lineendaddr
printf "%#02x ", *(char *)$a
set $a++
end
printf "'"
set $a = $addr
while $a < $lineendaddr
printf "%c", *(char *)$a
set $a++
end
printf "'\n"
set $addr = $addr + 8
end
end
document xac
usage: xac address count
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment