Help! Need help with the following binary bomb phase 3 (assembly language), what
ID: 3817283 • Letter: H
Question
Help! Need help with the following binary bomb phase 3 (assembly language), what is supposed to be the input???
=> 0x0000000000400aab <+0>: sub $0x18,%rsp
0x0000000000400aaf <+4>: lea 0x8(%rsp),%rcx
0x0000000000400ab4 <+9>: lea 0xc(%rsp),%rdx
0x0000000000400ab9 <+14>: mov $0x401515,%esi
0x0000000000400abe <+19>: mov $0x0,%eax
0x0000000000400ac3 <+24>: callq 0x4007d0 <__isoc99_sscanf@plt>
0x0000000000400ac8 <+29>: cmp $0x1,%eax
0x0000000000400acb <+32>: jg 0x400ad2 <phase_3+39>
0x0000000000400acd <+34>: callq 0x400f7f <explode_bomb>
0x0000000000400ad2 <+39>: cmpl $0x7,0xc(%rsp)
0x0000000000400ad7 <+44>: ja 0x400b3f <phase_3+148>
0x0000000000400ad9 <+46>: mov 0xc(%rsp),%eax
0x0000000000400add <+50>: jmpq *0x4013b0(,%rax,8)
0x0000000000400ae4 <+57>: mov $0x0,%eax
0x0000000000400ae9 <+62>: jmp 0x400af0 <phase_3+69>
0x0000000000400aeb <+64>: mov $0x3a5,%eax
0x0000000000400af0 <+69>: sub $0xdb,%eax
0x0000000000400af5 <+74>: jmp 0x400afc <phase_3+81>
0x0000000000400af7 <+76>: mov $0x0,%eax
0x0000000000400afc <+81>: add $0x15f,%eax
0x0000000000400b01 <+86>: jmp 0x400b08 <phase_3+93>
0x0000000000400b03 <+88>: mov $0x0,%eax
---Type <return> to continue, or q <return> to quit---
0x0000000000400b08 <+93>: sub $0x19a,%eax
0x0000000000400b0d <+98>: jmp 0x400b14 <phase_3+105>
0x0000000000400b0f <+100>: mov $0x0,%eax
0x0000000000400b14 <+105>: add $0x19a,%eax
0x0000000000400b19 <+110>: jmp 0x400b20 <phase_3+117>
0x0000000000400b1b <+112>: mov $0x0,%eax
0x0000000000400b20 <+117>: sub $0x19a,%eax
0x0000000000400b25 <+122>: jmp 0x400b2c <phase_3+129>
0x0000000000400b27 <+124>: mov $0x0,%eax
0x0000000000400b2c <+129>: add $0x19a,%eax
0x0000000000400b31 <+134>: jmp 0x400b38 <phase_3+141>
0x0000000000400b33 <+136>: mov $0x0,%eax
0x0000000000400b38 <+141>: sub $0x19a,%eax
0x0000000000400b3d <+146>: jmp 0x400b49 <phase_3+158>
0x0000000000400b3f <+148>: callq 0x400f7f <explode_bomb>
0x0000000000400b44 <+153>: mov $0x0,%eax
0x0000000000400b49 <+158>: cmpl $0x5,0xc(%rsp)
0x0000000000400b4e <+163>: jg 0x400b56 <phase_3+171>
0x0000000000400b50 <+165>: cmp 0x8(%rsp),%eax
0x0000000000400b54 <+169>: je 0x400b5b <phase_3+176>
0x0000000000400b56 <+171>: callq 0x400f7f <explode_bomb>
0x0000000000400b5b <+176>: add $0x18,%rsp
0x0000000000400b5f <+180>: retq
Explanation / Answer
This line in the code reads your input
0x0000000000400ac3 <+24>: callq 0x4007d0 <__isoc99_sscanf@plt>
This line checks the format of input
0x0000000000400ac8 <+29>: cmp $0x1,%eax
So basically, the program is taking up text file say, arg.txt file
if your executable file name is bomb.out then
progrma runs by following command.
./bomb arg.txt
In bomb phase program , it usaully takes a STRING from the user.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.