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