Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Examining ASCII

Tags:

c

ascii

gdb

How can I get the ASCII representation of hexadecimal values in the memory by examining in gdb?

The gdb command x/[repeatCount] [memoryAddress] gives me hexadecimal 32-bit values starting at memoryAddress repeatCount times but I want the readable text/String which is represented by this data. How do I do that? This page doesn't seem to tell.

For instance I get the following by examining:

0x41414141

What I want to see instead or as well is this:

AAAA

Like an ordinary Hex <-> ASCII converter.

like image 236
BullyWiiPlaza Avatar asked Apr 26 '15 18:04

BullyWiiPlaza


1 Answers

Nevermind, I need to use the format letter s for String.

x/[repeatCount]s [memoryAddress]

Found by typing

help x

and reading the help documentation. <_<

like image 190
BullyWiiPlaza Avatar answered Sep 21 '22 02:09

BullyWiiPlaza