title: cmp and je not working when comparing equal values
body: <p>[Homework disclaimer]</p>
  
  <p>I'm working on the <a href="http://csapp.cs.cmu.edu/public/README-bomblab" rel="nofollow">binary bomb lab</a>. Basically, I have to use the objdump of a "bomb" executable to find the right input strings to disarm the "bomb." Currently I've solved 5/7 phases and am working on the 6th phase which contains this assembly:</p>
  
  <pre><code> 8048eb0:   39 18                   cmp    %ebx,(%eax)
   8048eb2:   74 05                   je     8048eb9 &lt;phase_6+0x49&gt;
   8048eb4:   e8 d0 0a 00 00          call   8049989 &lt;explode_bomb&gt;
  </code></pre>
  
  <p>To not explode the bomb, I need to set ebx and eax to same value so that <code>je</code> is called instead of the <code>explode_bomb</code> function. So, I found an input string that gives the same value of ebx and eax. However, when I reach this point in the program's execution, the <code>je</code> isn't called even though ebx and eax are the same value. In GDB:</p>
  
  <pre><code>Good work!  On to the next...
  134530284
  
  Breakpoint 2, 0x08048e74 in phase_6 ()
  Current language:  auto; currently asm
  (gdb) break *0x8048eb0
  Breakpoint 3 at 0x8048eb0
  (gdb) c
  Continuing.
  
  Breakpoint 3, 0x08048eb0 in phase_6 ()
  (gdb) print $ebx
  $1 = 134530284
  (gdb) print $eax
  $2 = 134530284
  (gdb) si
  0x08048eb2 in phase_6 ()
  (gdb) si
  0x08048eb4 in phase_6 ()
  (gdb) si
  0x08049989 in explode_bomb ()
  (gdb) 
  </code></pre>
  
  <p>Why is this not working? This is the first time this assignment where this issue has come up.</p>