Skip to content

Instantly share code, notes, and snippets.

@nonkr
Last active November 6, 2016 05:27
Show Gist options
  • Save nonkr/6ac074d8439c38978905674f7c45d453 to your computer and use it in GitHub Desktop.
Save nonkr/6ac074d8439c38978905674f7c45d453 to your computer and use it in GitHub Desktop.
gdbinit
set print pretty on
define phs
if $argc != 2
help phs
else
set $_i = 0
if $arg1 > 0
echo \033[34m
while ($_i < $arg1)
printf "%02x", $arg0[$_i] & 0xFF
set $_i++
end
echo \033[0m
printf "\n"
end
end
end
document phs
Display Print as a Hex Stream
Usage: phs <memory address> <memory size>
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment