title: Binary Bomb Phase 3 -- Confused about using jump table
body: <p>I am trying to figure out the correct input to defuse the bomb at phase 3 of the binary bomb lab. I have figured out that the input must be two integers, and that the first integer must be less than 7. I have been using an arbitrary first value (1) to try to figure out the second value by using the jump table, but I can't seem to get the answer. Specifically, I keep detonating the bomb after this line <code>0x0000000000400ffc &lt;+165&gt;:    cmp    0x8(%rsp),%eax</code>. </p>
  
  <p>Any help or guidance would be greatly appreciated.</p>
  
  <p>Dump of assembler code for function phase_3:</p>
  
  <pre><code>    0x0000000000400f57 &lt;+0&gt;:    sub    $0x18,%rsp
      0x0000000000400f5b &lt;+4&gt;:    lea    0x8(%rsp),%rcx
      0x0000000000400f60 &lt;+9&gt;:    lea    0xc(%rsp),%rdx
      0x0000000000400f65 &lt;+14&gt;:   mov    $0x4027ed,%esi
      0x0000000000400f6a &lt;+19&gt;:   mov    $0x0,%eax
      0x0000000000400f6f &lt;+24&gt;:   callq  0x400c30 &lt;__isoc99_sscanf@plt&gt;
      0x0000000000400f74 &lt;+29&gt;:   cmp    $0x1,%eax
      0x0000000000400f77 &lt;+32&gt;:   jg     0x400f7e &lt;phase_3+39&gt;
      0x0000000000400f79 &lt;+34&gt;:   callq  0x401574 &lt;explode_bomb&gt;
      0x0000000000400f7e &lt;+39&gt;:   cmpl   $0x7,0xc(%rsp)
      0x0000000000400f83 &lt;+44&gt;:   ja     0x400feb &lt;phase_3+148&gt;
      0x0000000000400f85 &lt;+46&gt;:   mov    0xc(%rsp),%eax
      0x0000000000400f89 &lt;+50&gt;:   jmpq   *0x402520(,%rax,8)
      0x0000000000400f90 &lt;+57&gt;:   mov    $0x0,%eax
      0x0000000000400f95 &lt;+62&gt;:   jmp    0x400f9c &lt;phase_3+69&gt;
      0x0000000000400f97 &lt;+64&gt;:   mov    $0x3a0,%eax
      0x0000000000400f9c &lt;+69&gt;:   sub    $0x3c2,%eax
      0x0000000000400fa1 &lt;+74&gt;:   jmp    0x400fa8 &lt;phase_3+81&gt;
      0x0000000000400fa3 &lt;+76&gt;:   mov    $0x0,%eax
      0x0000000000400fa8 &lt;+81&gt;:   add    $0x23d,%eax
      0x0000000000400fad &lt;+86&gt;:   jmp    0x400fb4 &lt;phase_3+93&gt;
      0x0000000000400faf &lt;+88&gt;:   mov    $0x0,%eax
      0x0000000000400fb4 &lt;+93&gt;:   sub    $0x3e6,%eax
      0x0000000000400fb9 &lt;+98&gt;:   jmp    0x400fc0 &lt;phase_3+105&gt;
      0x0000000000400fbb &lt;+100&gt;:  mov    $0x0,%eax
      0x0000000000400fc0 &lt;+105&gt;:  add    $0x3e6,%eax
      0x0000000000400fc5 &lt;+110&gt;:  jmp    0x400fcc &lt;phase_3+117&gt;
      0x0000000000400fc7 &lt;+112&gt;:  mov    $0x0,%eax
      0x0000000000400fcc &lt;+117&gt;:  sub    $0x3e6,%eax
      0x0000000000400fd1 &lt;+122&gt;:  jmp    0x400fd8 &lt;phase_3+129&gt;
      0x0000000000400fd3 &lt;+124&gt;:  mov    $0x0,%eax
      0x0000000000400fd8 &lt;+129&gt;:  add    $0x3e6,%eax
      0x0000000000400fdd &lt;+134&gt;:  jmp    0x400fe4 &lt;phase_3+141&gt;
      0x0000000000400fdf &lt;+136&gt;:  mov    $0x0,%eax
      0x0000000000400fe4 &lt;+141&gt;:  sub    $0x3e6,%eax
      0x0000000000400fe9 &lt;+146&gt;:  jmp    0x400ff5 &lt;phase_3+158&gt;
      0x0000000000400feb &lt;+148&gt;:  callq  0x401574 &lt;explode_bomb&gt;
      0x0000000000400ff0 &lt;+153&gt;:  mov    $0x0,%eax
      0x0000000000400ff5 &lt;+158&gt;:  cmpl   $0x5,0xc(%rsp)
      0x0000000000400ffa &lt;+163&gt;:  jg     0x401002 &lt;phase_3+171&gt;
   =&gt; 0x0000000000400ffc &lt;+165&gt;:  cmp    0x8(%rsp),%eax
      0x0000000000401000 &lt;+169&gt;:  je     0x401007 &lt;phase_3+176&gt;
      0x0000000000401002 &lt;+171&gt;:  callq  0x401574 &lt;explode_bomb&gt;
      0x0000000000401007 &lt;+176&gt;:  add    $0x18,%rsp
      0x000000000040100b &lt;+180&gt;:  retq 
  </code></pre>