I am working with a crackmes binary called Simple Overflow. It has two buffers with sizes 0x10 and 0x8, and it uses malloc to allocate two contiguous memory blocks (see <+25> and <+39> on the screenshot).

enter image description here

A solution provided by escalatedquickly stated that “By debugging the program we can see where on the heap the two buffers are allocated. In my case, they are allocated at ‘0x000056050A21F670’ and ‘0x000056050A21F690’ respectively”. I’ve searched how to get these addresses, but I have only found solutions for cases when the variable names are known (e.g., here and here).

How do I find the buffers’ addresses in GDB to replicate what escalatedquickly did?

  • malloc returns the address and it is stored in [rbp-10] and [rbp-8] these address are dynamic and wont have any names single step and grab the address from rax after the malloc call if that is what you are looking for
    – blabb
    Feb 2 at 19:10
  • Thank you @blabb. It worked. Feb 2 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.