Question

phase 2 of binary bomb. what is the loop in assembly? Dump of assembler code for...

phase 2 of binary bomb. what is the loop in assembly?

Dump of assembler code for function phase_2:

=> 0x0000555555555754 <+0>: push %rbp

   0x0000555555555755 <+1>: push %rbx

   0x0000555555555756 <+2>: sub $0x28,%rsp

   0x000055555555575a <+6>: mov %fs:0x28,%rax

   0x0000555555555763 <+15>: mov %rax,0x18(%rsp)

   0x0000555555555768 <+20>: xor %eax,%eax

   0x000055555555576a <+22>: mov %rsp,%rsi

   0x000055555555576d <+25>: callq 0x555555555f56 <read_six_numbers>

   0x0000555555555772 <+30>: cmpl $0x1,(%rsp)

   0x0000555555555776 <+34>: jne 0x555555555781 <phase_2+45>

   0x0000555555555778 <+36>: mov %rsp,%rbx

   0x000055555555577b <+39>: lea 0x14(%rbx),%rbp

   0x000055555555577f <+43>: jmp 0x555555555791 <phase_2+61>

   0x0000555555555781 <+45>: callq 0x555555555f1a <explode_bomb>

   0x0000555555555786 <+50>: jmp 0x555555555778 <phase_2+36>

   0x0000555555555788 <+52>: add $0x4,%rbx

   0x000055555555578c <+56>: cmp %rbp,%rbx

   0x000055555555578f <+59>: je 0x5555555557a1 <phase_2+77>

   0x0000555555555791 <+61>: mov (%rbx),%eax

   0x0000555555555793 <+63>: add %eax,%eax

   0x0000555555555795 <+65>: cmp %eax,0x4(%rbx)

   0x0000555555555798 <+68>: je 0x555555555788 <phase_2+52>

   0x000055555555579a <+70>: callq 0x555555555f1a <explode_bomb>

   0x000055555555579f <+75>: jmp 0x555555555788 <phase_2+52>

   0x00005555555557a1 <+77>: mov 0x18(%rsp),%rax

   0x00005555555557a6 <+82>: xor %fs:0x28,%rax

   0x00005555555557af <+91>: jne 0x5555555557b8 <phase_2+100>

   0x00005555555557b1 <+93>: add $0x28,%rsp

   0x00005555555557b5 <+97>: pop %rbx

   0x00005555555557b6 <+98>: pop %rbp

   0x00005555555557b7 <+99>: retq

   0x00005555555557b8 <+100>: callq 0x555555555370 <__stack_chk_fail@plt>

End of assembler dump.

(gdb) disas read_six_numbers

Dump of assembler code for function read_six_numbers:

   0x0000555555555f56 <+0>: sub $0x8,%rsp

   0x0000555555555f5a <+4>: mov %rsi,%rdx

   0x0000555555555f5d <+7>: lea 0x4(%rsi),%rcx

   0x0000555555555f61 <+11>: lea 0x14(%rsi),%rax

   0x0000555555555f65 <+15>: push %rax

   0x0000555555555f66 <+16>: lea 0x10(%rsi),%rax

   0x0000555555555f6a <+20>: push %rax

   0x0000555555555f6b <+21>: lea 0xc(%rsi),%r9

   0x0000555555555f6f <+25>: lea 0x8(%rsi),%r8

   0x0000555555555f73 <+29>: lea 0x12af(%rip),%rsi # 0x555555557229

   0x0000555555555f7a <+36>: mov $0x0,%eax

   0x0000555555555f7f <+41>: callq 0x555555555410 <__isoc99_sscanf@plt>

   0x0000555555555f84 <+46>: add $0x10,%rsp

   0x0000555555555f88 <+50>: cmp $0x5,%eax

   0x0000555555555f8b <+53>: jle 0x555555555f92 <read_six_numbers+60>

   0x0000555555555f8d <+55>: add $0x8,%rsp

   0x0000555555555f91 <+59>: retq

   0x0000555555555f92 <+60>: callq 0x555555555f1a <explode_bomb>

End of assembler dump.

Hopefully this is more helpful

Homework Answers

Answer #1

This the part that acts as loop:

   0x000055555555577f <+43>: jmp 0x555555555791 <phase_2+61>

   0x0000555555555781 <+45>: callq 0x555555555f1a <explode_bomb>

   0x0000555555555786 <+50>: jmp 0x555555555778 <phase_2+36>

   0x0000555555555788 <+52>: add $0x4,%rbx

   0x000055555555578c <+56>: cmp %rbp,%rbx

   0x000055555555578f <+59>: je 0x5555555557a1 <phase_2+77>// for the loop to continue to next iteration this should not happen

   0x0000555555555791 <+61>: mov (%rbx),%eax

   0x0000555555555793 <+63>: add %eax,%eax

   0x0000555555555795 <+65>: cmp %eax,0x4(%rbx)

   0x0000555555555798 <+68>: je 0x555555555788 <phase_2+52>// for the loop to continue to next iteration this should happen

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT