From a binary bomb. WHAT ARE THE 6 DIGITS I NEED TO INPUT? ALSO PUT COMMENTS NEX
ID: 3601970 • Letter: F
Question
From a binary bomb. WHAT ARE THE 6 DIGITS I NEED TO INPUT? ALSO PUT COMMENTS NEXT TO STATEMENTS.
Dump of assembler code for function phase_6:
0x00000000004010a7 <+0>: push %r13
0x00000000004010a9 <+2>: push %r12
0x00000000004010ab <+4>: push %rbp
0x00000000004010ac <+5>: push %rbx
0x00000000004010ad <+6>: sub $0x58,%rsp
0x00000000004010b1 <+10>: lea 0x30(%rsp),%rsi
0x00000000004010b6 <+15>: callq 0x401555 <read_six_numbers>
0x00000000004010bb <+20>: lea 0x30(%rsp),%r12
0x00000000004010c0 <+25>: mov $0x0,%r13d
0x00000000004010c6 <+31>: jmp 0x4010ed <phase_6+70>
0x00000000004010c8 <+33>: add $0x1,%r13d
0x00000000004010cc <+37>: cmp $0x6,%r13d
0x00000000004010d0 <+41>: je 0x40110a <phase_6+99>
0x00000000004010d2 <+43>: mov %r13d,%ebx
0x00000000004010d5 <+46>: movslq %ebx,%rax
0x00000000004010d8 <+49>: mov 0x30(%rsp,%rax,4),%eax
0x00000000004010dc <+53>: cmp %eax,0x0(%rbp)
0x00000000004010df <+56>: je 0x401103 <phase_6+92>
0x00000000004010e1 <+58>: add $0x1,%ebx
0x00000000004010e4 <+61>: cmp $0x5,%ebx
0x00000000004010e7 <+64>: jle 0x4010d5 <phase_6+46>
0x00000000004010e9 <+66>: add $0x4,%r12
0x00000000004010ed <+70>: mov %r12,%rbp
0x00000000004010f0 <+73>: mov (%r12),%eax
0x00000000004010f4 <+77>: sub $0x1,%eax
0x00000000004010f7 <+80>: cmp $0x5,%eax
0x00000000004010fa <+83>: jbe 0x4010c8 <phase_6+33>
0x00000000004010fc <+85>: callq 0x40151f <explode_bomb>
0x0000000000401101 <+90>: jmp 0x4010c8 <phase_6+33>
0x0000000000401103 <+92>: callq 0x40151f <explode_bomb>
0x0000000000401108 <+97>: jmp 0x4010e1 <phase_6+58>
0x000000000040110a <+99>: mov $0x0,%esi
0x000000000040110f <+104>: mov 0x30(%rsp,%rsi,1),%ecx
0x0000000000401113 <+108>: mov $0x6042f0,%edx
0x0000000000401118 <+113>: cmp $0x1,%ecx
0x000000000040111b <+116>: jle 0x401132 <phase_6+139>
0x000000000040111d <+118>: mov $0x1,%eax
0x0000000000401122 <+123>: mov $0x6042f0,%edx
0x0000000000401127 <+128>: mov 0x8(%rdx),%rdx
0x000000000040112b <+132>: add $0x1,%eax
0x000000000040112e <+135>: cmp %ecx,%eax
0x0000000000401130 <+137>: jne 0x401127 <phase_6+128>
0x0000000000401132 <+139>: mov %rdx,(%rsp,%rsi,2)
0x0000000000401136 <+143>: add $0x4,%rsi
0x000000000040113a <+147>: cmp $0x18,%rsi
0x000000000040113e <+151>: jne 0x40110f <phase_6+104>
0x0000000000401140 <+153>: mov (%rsp),%rbx
0x0000000000401144 <+157>: mov %rsp,%rax
0x0000000000401147 <+160>: lea 0x28(%rsp),%rsi
0x000000000040114c <+165>: mov %rbx,%rcx
0x000000000040114f <+168>: mov 0x8(%rax),%rdx
0x0000000000401153 <+172>: mov %rdx,0x8(%rcx)
0x0000000000401157 <+176>: add $0x8,%rax
0x000000000040115b <+180>: mov %rdx,%rcx
0x000000000040115e <+183>: cmp %rax,%rsi
0x0000000000401161 <+186>: jne 0x40114f <phase_6+168>
0x0000000000401163 <+188>: movq $0x0,0x8(%rdx)
0x000000000040116b <+196>: mov $0x5,%ebp
0x0000000000401170 <+201>: jmp 0x40117b <phase_6+212>
0x0000000000401172 <+203>: mov 0x8(%rbx),%rbx
0x0000000000401176 <+207>: sub $0x1,%ebp
0x0000000000401179 <+210>: je 0x40118c <phase_6+229>
0x000000000040117b <+212>: mov 0x8(%rbx),%rax
0x000000000040117f <+216>: mov (%rax),%eax
0x0000000000401181 <+218>: cmp %eax,(%rbx)
0x0000000000401183 <+220>: jge 0x401172 <phase_6+203>
0x0000000000401185 <+222>: callq 0x40151f <explode_bomb>
0x000000000040118a <+227>: jmp 0x401172 <phase_6+203>
0x000000000040118c <+229>: add $0x58,%rsp
0x0000000000401190 <+233>: pop %rbx
0x0000000000401191 <+234>: pop %rbp
0x0000000000401192 <+235>: pop %r12
0x0000000000401194 <+237>: pop %r13
0x0000000000401196 <+239>: retq
End of assembler dump.
(gdb) si
0x0000000000401555 in read_six_numbers ()
(gdb) disas
Dump of assembler code for function read_six_numbers:
0x0000000000401555 <+0>: sub $0x8,%rsp
0x0000000000401559 <+4>: mov %rsi,%rdx
0x000000000040155c <+7>: lea 0x4(%rsi),%rcx
0x0000000000401560 <+11>: lea 0x14(%rsi),%rax
0x0000000000401564 <+15>: push %rax
0x0000000000401565 <+16>: lea 0x10(%rsi),%rax
0x0000000000401569 <+20>: push %rax
0x000000000040156a <+21>: lea 0xc(%rsi),%r9
0x000000000040156e <+25>: lea 0x8(%rsi),%r8
0x0000000000401572 <+29>: mov $0x4027c1,%esi
0x0000000000401577 <+34>: mov $0x0,%eax
0x000000000040157c <+39>: callq 0x400b90 <__isoc99_sscanf@plt>
0x0000000000401581 <+44>: add $0x10,%rsp
0x0000000000401585 <+48>: cmp $0x5,%eax
0x0000000000401588 <+51>: jle 0x40158f <read_six_numbers+58>
0x000000000040158a <+53>: add $0x8,%rsp
0x000000000040158e <+57>: retq
0x000000000040158f <+58>: callq 0x40151f <explode_bomb>
End of assembler dump.
(gdb)
Explanation / Answer
Dump of assembler code for function phase_6:
0x00000000004010a7 <+0>: push %r13
0x00000000004010a9 <+2>: push %r12
0x00000000004010ab <+4>: push %rbp
0x00000000004010ac <+5>: push %rbx
0x00000000004010ad <+6>: sub $0x58,%rsp
0x00000000004010b1 <+10>: lea 0x30(%rsp),%rsi
0x00000000004010b6 <+15>: callq 0x401555 <read_six_numbers>
0x00000000004010bb <+20>: lea 0x30(%rsp),%r12
0x00000000004010c0 <+25>: mov $0x0,%r13d
0x00000000004010c6 <+31>: jmp 0x4010ed <phase_6+70>
0x00000000004010c8 <+33>: add $0x1,%r13d
0x00000000004010cc <+37>: cmp $0x6,%r13d
0x00000000004010d0 <+41>: je 0x40110a <phase_6+99>
0x00000000004010d2 <+43>: mov %r13d,%ebx
0x00000000004010d5 <+46>: movslq %ebx,%rax
0x00000000004010d8 <+49>: mov 0x30(%rsp,%rax,4),%eax
0x00000000004010dc <+53>: cmp %eax,0x0(%rbp)
0x00000000004010df <+56>: je 0x401103 <phase_6+92>
0x00000000004010e1 <+58>: add $0x1,%ebx
0x00000000004010e4 <+61>: cmp $0x5,%ebx
0x00000000004010e7 <+64>: jle 0x4010d5 <phase_6+46>
0x00000000004010e9 <+66>: add $0x4,%r12
0x00000000004010ed <+70>: mov %r12,%rbp
0x00000000004010f0 <+73>: mov (%r12),%eax
0x00000000004010f4 <+77>: sub $0x1,%eax
0x00000000004010f7 <+80>: cmp $0x5,%eax
0x00000000004010fa <+83>: jbe 0x4010c8 <phase_6+33>
0x00000000004010fc <+85>: callq 0x40151f <explode_bomb>
0x0000000000401101 <+90>: jmp 0x4010c8 <phase_6+33>
0x0000000000401103 <+92>: callq 0x40151f <explode_bomb>
0x0000000000401108 <+97>: jmp 0x4010e1 <phase_6+58>
0x000000000040110a <+99>: mov $0x0,%esi
0x000000000040110f <+104>: mov 0x30(%rsp,%rsi,1),%ecx
0x0000000000401113 <+108>: mov $0x6042f0,%edx
0x0000000000401118 <+113>: cmp $0x1,%ecx
0x000000000040111b <+116>: jle 0x401132 <phase_6+139>
0x000000000040111d <+118>: mov $0x1,%eax
0x0000000000401122 <+123>: mov $0x6042f0,%edx
0x0000000000401127 <+128>: mov 0x8(%rdx),%rdx
0x000000000040112b <+132>: add $0x1,%eax
0x000000000040112e <+135>: cmp %ecx,%eax
0x0000000000401130 <+137>: jne 0x401127 <phase_6+128>
0x0000000000401132 <+139>: mov %rdx,(%rsp,%rsi,2)
0x0000000000401136 <+143>: add $0x4,%rsi
0x000000000040113a <+147>: cmp $0x18,%rsi
0x000000000040113e <+151>: jne 0x40110f <phase_6+104>
0x0000000000401140 <+153>: mov (%rsp),%rbx
0x0000000000401144 <+157>: mov %rsp,%rax
0x0000000000401147 <+160>: lea 0x28(%rsp),%rsi
0x000000000040114c <+165>: mov %rbx,%rcx
0x000000000040114f <+168>: mov 0x8(%rax),%rdx
0x0000000000401153 <+172>: mov %rdx,0x8(%rcx)
0x0000000000401157 <+176>: add $0x8,%rax
0x000000000040115b <+180>: mov %rdx,%rcx
0x000000000040115e <+183>: cmp %rax,%rsi
0x0000000000401161 <+186>: jne 0x40114f <phase_6+168>
0x0000000000401163 <+188>: movq $0x0,0x8(%rdx)
0x000000000040116b <+196>: mov $0x5,%ebp
0x0000000000401170 <+201>: jmp 0x40117b <phase_6+212>
0x0000000000401172 <+203>: mov 0x8(%rbx),%rbx
0x0000000000401176 <+207>: sub $0x1,%ebp
0x0000000000401179 <+210>: je 0x40118c <phase_6+229>
0x000000000040117b <+212>: mov 0x8(%rbx),%rax
0x000000000040117f <+216>: mov (%rax),%eax
0x0000000000401181 <+218>: cmp %eax,(%rbx)
0x0000000000401183 <+220>: jge 0x401172 <phase_6+203>
0x0000000000401185 <+222>: callq 0x40151f <explode_bomb>
0x000000000040118a <+227>: jmp 0x401172 <phase_6+203>
0x000000000040118c <+229>: add $0x58,%rsp
0x0000000000401190 <+233>: pop %rbx
0x0000000000401191 <+234>: pop %rbp
0x0000000000401192 <+235>: pop %r12
0x0000000000401194 <+237>: pop %r13
0x0000000000401196 <+239>: retq
End of assembler dump.
(gdb) si
0x0000000000401555 in read_six_numbers ()
(gdb) disas
Dump of assembler code for function read_six_numbers:
0x0000000000401555 <+0>: sub $0x8,%rsp
0x0000000000401559 <+4>: mov %rsi,%rdx
0x000000000040155c <+7>: lea 0x4(%rsi),%rcx
0x0000000000401560 <+11>: lea 0x14(%rsi),%rax
0x0000000000401564 <+15>: push %rax
0x0000000000401565 <+16>: lea 0x10(%rsi),%rax
0x0000000000401569 <+20>: push %rax
0x000000000040156a <+21>: lea 0xc(%rsi),%r9
0x000000000040156e <+25>: lea 0x8(%rsi),%r8
0x0000000000401572 <+29>: mov $0x4027c1,%esi
0x0000000000401577 <+34>: mov $0x0,%eax
0x000000000040157c <+39>: callq 0x400b90 <__isoc99_sscanf@plt>
0x0000000000401581 <+44>: add $0x10,%rsp
0x0000000000401585 <+48>: cmp $0x5,%eax
0x0000000000401588 <+51>: jle 0x40158f <read_six_numbers+58>
0x000000000040158a <+53>: add $0x8,%rsp
0x000000000040158e <+57>: retq
0x000000000040158f <+58>: callq 0x40151f <explode_bomb>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.