title: GDB assembler debugging
body: <p>I have to do a some binary analyses for a class, and I am stuck on one of the programs. When I set some breakpoints and disas, I see that it looks like this :</p>
  
  <pre><code>Dump of assembler code for function main:
      0x080484e2 &lt;+0&gt;:    push   %ebp
      0x080484e3 &lt;+1&gt;:    mov    %esp,%ebp
      0x080484e5 &lt;+3&gt;:    sub    $0x48,%esp
      0x080484e8 &lt;+6&gt;:    and    $0xfffffff0,%esp
      0x080484eb &lt;+9&gt;:    mov    $0x0,%eax
      0x080484f0 &lt;+14&gt;:   sub    %eax,%esp
      0x080484f2 &lt;+16&gt;:   cmpl   $0x1,0x8(%ebp)
      0x080484f6 &lt;+20&gt;:   jg     0x8048504 &lt;main+34&gt;
      0x080484f8 &lt;+22&gt;:   movl   $0x7,(%esp)
   =&gt; 0x080484ff &lt;+29&gt;:   call   0x804833c &lt;exit@plt&gt;
      0x08048504 &lt;+34&gt;:   mov    0xc(%ebp),%eax
      0x08048507 &lt;+37&gt;:   add    $0x4,%eax
      0x0804850a &lt;+40&gt;:   mov    (%eax),%eax
      0x0804850c &lt;+42&gt;:   mov    %eax,(%esp)
      0x0804850f &lt;+45&gt;:   call   0x804832c &lt;atoi@plt&gt;
      0x08048514 &lt;+50&gt;:   mov    %eax,-0x10(%ebp)
      0x08048517 &lt;+53&gt;:   cmpl   $0xd,-0x10(%ebp)
      0x0804851b &lt;+57&gt;:   jne    0x804853b &lt;main+89&gt;
      0x0804851d &lt;+59&gt;:   lea    -0x38(%ebp),%eax
      0x08048520 &lt;+62&gt;:   mov    %eax,(%esp)
      0x08048523 &lt;+65&gt;:   call   0x8048414 &lt;makebuf&gt;
      0x08048528 &lt;+70&gt;:   lea    -0x38(%ebp),%eax
      0x0804852b &lt;+73&gt;:   mov    %eax,0x4(%esp)
      0x0804852f &lt;+77&gt;:   movl   $0x804863b,(%esp)
   ** 0x08048536 &lt;+84&gt;:   call   0x804831c &lt;printf@plt&gt;
      0x0804853b &lt;+89&gt;:   movl   $0x1,(%esp)
      0x08048542 &lt;+96&gt;:   call   0x804833c &lt;exit@plt&gt;
  End of assembler dump.
  </code></pre>
  
  <p>(I've edited in the stars next to the location of call to printf@plt).
  What it looks like to me is a program that has a call to exit(), then builds a string, then prints that string out, and then does another exit(). I think that if I can bypass this first call to exit(), it will print me out the answer to the challenge. Is the right way to do this to set the location where the call occurs to execute NOP? If so, what is the opcode for NOP? I've tried setting to 0x0 and 0x00000000. Any help would be greatly appreciated! Thanks. </p>