My home / My units / COMP2100_SHFYR_2021_ALL_U / Programming Task Support Notes / FAQ for Assignment 2 Binary Bomb Lab COMP2100 Systems Programming FAQ for Assignment 2 Binary Bomb Lab When are the...

1 answer below »
I need phase 1, phase 2, phase 3 and phase 4 of the binary bomb lab completed by the 08/10/2021. All the information about this assignment is in the PDF provided. The assignment must be done in putty and you will need my username and password to access the bomb file. I have already attempted phase 1 but I have lost 0.1 of a mark due to the bomb exploding.


My home / My units / COMP2100_SHFYR_2021_ALL_U / Programming Task Support Notes / FAQ for Assignment 2 Binary Bomb Lab COMP2100 Systems Programming FAQ for Assignment 2 Binary Bomb Lab When are the phases due for progress marks?  When does the assignment close? $ lab -d Where is the bomb for phase 2? All six bomb phases are in the bomb you fetch with the command $ lab -g 2.1 How do I prevent the bomb from exploding? Basically, only run the bomb in gdb, set breakpoints and be careful. There are helpful hints in: The assignment specification (read it) The bomblab videos (on echo360) The support note "Bomb defusing with gdb" Practice using gdb with the isyes demo.  It is similar to phase 1 of the bomb, but does not cost marks (nor does it earn marks). I've exploded my bomb.  How can I recover my lost marks? You only lose 0.1 marks for each explosion, and the first explosion is free.  So exploding the bomb is not a big deal.  You can gain more marks through solving the phases and getting your progress marks, than you lost. But I still want to recover the marks I lost from explosions? The will be a second bomb available at some point.  The command to fetch it is $ lab -g 2.2. If you defuse the second bomb without any explosions, you can achieve full marks. How easy is it to solve the second bomb? The puzzles are similar but different.  You will find that the skills you developed in solving the first bomb make it a lot easier to solve the second bomb.  The further you have got with the first bomb, the easier you will find it to solve the second bomb. What if I run out of time to solve the second bomb? Your final mark will be the maximum of the total score for the first bomb with its explosions, vs the total score for the second bomb with its explosions.  If you have done everything that you can with the first bomb, then you won't lose marks by starting the second bomb, but you might achieve a better final score. I have free extension days left.  Can I use them? You can use free extension days whenever you wish.  A smart strategy may be to use them to extend the closing date of the assignment, unless you need the time to study for examinations. Another strategy would be to use your free extension days when you are "so close" to solving a bomb phase.  However, you need to claim the free extension before you solve the phase in order for the solution to count for the progress mark that you want it to count for. Last modified: Friday, 9 October 2020, 5:18 PM General iLearn or IT question? help.mq iLearn info Library Handbook Unit Guides Learning and Teaching Policies Security Confidentiality & Privacy Statement https://ilearn.mq.edu.au/my/ https://ilearn.mq.edu.au/course/view.php?id=56902 https://ilearn.mq.edu.au/mod/page/view.php?id=6620705 http://help.mq.edu.au/ http://help.ilearn.mq.edu.au/ http://www.mq.edu.au/on_campus/library/ https://coursehandbook.mq.edu.au/ http://unitguides.mq.edu.au/ https://staff.mq.edu.au/work/strategy-planning-and-governance/university-policies-and-procedures/policy-central http://www.mq.edu.au/security https://ishare.mq.edu.au/prod/file/dbc1a9c8-7bcd-4a60-a4a1-f46ab50af7b2/1/iLearn%20Confidentiality%20and%20Privacy%20Collection%20Statement.pdf © Copyright Macquarie University | Confidentiality & Privacy Statement You are logged in as Ava Gardiner (Log out) Students iLearn Quick Guides for students General question? ask.mq IT Information (printing, iLab, technologies) Student life - help and advice Email eStudent Student Policy Gateway Accessibility Service Portal Staff iLearn Quick Guides for staff L&T Workshops and services iTeach (iLearn & unit guides setup) Echo360 Lecture Recordings Info TEDS (evaluation surveys) https://ishare.mq.edu.au/prod/file/dbc1a9c8-7bcd-4a60-a4a1-f46ab50af7b2/1/iLearn%20Confidentiality%20and%20Privacy%20Collection%20Statement.pdf https://ilearn.mq.edu.au/user/profile.php?id=296339 https://ilearn.mq.edu.au/login/logout.php?sesskey=IGe7CbMW2k https://students.mq.edu.au/support/study/tools-and-resources/ilearn/ilearn-quick-guides-for-students http://ask.mq.edu.au/ http://students.mq.edu.au/it_services/ http://students.mq.edu.au/support/ https://mail.google.com/ https://student1.mq.edu.au/ https://students.mq.edu.au/support/study/student-policy-gateway https://mq-access.symplicity.com/students/index.php?s=note_taker&mode=list https://staff.mq.edu.au/teach/learning-technologies-and-spaces/teaching-technologies-and-tools/ilearn/ilearn-quick-guides-for-staff https://staff.mq.edu.au/teach/learning-technologies-and-spaces/teaching-technologies-and-tools/ilearn/ilearn-training-and-workshops https://iteach.mq.edu.au/ https://staff.mq.edu.au/teach/learning-technologies-and-spaces/teaching-technologies-and-tools/ilearn/lecture-recordings https://staff.mq.edu.au/teach/design-for-learning/teaching-evaluation Bomb Defusing with Gdb COMP2100 Revised 25 September 2020 Introduction The Binary Bomb Lab is designed to help you understand machine code and how the machine executes your programs. In order to solve this lab, you will need to become familiar with the debugger gdb. You will disassemble code and step through your program one instruction at a time. You cannot get much closer to the machine than by watching it execute each instruction and seeing what happens! The Binary Bomb Lab (also known as Bomb Lab) involves finding the input strings that a program requires in order to not call a procedure that “explodes” the bomb. The bomb is divided into six phases, and each phase processes a single text line. Some phases convert the text to numbers while other phases process the text as a string. This document contains an outline of how to go about defusing the bomb, followed by techniques and tips for successfully using gdb to defuse the bomb. gdb is the GNU debugger, a program that allows you to control the execution of another program (in this case, your bomb), and to examine and even modify the contents of memory and registers as you step through the program one instruction at a time. You can perform every task required for Bomb Lab inside gdb, provided that you know how to use it properly. Before going into details about gdb, however, we will outline the processes that you might find helpful to defuse your bomb, one phase at a time. Debugging Key Concepts This section briefly describes some key ideas that are found in most debuggers, including gdb. Breakpoint. A marker is attached to an instruction so that, when the code attempts to execute the instruction, execution is paused and the debugger takes control. You can then examine the contents of registers and memory, and decide to continue execution or not. Disassemble. Converting machine code into assembly representation so that the user can see what instructions are in the program. You can disassemble the current instruction, the current function, a named function or any range of memory addresses. Stepping. Execution can be stepped, taking one instruction at a time. When a procedure call is involved, there are three important variations of stepping. 1. You can step into a procedure, executing the call instruction and then pausing immediately. This is useful if you want to debug the called procedure. The gdb command to step into a procedure is stepi. 2. You can step over a procedure, executing the procedure call and waiting for the procedure to return before pausing execution. This is useful if you don’t want to bother with the details of the called procedure. The gdb command to step over a procedure is nexti. 3. You can step out of the current procedure, pausing execution when it returns to the caller. The gdb command to step out of a procedure is finish. Use this command if you have stepped into a procedure but you want to avoid stepping through the instructions inside the procedure. Examining registers and memory. Contents of registers and memory can be displayed in various ways. Modifying registers or memory. Values can be stored into registers or memory of the running program. Watchpoint. The contents of a memory location or register is monitored by the debugger. Execution is paused whenever the contents changes. Stack trace/backtrace. The procedure call stack is dumped, showing the names (and if possible the parameters) of each procedure call leading to the current instruction. Typically, you can choose to debug the contents of variables in any of the active procedures. Function call. You can call any function within your running program at any point. Overview of the Bomb Main Program The bomb is divided into phases. For each phase, the bomb main program executes the following steps, as you can see by examining bomb.c, the source code file that is provided to you. 1. A line of text is read from the named input file or from stdin (see the lab specification). 2. For some phases, the line of text is parsed into numbers using sscanf. 3. The line of text or the parsed numbers are passed to the bomb phase function. If the phase is not satisfied with the input it will call a function to explode the bomb. 4. The return status of the bomb phase function is reported for marking by calling a procedure and a congratulatory message is printed on the screen. You should read the source code file bomb.c and refer to it from time to time because it contains helpful information, both in the source code and in the comments. Methods for Defusing a Bomb Phase This section describe several useful methods: 1. Prevent the bomb from exploding 2. Examine the main program for the phase you are working on 3. Disassemble the phase you are working on 4. Step through execution of the phase 5. Reverse engineer the phase 6. Earn marks for your phase solution 1. Prevent the bomb from exploding The bomb will “explode” whenever a phase detects unsatisfactory input. This is most likely to happen when you don’t know how to defuse the phase, but it can also happen if you accidentally mistype the input to a phase that you have solved, or if you ask the bomb to read the wrong input file. You should guard against such mistakes. One of the best ways to protect yourself is to only run the bomb inside gdb, and to always set breakpoints so that the bomb cannot explode unexpectedly. The section “Breakpoint” in “Gdb Features” (below) describes how to work with breakpoints, and the section “Executing a gdb command automatically” is an advanced section that describes how you can initialise gdb so that one or more breakpoints or other commands will be executed every time you start gdb.  In order to effectively protect yourself, you really want to stop the bomb from exploding. You can set a breakpoint at any function in the program. A logical place to set the breakpoint is the function that the bomb calls to explode itself. You can find out what that function is by disassembling the bomb phase functions. Each bomb is different
Answered 6 days AfterOct 02, 2021Macquaire University

