0

How can I view the data at the address of the first operand in gdb?

cmp [ebp+eax], edi

I tried using:

print /d $ebp
print /d $eax

and manually adding the values to make the address, but was not sure what to do next, or if there was an easier way...

1 Answer 1

1
(gdb) help x
Examine memory: x/FMT ADDRESS.
ADDRESS is an expression for the memory address to examine.
FMT is a repeat count followed by a format letter and a size letter.
Format letters are o(octal), x(hex), d(decimal), u(unsigned decimal),
  t(binary), f(float), a(address), i(instruction), c(char) and s(string).
Size letters are b(byte), h(halfword), w(word), g(giant, 8 bytes).
The specified number of objects of the specified size are printed
according to the format.

For your example:

x/d $ebp+$eax
Sign up to request clarification or add additional context in comments.

1 Comment

thanks, it was that second dollar sign I was missing from x/d $ebp+eax

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.