From a binary bomb. WHAT ARE THE 6 DIGITS I NEED TO INPUT? ALSO PUT COMMENTS NEX
ID: 3602018 • 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_3: 0x08048cd1 <phase_3+0>: push %ebp 0x08048cd2 <phase_3+1>: mov %esp,%ebp 0x08048cd4 <phase_3+3>: sub $0x28,%esp 0x08048cd7 <phase_3+6>: lea -0x8(%ebp),%eax 0x08048cda <phase_3+9>: mov %eax,0xc(%esp) 0x08048cde <phase_3+13>: lea -0x4(%ebp),%eax 0x08048ce1 <phase_3+16>: mov %eax,0x8(%esp) 0x08048ce5 <phase_3+20>: movl $0x80497bb,0x4(%esp) 0x08048ced <phase_3+28>: mov 0x8(%ebp),%eax 0x08048cf0 <phase_3+31>: mov %eax,(%esp) 0x08048cf3 <phase_3+34>: call 0x8048828 <sscanf@plt> 0x08048cf8 <phase_3+39>: cmp $0x1,%eax 0x08048cfb <phase_3+42>: jg 0x8048d02 <phase_3+49> 0x08048cfd <phase_3+44>: call 0x8048f2c <explode_bomb> 0x08048d02 <phase_3+49>: cmpl $0x7,-0x4(%ebp) 0x08048d06 <phase_3+53>: ja 0x8048d73 <phase_3+162> 0x08048d08 <phase_3+55>: mov -0x4(%ebp),%eax 0x08048d0b <phase_3+58>: jmp *0x804974c(,%eax,4) 0x08048d12 <phase_3+65>: mov $0x0,%eax 0x08048d17 <phase_3+70>: jmp 0x8048d6c <phase_3+155> 0x08048d19 <phase_3+72>: mov $0x0,%eax 0x08048d1e <phase_3+77>: xchg %ax,%ax 0x08048d20 <phase_3+79>: jmp 0x8048d67 <phase_3+150> 0x08048d22 <phase_3+81>: mov $0x0,%eax 0x08048d27 <phase_3+86>: jmp 0x8048d62 <phase_3+145> 0x08048d29 <phase_3+88>: mov $0x0,%eax 0x08048d2e <phase_3+93>: xchg %ax,%ax 0x08048d30 <phase_3+95>: jmp 0x8048d5d <phase_3+140> 0x08048d32 <phase_3+97>: mov $0x0,%eax 0x08048d37 <phase_3+102>: jmp 0x8048d58 <phase_3+135> 0x08048d39 <phase_3+104>: mov $0x0,%eax 0x08048d3e <phase_3+109>: xchg %ax,%ax 0x08048d40 <phase_3+111>: jmp 0x8048d53 <phase_3+130> 0x08048d42 <phase_3+113>: mov $0x6a,%eax 0x08048d47 <phase_3+118>: jmp 0x8048d4e <phase_3+125> 0x08048d49 <phase_3+120>: mov $0x0,%eax 0x08048d4e <phase_3+125>: sub $0x363,%eax 0x08048d53 <phase_3+130>: add $0x396,%eax 0x08048d58 <phase_3+135>: sub $0x39d,%eax 0x08048d5d <phase_3+140>: add $0x1d2,%eax 0x08048d62 <phase_3+145>: sub $0x2ed,%eax 0x08048d67 <phase_3+150>: add $0x2ed,%eax 0x08048d6c <phase_3+155>: sub $0x331,%eax 0x08048d71 <phase_3+160>: jmp 0x8048d7d <phase_3+172> 0x08048d73 <phase_3+162>: call 0x8048f2c <explode_bomb> ---Type <return> to continue, or q <return> to quit--- 0x08048d78 <phase_3+167>: mov $0x0,%eax 0x08048d7d <phase_3+172>: cmpl $0x5,-0x4(%ebp) 0x08048d81 <phase_3+176>: jg 0x8048d88 <phase_3+183> 0x08048d83 <phase_3+178>: cmp -0x8(%ebp),%eax 0x08048d86 <phase_3+181>: je 0x8048d8d <phase_3+188> 0x08048d88 <phase_3+183>: call 0x8048f2c <explode_bomb> 0x08048d8d <phase_3+188>: leave 0x08048d8e <phase_3+189>: xchg %ax,%ax 0x08048d90 <phase_3+191>: ret End of assembler dump
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.