Answer To: My home / My units / COMP2100_SHFYR_2021_ALL_U / Programming Task Support Notes / FAQ for Assignment...

Swapnil answered on Oct 07 2021
136 Votes
92596/1.txt
bomb: file format elf64-x86-64
Disassembly of section .init:
0000000000400a80 <_init>:
400a80:    48 83 ec 08     sub $0x8,%rsp
400a84:    48 8b 05 6d 35 20 00     mov 0x20356d(%rip),%rax # 603ff8 <__gmon_start__>
400a8b:    48 85 c0     test %rax,%rax
400a8e:    74 05     je 400a95 <_init+0x15>
400a90:    e8 bb 01 00 00     callq 400c50 <.plt.got>
400a95:    48 83 c4 08     add $0x8,%rsp
400a99:    c3     retq
Disassembly of section .plt:
0000000000400aa0 <.plt>:
400aa0:    ff 35 62 35 20 00     pushq 0x203562(%rip) # 604008 <_GLOBAL_OFFSET_TABLE_+0x8>
400aa6:    ff 25 64 35 20 00     jmpq *0x203564(%rip) # 604010 <_GLOBAL_OFFSET_TABLE_+0x10>
400aac:    0f 1f 40 00     nopl 0x0(%rax)
0000000000400ab0 :
400ab0:    ff 25 62 35 20 00     jmpq *0x203562(%rip) # 604018
400ab6:    68 00 00 00 00     pushq $0x0
400abb:    e9 e0 ff ff ff     jmpq 400aa0 <.plt>
0000000000400ac0 <__errno_location@plt>:
400ac0:    ff 25 5a 35 20 00     jmpq *0x20355a(%rip) # 604020 <__errno_location@GLIBC_2.2.5>
400ac6:    68 01 00 00 00     pushq $0x1
400acb:    e9 d0 ff ff ff     jmpq 400aa0 <.plt>
0000000000400ad0 :
400ad0:    ff 25 52 35 20 00     jmpq *0x203552(%rip) # 604028
400ad6:    68 02 00 00 00     pushq $0x2
400adb:    e9 c0 ff ff ff     jmpq 400aa0 <.plt>
0000000000400ae0 :
400ae0:    ff 25 4a 35 20 00     jmpq *0x20354a(%rip) # 604030
400ae6:    68 03 00 00 00     pushq $0x3
400aeb:    e9 b0 ff ff ff     jmpq 400aa0 <.plt>
0000000000400af0 :
400af0:    ff 25 42 35 20 00     jmpq *0x203542(%rip) # 604038
400af6:    68 04 00 00 00     pushq $0x4
400afb:    e9 a0 ff ff ff     jmpq 400aa0 <.plt>
0000000000400b00 <__stack_chk_fail@plt>:
400b00:    ff 25 3a 35 20 00     jmpq *0x20353a(%rip) # 604040 <__stack_chk_fail@GLIBC_2.4>
400b06:    68 05 00 00 00     pushq $0x5
400b0b:    e9 90 ff ff ff     jmpq 400aa0 <.plt>
0000000000400b10 :
400b10:    ff 25 32 35 20 00     jmpq *0x203532(%rip) # 604048
400b16:    68 06 00 00 00     pushq $0x6
400b1b:    e9 80 ff ff ff     jmpq 400aa0 <.plt>
0000000000400b20 :
400b20:    ff 25 2a 35 20 00     jmpq *0x20352a(%rip) # 604050
400b26:    68 07 00 00 00     pushq $0x7
400b2b:    e9 70 ff ff ff     jmpq 400aa0 <.plt>
0000000000400b30 :
400b30:    ff 25 22 35 20 00     jmpq *0x203522(%rip) # 604058
400b36:    68 08 00 00 00     pushq $0x8
400b3b:    e9 60 ff ff ff     jmpq 400aa0 <
.plt>
0000000000400b40 <__libc_start_main@plt>:
400b40:    ff 25 1a 35 20 00     jmpq *0x20351a(%rip) # 604060 <__libc_start_main@GLIBC_2.2.5>
400b46:    68 09 00 00 00     pushq $0x9
400b4b:    e9 50 ff ff ff     jmpq 400aa0 <.plt>
0000000000400b50 :
400b50:    ff 25 12 35 20 00     jmpq *0x203512(%rip) # 604068
400b56:    68 0a 00 00 00     pushq $0xa
400b5b:    e9 40 ff ff ff     jmpq 400aa0 <.plt>
0000000000400b60 :
400b60:    ff 25 0a 35 20 00     jmpq *0x20350a(%rip) # 604070
400b66:    68 0b 00 00 00     pushq $0xb
400b6b:    e9 30 ff ff ff     jmpq 400aa0 <.plt>
0000000000400b70 :
400b70:    ff 25 02 35 20 00     jmpq *0x203502(%rip) # 604078
400b76:    68 0c 00 00 00     pushq $0xc
400b7b:    e9 20 ff ff ff     jmpq 400aa0 <.plt>
0000000000400b80 <__memmove_chk@plt>:
400b80:    ff 25 fa 34 20 00     jmpq *0x2034fa(%rip) # 604080 <__memmove_chk@GLIBC_2.3.4>
400b86:    68 0d 00 00 00     pushq $0xd
400b8b:    e9 10 ff ff ff     jmpq 400aa0 <.plt>
0000000000400b90 :
400b90:    ff 25 f2 34 20 00     jmpq *0x2034f2(%rip) # 604088
400b96:    68 0e 00 00 00     pushq $0xe
400b9b:    e9 00 ff ff ff     jmpq 400aa0 <.plt>
0000000000400ba0 :
400ba0:    ff 25 ea 34 20 00     jmpq *0x2034ea(%rip) # 604090
400ba6:    68 0f 00 00 00     pushq $0xf
400bab:    e9 f0 fe ff ff     jmpq 400aa0 <.plt>
0000000000400bb0 <__isoc99_sscanf@plt>:
400bb0:    ff 25 e2 34 20 00     jmpq *0x2034e2(%rip) # 604098 <__isoc99_sscanf@GLIBC_2.7>
400bb6:    68 10 00 00 00     pushq $0x10
400bbb:    e9 e0 fe ff ff     jmpq 400aa0 <.plt>
0000000000400bc0 <__printf_chk@plt>:
400bc0:    ff 25 da 34 20 00     jmpq *0x2034da(%rip) # 6040a0 <__printf_chk@GLIBC_2.3.4>
400bc6:    68 11 00 00 00     pushq $0x11
400bcb:    e9 d0 fe ff ff     jmpq 400aa0 <.plt>
0000000000400bd0 :
400bd0:    ff 25 d2 34 20 00     jmpq *0x2034d2(%rip) # 6040a8
400bd6:    68 12 00 00 00     pushq $0x12
400bdb:    e9 c0 fe ff ff     jmpq 400aa0 <.plt>
0000000000400be0 :
400be0:    ff 25 ca 34 20 00     jmpq *0x2034ca(%rip) # 6040b0
400be6:    68 13 00 00 00     pushq $0x13
400beb:    e9 b0 fe ff ff     jmpq 400aa0 <.plt>
0000000000400bf0 :
400bf0:    ff 25 c2 34 20 00     jmpq *0x2034c2(%rip) # 6040b8
400bf6:    68 14 00 00 00     pushq $0x14
400bfb:    e9 a0 fe ff ff     jmpq 400aa0 <.plt>
0000000000400c00 <__fprintf_chk@plt>:
400c00:    ff 25 ba 34 20 00     jmpq *0x2034ba(%rip) # 6040c0 <__fprintf_chk@GLIBC_2.3.4>
400c06:    68 15 00 00 00     pushq $0x15
400c0b:    e9 90 fe ff ff     jmpq 400aa0 <.plt>
0000000000400c10 :
400c10:    ff 25 b2 34 20 00     jmpq *0x2034b2(%rip) # 6040c8
400c16:    68 16 00 00 00     pushq $0x16
400c1b:    e9 80 fe ff ff     jmpq 400aa0 <.plt>
0000000000400c20 <__ctype_b_loc@plt>:
400c20:    ff 25 aa 34 20 00     jmpq *0x2034aa(%rip) # 6040d0 <__ctype_b_loc@GLIBC_2.3>
400c26:    68 17 00 00 00     pushq $0x17
400c2b:    e9 70 fe ff ff     jmpq 400aa0 <.plt>
0000000000400c30 <__sprintf_chk@plt>:
400c30:    ff 25 a2 34 20 00     jmpq *0x2034a2(%rip) # 6040d8 <__sprintf_chk@GLIBC_2.3.4>
400c36:    68 18 00 00 00     pushq $0x18
400c3b:    e9 60 fe ff ff     jmpq 400aa0 <.plt>
0000000000400c40 :
400c40:    ff 25 9a 34 20 00     jmpq *0x20349a(%rip) # 6040e0
400c46:    68 19 00 00 00     pushq $0x19
400c4b:    e9 50 fe ff ff     jmpq 400aa0 <.plt>
Disassembly of section .plt.got:
0000000000400c50 <.plt.got>:
400c50:    ff 25 a2 33 20 00     jmpq *0x2033a2(%rip) # 603ff8 <__gmon_start__>
400c56:    66 90     xchg %ax,%ax
Disassembly of section .text:
0000000000400c60 <_start>:
400c60:    31 ed     xor %ebp,%ebp
400c62:    49 89 d1     mov %rdx,%r9
400c65:    5e     pop %rsi
400c66:    48 89 e2     mov %rsp,%rdx
400c69:    48 83 e4 f0     and $0xfffffffffffffff0,%rsp
400c6d:    50     push %rax
400c6e:    54     push %rsp
400c6f:    49 c7 c0 30 24 40 00     mov $0x402430,%r8
400c76:    48 c7 c1 c0 23 40 00     mov $0x4023c0,%rcx
400c7d:    48 c7 c7 56 0d 40 00     mov $0x400d56,%rdi
400c84:    e8 b7 fe ff ff     callq 400b40 <__libc_start_main@plt>
400c89:    f4     hlt
400c8a:    66 0f 1f 44 00 00     nopw 0x0(%rax,%rax,1)
0000000000400c90 :
400c90:    b8 af 43 60 00     mov $0x6043af,%eax
400c95:    55     push %rbp
400c96:    48 2d a8 43 60 00     sub $0x6043a8,%rax
400c9c:    48 83 f8 0e     cmp $0xe,%rax
400ca0:    48 89 e5     mov %rsp,%rbp
400ca3:    76 1b     jbe 400cc0
400ca5:    b8 00 00 00 00     mov $0x0,%eax
400caa:    48 85 c0     test %rax,%rax
400cad:    74 11     je 400cc0
400caf:    5d     pop %rbp
400cb0:    bf a8 43 60 00     mov $0x6043a8,%edi
400cb5:    ff e0     jmpq *%rax
400cb7:    66 0f 1f 84 00 00 00     nopw 0x0(%rax,%rax,1)
400cbe:    00 00
400cc0:    5d     pop %rbp
400cc1:    c3     retq
400cc2:    0f 1f 40 00     nopl 0x0(%rax)
400cc6:    66 2e 0f 1f 84 00 00     nopw %cs:0x0(%rax,%rax,1)
400ccd:    00 00 00
0000000000400cd0 :
400cd0:    be a8 43 60 00     mov $0x6043a8,%esi
400cd5:    55     push %rbp
400cd6:    48 81 ee a8 43 60 00     sub $0x6043a8,%rsi
400cdd:    48 c1 fe 03     sar $0x3,%rsi
400ce1:    48 89 e5     mov %rsp,%rbp
400ce4:    48 89 f0     mov %rsi,%rax
400ce7:    48 c1 e8 3f     shr $0x3f,%rax
400ceb:    48 01 c6     add %rax,%rsi
400cee:    48 d1 fe     sar %rsi
400cf1:    74 15     je 400d08
400cf3:    b8 00 00 00 00     mov $0x0,%eax
400cf8:    48 85 c0     test %rax,%rax
400cfb:    74 0b     je 400d08
400cfd:    5d     pop %rbp
400cfe:    bf a8 43 60 00     mov $0x6043a8,%edi
400d03:    ff e0     jmpq *%rax
400d05:    0f 1f 00     nopl (%rax)
400d08:    5d     pop %rbp
400d09:    c3     retq
400d0a:    66 0f 1f 44 00 00     nopw 0x0(%rax,%rax,1)
0000000000400d10 <__do_global_dtors_aux>:
400d10:    80 3d d1 36 20 00 00     cmpb $0x0,0x2036d1(%rip) # 6043e8
400d17:    75 11     jne 400d2a <__do_global_dtors_aux+0x1a>
400d19:    55     push %rbp
400d1a:    48 89 e5     mov %rsp,%rbp
400d1d:    e8 6e ff ff ff     callq 400c90
400d22:    5d     pop %rbp
400d23:    c6 05 be 36 20 00 01     movb $0x1,0x2036be(%rip) # 6043e8
400d2a:    f3 c3     repz retq
400d2c:    0f 1f 40 00     nopl 0x0(%rax)
0000000000400d30 :
400d30:    bf 20 3e 60 00     mov $0x603e20,%edi
400d35:    48 83 3f 00     cmpq $0x0,(%rdi)
400d39:    75 05     jne 400d40
400d3b:    eb 93     jmp 400cd0
400d3d:    0f 1f 00     nopl (%rax)
400d40:    b8 00 00 00 00     mov $0x0,%eax
400d45:    48 85 c0     test %rax,%rax
400d48:    74 f1     je 400d3b
400d4a:    55     push %rbp
400d4b:    48 89 e5     mov %rsp,%rbp
400d4e:    ff d0     callq *%rax
400d50:    5d     pop %rbp
400d51:    e9 7a ff ff ff     jmpq 400cd0
0000000000400d56
:
400d56:    53     push %rbx
400d57:    83 ff 01     cmp $0x1,%edi
400d5a:    75 10     jne 400d6c
400d5c:    48 8b 05 6d 36 20 00     mov 0x20366d(%rip),%rax # 6043d0
400d63:    48 89 05 86 36 20 00     mov %rax,0x203686(%rip) # 6043f0
400d6a:    eb 63     jmp 400dcf
400d6c:    48 89 f3     mov %rsi,%rbx
400d6f:    83 ff 02     cmp $0x2,%edi
400d72:    75 3a     jne 400dae
400d74:    48 8b 7e 08     mov 0x8(%rsi),%rdi
400d78:    be 44 24 40 00     mov $0x402444,%esi
400d7d:    e8 4e fe ff ff     callq 400bd0
400d82:    48 89 05 67 36 20 00     mov %rax,0x203667(%rip) # 6043f0
400d89:    48 85 c0     test %rax,%rax
400d8c:    75 41     jne 400dcf
400d8e:    48 8b 4b 08     mov 0x8(%rbx),%rcx
400d92:    48 8b 13     mov (%rbx),%rdx
400d95:    be 46 24 40 00     mov $0x402446,%esi
400d9a:    bf 01 00 00 00     mov $0x1,%edi
400d9f:    e8 1c fe ff ff     callq 400bc0 <__printf_chk@plt>
400da4:    bf 08 00 00 00     mov $0x8,%edi
400da9:    e8 32 fe ff ff     callq 400be0
400dae:    48 8b 16     mov (%rsi),%rdx
400db1:    be 63 24 40 00     mov $0x402463,%esi
400db6:    bf 01 00 00 00     mov $0x1,%edi
400dbb:    b8 00 00 00 00     mov $0x0,%eax
400dc0:    e8 fb fd ff ff     callq 400bc0 <__printf_chk@plt>
400dc5:    bf 08 00 00 00     mov $0x8,%edi
400dca:    e8 11 fe ff ff     callq 400be0
400dcf:    e8 09 06 00 00     callq 4013dd
400dd4:    bf c8 24 40 00     mov $0x4024c8,%edi
400dd9:    e8 02 fd ff ff     callq 400ae0
400dde:    bf 08 25 40 00     mov $0x402508,%edi
400de3:    e8 f8 fc ff ff     callq 400ae0
400de8:    e8 65 08 00 00     callq 401652
400ded:    48 89 c7     mov %rax,%rdi
400df0:    e8 98 00 00 00     callq 400e8d
400df5:    e8 7e 09 00 00     callq 401778
400dfa:    bf 38 25 40 00     mov $0x402538,%edi
400dff:    e8 dc fc ff ff     callq 400ae0
400e04:    e8 49 08 00 00     callq 401652
400e09:    48 89 c7     mov %rax,%rdi
400e0c:    e8 98 00 00 00     callq 400ea9
400e11:    e8 62 09 00 00     callq 401778
400e16:    bf 7d 24 40 00     mov $0x40247d,%edi
400e1b:    e8 c0 fc ff ff     callq 400ae0
400e20:    e8 2d 08 00 00     callq 401652
400e25:    48 89 c7     mov %rax,%rdi
400e28:    e8 e8 00 00 00     callq 400f15
400e2d:    e8 46 09 00 00     callq 401778
400e32:    bf 9b 24 40 00     mov $0x40249b,%edi
400e37:    e8 a4 fc ff ff     callq 400ae0
400e3c:    e8 11 08 00 00     callq 401652
400e41:    48 89 c7     mov %rax,%rdi
400e44:    e8 d8 01 00 00     callq 401021
400e49:    e8 2a 09 00 00     callq 401778
400e4e:    bf 68 25 40 00     mov $0x402568,%edi
400e53:    e8 88 fc ff ff     callq 400ae0
400e58:    e8 f5 07 00 00     callq 401652
400e5d:    48 89 c7     mov %rax,%rdi
400e60:    e8 2f 02 00 00     callq 401094
400e65:    e8 0e 09 00 00     callq 401778
400e6a:    bf aa 24 40 00     mov $0x4024aa,%edi
400e6f:    e8 6c fc ff ff     callq 400ae0
400e74:    e8 d9 07 00 00     callq 401652
400e79:    48 89 c7     mov %rax,%rdi
400e7c:    e8 9f 02 00 00     callq 401120
400e81:    e8 f2 08 00 00     callq 401778
400e86:    b8 00 00 00 00     mov $0x0,%eax
400e8b:    5b     pop %rbx
400e8c:    c3     retq
0000000000400e8d :
400e8d:    48 83 ec 08     sub $0x8,%rsp
400e91:    be 90 25 40 00     mov $0x402590,%esi
400e96:    e8 db 04 00 00     callq 401376
400e9b:    85 c0     test %eax,%eax
400e9d:    74 05     je 400ea4
400e9f:    e8 39 07 00 00     callq 4015dd
400ea4:    48 83 c4 08     add $0x8,%rsp
400ea8:    c3     retq
0000000000400ea9 :
400ea9:    55     push %rbp
400eaa:    53     push %rbx
400eab:    48 83 ec 28     sub $0x28,%rsp
400eaf:    64 48 8b 04 25 28 00     mov %fs:0x28,%rax
400eb6:    00 00
400eb8:    48 89 44 24 18     mov %rax,0x18(%rsp)
400ebd:    31 c0     xor %eax,%eax
400ebf:    48 89 e6     mov %rsp,%rsi
400ec2:    e8 4c 07 00 00     callq 401613
400ec7:    83 3c 24 00     cmpl $0x0,(%rsp)
400ecb:    75 07     jne 400ed4
400ecd:    83 7c 24 04 01     cmpl $0x1,0x4(%rsp)
400ed2:    74 05     je 400ed9
400ed4:    e8 04 07 00 00     callq 4015dd
400ed9:    48 89 e3     mov %rsp,%rbx
400edc:    48 8d 6c 24 10     lea 0x10(%rsp),%rbp
400ee1:    8b 43 04     mov 0x4(%rbx),%eax
400ee4:    03 03     add (%rbx),%eax
400ee6:    39 43 08     cmp %eax,0x8(%rbx)
400ee9:    74 05     je 400ef0
400eeb:    e8 ed 06 00 00     callq 4015dd
400ef0:    48 83 c3 04     add $0x4,%rbx
400ef4:    48 39 eb     cmp %rbp,%rbx
400ef7:    75 e8     jne 400ee1
400ef9:    48 8b 44 24 18     mov 0x18(%rsp),%rax
400efe:    64 48 33 04 25 28 00     xor %fs:0x28,%rax
400f05:    00 00
400f07:    74 05     je 400f0e
400f09:    e8 f2 fb ff ff     callq 400b00 <__stack_chk_fail@plt>
400f0e:    48 83 c4 28     add $0x28,%rsp
400f12:    5b     pop %rbx
400f13:    5d     pop %rbp
400f14:    c3     retq
0000000000400f15 :
400f15:    48 83 ec 18     sub $0x18,%rsp
400f19:    64 48 8b 04 25 28 00     mov %fs:0x28,%rax
400f20:    00 00
400f22:    48 89 44 24 08     mov %rax,0x8(%rsp)
400f27:    31 c0     xor %eax,%eax
400f29:    48 8d 4c 24 04     lea 0x4(%rsp),%rcx
400f2e:    48 89 e2     mov %rsp,%rdx
400f31:    be 5d 28 40 00     mov $0x40285d,%esi
400f36:    e8 75 fc ff ff     callq 400bb0 <__isoc99_sscanf@plt>
400f3b:    83 f8 01     cmp $0x1,%eax
400f3e:    7f 05     jg 400f45
400f40:    e8 98 06 00 00     callq 4015dd
400f45:    83 3c 24 07     cmpl $0x7,(%rsp)
400f49:    77 63     ja 400fae
400f4b:    8b 04 24     mov (%rsp),%eax
400f4e:    ff 24 c5 00 26 40 00     jmpq *0x402600(,%rax,8)
400f55:    b8 4b 02 00 00     mov $0x24b,%eax
400f5a:    eb 05     jmp 400f61
400f5c:    b8 00 00 00 00     mov $0x0,%eax
400f61:    83 e8 5f     sub $0x5f,%eax
400f64:    eb 05     jmp 400f6b
400f66:    b8 00 00 00 00     mov $0x0,%eax
400f6b:    05 45 02 00 00     add $0x245,%eax
400f70:    eb 05     jmp 400f77
400f72:    b8 00 00 00 00     mov $0x0,%eax
400f77:    2d d5 03 00 00     sub $0x3d5,%eax
400f7c:    eb 05     jmp 400f83
400f7e:    b8 00 00 00 00     mov $0x0,%eax
400f83:    05 d5 03 00 00     add $0x3d5,%eax
400f88:    eb 05     jmp 400f8f
400f8a:    b8 00 00 00 00     mov $0x0,%eax
400f8f:    2d d5 03 00 00     sub $0x3d5,%eax
400f94:    eb 05     jmp 400f9b
400f96:    b8 00 00 00 00     mov $0x0,%eax
400f9b:    05 d5 03 00 00     add $0x3d5,%eax
400fa0:    eb 05     jmp 400fa7
400fa2:    b8 00 00 00 00     mov $0x0,%eax
400fa7:    2d d5 03 00 00     sub $0x3d5,%eax
400fac:    eb 0a     jmp 400fb8
400fae:    e8 2a 06 00 00     callq 4015dd
400fb3:    b8 00 00 00 00     mov $0x0,%eax
400fb8:    83 3c 24 05     cmpl $0x5,(%rsp)
400fbc:    7f 06     jg 400fc4
400fbe:    3b 44 24 04     cmp 0x4(%rsp),%eax
400fc2:    74 05     je 400fc9
400fc4:    e8 14 06 00 00     callq 4015dd
400fc9:    48 8b 44 24 08     mov 0x8(%rsp),%rax
400fce:    64 48 33 04 25 28 00     xor %fs:0x28,%rax
400fd5:    00 00
400fd7:    74 05     je 400fde
400fd9:    e8 22 fb ff ff     callq 400b00 <__stack_chk_fail@plt>
400fde:    48 83 c4 18     add $0x18,%rsp
400fe2:    c3     retq
0000000000400fe3 :
400fe3:    48 83 ec 08     sub $0x8,%rsp
400fe7:    89 d0     mov %edx,%eax
400fe9:    29 f0     sub %esi,%eax
400feb:    89 c1     mov %eax,%ecx
400fed:    c1 e9 1f     shr $0x1f,%ecx
400ff0:    01 c8     add %ecx,%eax
400ff2:    d1 f8     sar %eax
400ff4:    8d 0c 30     lea (%rax,%rsi,1),%ecx
400ff7:    39 f9     cmp %edi,%ecx
400ff9:    7e 0c     jle 401007
400ffb:    8d 51 ff     lea -0x1(%rcx),%edx
400ffe:    e8 e0 ff ff ff     callq 400fe3
401003:    01 c0     add %eax,%eax
401005:    eb 15     jmp 40101c
401007:    b8 00 00 00 00     mov $0x0,%eax
40100c:    39 f9     cmp %edi,%ecx
40100e:    7d 0c     jge 40101c
401010:    8d 71 01     lea 0x1(%rcx),%esi
401013:    e8 cb ff ff ff     callq 400fe3
401018:    8d 44 00 01     lea 0x1(%rax,%rax,1),%eax
40101c:    48 83 c4 08     add $0x8,%rsp
401020:    c3     retq
0000000000401021 :
401021:    48 83 ec 18     sub $0x18,%rsp
401025:    64 48 8b 04 25 28 00     mov %fs:0x28,%rax
40102c:    00 00
40102e:    48 89 44 24 08     mov %rax,0x8(%rsp)
401033:    31 c0     xor %eax,%eax
401035:    48 8d 4c 24 04     lea 0x4(%rsp),%rcx
40103a:    48 89 e2     mov %rsp,%rdx
40103d:    be 5d 28 40 00     mov $0x40285d,%esi
401042:    e8 69 fb ff ff     callq 400bb0 <__isoc99_sscanf@plt>
401047:    83 f8 02     cmp $0x2,%eax
40104a:    75 06     jne 401052
40104c:    83 3c 24 0e     cmpl $0xe,(%rsp)
401050:    76 05     jbe 401057
401052:    e8 86 05 00 00     callq 4015dd
401057:    ba 0e 00 00 00     mov $0xe,%edx
40105c:    be 00 00 00 00     mov $0x0,%esi
401061:    8b 3c 24     mov (%rsp),%edi
401064:    e8 7a ff ff ff     callq 400fe3
401069:    83 f8 03     cmp $0x3,%eax
40106c:    75 07     jne 401075
40106e:    83 7c 24 04 03     cmpl $0x3,0x4(%rsp)
401073:    74 05     je 40107a
401075:    e8 63 05 00 00     callq 4015dd
40107a:    48 8b 44 24 08     mov 0x8(%rsp),%rax
40107f:    64 48 33 04 25 28 00     xor %fs:0x28,%rax
401086:    00 00
401088:    74 05     je 40108f
40108a:    e8 71 fa ff ff     callq 400b00 <__stack_chk_fail@plt>
40108f:    48 83 c4 18     add $0x18,%rsp
401093:    c3     retq
0000000000401094 :
401094:    48 83 ec 18     sub $0x18,%rsp
401098:    64 48 8b 04 25 28 00     mov %fs:0x28,%rax
40109f:    00 00
4010a1:    48 89 44 24 08     mov %rax,0x8(%rsp)
4010a6:    31 c0     xor %eax,%eax
4010a8:    48 8d 4c 24 04     lea 0x4(%rsp),%rcx
4010ad:    48 89 e2     mov %rsp,%rdx
4010b0:    be 5d 28 40 00     mov $0x40285d,%esi
4010b5:    e8 f6 fa ff ff     callq 400bb0 <__isoc99_sscanf@plt>
4010ba:    83 f8 01     cmp $0x1,%eax
4010bd:    7f 05     jg 4010c4
4010bf:    e8 19 05 00 00     callq 4015dd
4010c4:    8b 04 24     mov (%rsp),%eax
4010c7:    83 e0 0f     and $0xf,%eax
4010ca:    89 04 24     mov %eax,(%rsp)
4010cd:    83 f8 0f     cmp $0xf,%eax
4010d0:    74 2f     je 401101
4010d2:    b9 00 00 00 00     mov $0x0,%ecx
4010d7:    ba 00 00 00 00     mov $0x0,%edx
4010dc:    83 c2 01     add $0x1,%edx
4010df:    48 98     cltq
4010e1:    8b 04 85 40 26 40 00     mov 0x402640(,%rax,4),%eax
4010e8:    01 c1     add %eax,%ecx
4010ea:    83 f8 0f     cmp $0xf,%eax
4010ed:    75 ed     jne 4010dc
4010ef:    c7 04 24 0f 00 00 00     movl $0xf,(%rsp)
4010f6:    83 fa 0f     cmp $0xf,%edx
4010f9:    75 06     jne 401101
4010fb:    3b 4c 24 04     cmp 0x4(%rsp),%ecx
4010ff:    74 05     je 401106
401101:    e8 d7 04 00 00     callq 4015dd
401106:    48 8b 44 24 08     mov 0x8(%rsp),%rax
40110b:    64 48 33 04 25 28 00     xor %fs:0x28,%rax
401112:    00 00
401114:    74 05     je 40111b
401116:    e8 e5 f9 ff ff     callq 400b00 <__stack_chk_fail@plt>
40111b:    48 83 c4 18     add $0x18,%rsp
40111f:    c3     retq
0000000000401120 :
401120:    41 56     push %r14
401122:    41 55     push %r13
401124:    41 54     push %r12
401126:    55     push %rbp
401127:    53     push %rbx
401128:    48 83 ec 60     sub $0x60,%rsp
40112c:    64 48 8b 04 25 28 00     mov %fs:0x28,%rax
401133:    00 00
401135:    48 89 44 24 58     mov %rax,0x58(%rsp)
40113a:    31 c0     xor %eax,%eax
40113c:    48 89 e6     mov %rsp,%rsi
40113f:    e8 cf 04 00 00     callq 401613
401144:    49 89 e4     mov %rsp,%r12
401147:    49 89 e5     mov %rsp,%r13
40114a:    41 be 00 00 00 00     mov $0x0,%r14d
401150:    4c 89 ed     mov %r13,%rbp
401153:    41 8b 45 00     mov 0x0(%r13),%eax
401157:    83 e8 01     sub $0x1,%eax
40115a:    83 f8 05     cmp $0x5,%eax
40115d:    76 05     jbe 401164
40115f:    e8 79 04 00 00     callq 4015dd
401164:    41 83 c6 01     add $0x1,%r14d
401168:    41 83 fe 06     cmp $0x6,%r14d
40116c:    74 21     je 40118f
40116e:    44 89 f3     mov %r14d,%ebx
401171:    48 63 c3     movslq %ebx,%rax
401174:    8b 04 84     mov (%rsp,%rax,4),%eax
401177:    39 45 00     cmp %eax,0x0(%rbp)
40117a:    75 05     jne 401181
40117c:    e8 5c 04 00 00     callq 4015dd
401181:    83 c3 01     add $0x1,%ebx
401184:    83 fb 05     cmp $0x5,%ebx
401187:    7e e8     jle 401171
401189:    49 83 c5 04     add $0x4,%r13
40118d:    eb c1     jmp 401150
40118f:    48 8d 4c 24 18     lea 0x18(%rsp),%rcx
401194:    ba 07 00 00 00     mov $0x7,%edx
401199:    89 d0     mov %edx,%eax
40119b:    41 2b 04 24     sub (%r12),%eax
40119f:    41 89 04 24     mov %eax,(%r12)
4011a3:    49 83 c4 04     add $0x4,%r12
4011a7:    4c 39 e1     cmp %r12,%rcx
4011aa:    75 ed     jne 401199
4011ac:    be 00 00 00 00     mov $0x0,%esi
4011b1:    eb 1a     jmp 4011cd
4011b3:    48 8b 52 08     mov 0x8(%rdx),%rdx
4011b7:    83 c0 01     add $0x1,%eax
4011ba:    39 c8     cmp %ecx,%eax
4011bc:    75 f5     jne 4011b3
4011be:    48 89 54 74 20     mov %rdx,0x20(%rsp,%rsi,2)
4011c3:    48 83 c6 04     add $0x4,%rsi
4011c7:    48 83 fe 18     cmp $0x18,%rsi
4011cb:    74 14     je 4011e1
4011cd:    8b 0c 34     mov (%rsp,%rsi,1),%ecx
4011d0:    b8 01 00 00 00     mov $0x1,%eax
4011d5:    ba 00 43 60 00     mov $0x604300,%edx
4011da:    83 f9 01     cmp $0x1,%ecx
4011dd:    7f d4     jg 4011b3
4011df:    eb dd     jmp 4011be
4011e1:    48 8b 5c 24 20     mov 0x20(%rsp),%rbx
4011e6:    48 8d 44 24 20     lea 0x20(%rsp),%rax
4011eb:    48 8d 74 24...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here