Question: Binary Bomb Phase 3 Help: I need to find the output from the assembly provided: 0000000000400fb5 : 400fb5: 48 83 ec 18 sub $0x18,%rsp 400fb9:
Binary Bomb Phase 3 Help:
I need to find the output from the assembly provided:
0000000000400fb5 : 400fb5: 48 83 ec 18 sub $0x18,%rsp 400fb9: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax 400fc0: 00 00 400fc2: 48 89 44 24 08 mov %rax,0x8(%rsp) 400fc7: 31 c0 xor %eax,%eax 400fc9: 48 8d 4c 24 04 lea 0x4(%rsp),%rcx 400fce: 48 89 e2 mov %rsp,%rdx 400fd1: be 6d 29 40 00 mov $0x40296d,%esi 400fd6: e8 65 fc ff ff callq 400c40 <__isoc99_sscanf> 400fdb: 83 f8 01 cmp $0x1,%eax 400fde: 7f 05 jg 400fe5 400fe0: e8 a2 06 00 00 callq 401687 400fe5: 83 3c 24 07 cmpl $0x7,(%rsp) 400fe9: 77 65 ja 401050 400feb: 8b 04 24 mov (%rsp),%eax 400fee: ff 24 c5 a0 26 40 00 jmpq *0x4026a0(,%rax,8) 400ff5: b8 e0 01 00 00 mov $0x1e0,%eax 400ffa: eb 05 jmp 401001 400ffc: b8 00 00 00 00 mov $0x0,%eax 401001: 2d 3c 03 00 00 sub $0x33c,%eax 401006: eb 05 jmp 40100d 401008: b8 00 00 00 00 mov $0x0,%eax 40100d: 05 d2 03 00 00 add $0x3d2,%eax 401012: eb 05 jmp 401019 401014: b8 00 00 00 00 mov $0x0,%eax 401019: 2d 6b 01 00 00 sub $0x16b,%eax 40101e: eb 05 jmp 401025 401020: b8 00 00 00 00 mov $0x0,%eax 401025: 05 6b 01 00 00 add $0x16b,%eax 40102a: eb 05 jmp 401031 40102c: b8 00 00 00 00 mov $0x0,%eax 401031: 2d 6b 01 00 00 sub $0x16b,%eax 401036: eb 05 jmp 40103d 401038: b8 00 00 00 00 mov $0x0,%eax 40103d: 05 6b 01 00 00 add $0x16b,%eax 401042: eb 05 jmp 401049 401044: b8 00 00 00 00 mov $0x0,%eax 401049: 2d 6b 01 00 00 sub $0x16b,%eax 40104e: eb 0a jmp 40105a 401050: e8 32 06 00 00 callq 401687 401055: b8 00 00 00 00 mov $0x0,%eax 40105a: 83 3c 24 05 cmpl $0x5,(%rsp) 40105e: 7f 06 jg 401066 401060: 3b 44 24 04 cmp 0x4(%rsp),%eax 401064: 74 05 je 40106b 401066: e8 1c 06 00 00 callq 401687 40106b: 48 8b 44 24 08 mov 0x8(%rsp),%rax 401070: 64 48 33 04 25 28 00 xor %fs:0x28,%rax 401077: 00 00 401079: 74 05 je 401080 40107b: e8 10 fb ff ff callq 400b90 <__stack_chk_fail> 401080: 48 83 c4 18 add $0x18,%rsp 401084: c3 retq
And here is a picture of it all disassembled:

(gdb) disassemble Dump of assembler code for function phase 3 sub nov x18,xrsp 0x0000000000400fb9 : nov 0x0008000080400fc7 : xor 0x0000000000400fc9 lea %fs:0x28 , %rax %rax,6x8(%rsp) eax,eax 0x4(arsp),rcx 0x0000000080400fd1 : callq 0x400c40 0x0000000000488fdb : cmp $6x1,%eax 0x0000000000400fde : jg 400fe5 0x0000000000400fe : callq6x401687 explode-bomb 0x0000000000400fe9C+52: 0x000000000400feb (rsp),xeax 0x0000000000400ff5 : nov S6x1eo,%eax 6x0000000000400ffa69a: jnp 6x401001 0x0008008000400ffc : jmp 40100d 0x0000000000401008 add $ex3d2,eax Type to continue, or q to quit- 0x0000600000401012 : sub $6x16b,seax 0x000000000040101e : jnp 0x401025 8x0000000000401029: ov $6x8,%eax 0x0000000000401025 : add $6x16b,%eax 0x000000000040102a : jmp 0x401031 phase_3+124> 8x000000000040182C : MOV $6x8,%eax 0x0000000000401031 124: sub $0x16b,%eax 0x0000000000401036 : jmp 0x40103d phase 3+136> 8x0000000000401638 : MOV $0x8,%eax 0x000000000040103d : jmp 0x401049 sphase 3+148> 8x0000000000401044 : jnp 4185a 8xee08608080401850 : callq 0x401687 0x0000000000401055 : cmp1 $6x5,(%rsp) 0x000000000040 105e 0x0000000000401068 : 0x4(Xrsp),%eax 8x0000000000401864 : je 40186b 0x0000000000401066 177: callq0x401687explode-bond - -Type to continue, or q to quit--. 0x0000000000401079 : 8x000000000401679 : 0x0000000000401080 : xor je callg %fs:0x28 ,%rax 6x401880 400b90 : nov 0x0008000080400fc7 : xor 0x0000000000400fc9 lea %fs:0x28 , %rax %rax,6x8(%rsp) eax,eax 0x4(arsp),rcx 0x0000000080400fd1 : callq 0x400c40 0x0000000000488fdb : cmp $6x1,%eax 0x0000000000400fde : jg 400fe5 0x0000000000400fe : callq6x401687 explode-bomb 0x0000000000400fe9C+52: 0x000000000400feb (rsp),xeax 0x0000000000400ff5 : nov S6x1eo,%eax 6x0000000000400ffa69a: jnp 6x401001 0x0008008000400ffc : jmp 40100d 0x0000000000401008 add $ex3d2,eax Type to continue, or q to quit- 0x0000600000401012 : sub $6x16b,seax 0x000000000040101e : jnp 0x401025 8x0000000000401029: ov $6x8,%eax 0x0000000000401025 : add $6x16b,%eax 0x000000000040102a : jmp 0x401031 phase_3+124> 8x000000000040182C : MOV $6x8,%eax 0x0000000000401031 124: sub $0x16b,%eax 0x0000000000401036 : jmp 0x40103d phase 3+136> 8x0000000000401638 : MOV $0x8,%eax 0x000000000040103d : jmp 0x401049 sphase 3+148> 8x0000000000401044 : jnp 4185a 8xee08608080401850 : callq 0x401687 0x0000000000401055 : cmp1 $6x5,(%rsp) 0x000000000040 105e 0x0000000000401068 : 0x4(Xrsp),%eax 8x0000000000401864 : je 40186b 0x0000000000401066 177: callq0x401687explode-bond - -Type to continue, or q to quit--. 0x0000000000401079 : 8x000000000401679 : 0x0000000000401080 : xor je callg %fs:0x28 ,%rax 6x401880 400b90