I have a void* and I think there’s a string nearby, somewhere within the next few bytes, but I’m not sure where. I don’t know have any other knowledge of the what’s nearby in memory, including whether there are 0s, so casting to char* isn’t what I want. How can I print the next 20 bytes from this pointer as characters?
Share
Use the “x“ command to display the memory contents at a given address using the specified format.
Syntax:
Dumps 20 bytes as characters:
Dumps 20 bytes as hex:
See GDB command reference for x command