Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Programming Assignment 2: Art of the Bomb
In order to maintain the apprehension and disquiet of Halloween Dr. Evil has distributed digital bombs across the iLabs. Thankfully, Evil's Doctorate is in the Fine and Performing Arts, not Computer Science, so you are entirely capable of defusing any of the bombs by examining its assembly using GDB. There are too many bombs for one person to defuse, so you must each download one of Evil's bombs and defuse it. Each bomb consists of 9 phases. You must enter the code sequence on STDIN in order to defuse each phase. If you enter the correct code string for a phase the bomb will advance to the next phase. If you enter an incorrect code, the bomb will explode. It will print out “BOOM!!!” and terminate. The bomb will be completely defused if you enter the code sequence for all nine phases. If you want to quit where you are be sure to break out of the bomb. Exploding it by giving it bad code sequences will cost you points.
0. Instructions
The bombs were constructed specifically for 32-bit machines and Linux operating system. You must do this assignment on the iLab machines. You will not defuse the bomb otherwise and will not get credit. In fact, there is a rumor that Dr. Evil has ensured the bomb will always blow up if run elsewhere. There are several other tamper-proofing devices built into the bomb as well, or so they say.
This address is only “visible” when you are connected in the Rutgers network. Fill out the form with your NetID and your email address to get your bomb package. The file that you will get is in the format bombN.tar, where N is your bomb ID. If you haven’t downloaded it on to the iLab machines, copy the file to there and untar your bomb into your home directory.
$ tar -xvf bomb
… will create a directory bomb
0 bomb: The executable binary bomb
0 bomb.c: Source file with the bomb’s main routine
0 README: File with the bomb ID and extra information
You can use many tools to help you defuse the bomb. Look at the tools section for some tips and ideas. The best way is to use a debugger to step through the disassembled binary. The bomb ignores blank input lines. Instead of inputting the answers to completed phases over and over you can run the bomb with a file that contains the code sequences for all the phases you've solved so far:
./bomb mysolution.txt
The bomb will switch over to STDIN once all the code sequences from the file have been read in. List them in order, one per line.
1. Resources
There are a number of online resources that will help you understand any assembly instructions you may encounter while examining the bomb. In particular, the programming manuals for x86-IA32 processors distributed by Intel and AMD are exceptionally valuable. They both describe the same ISA, but sometimes one may be easier to understand than the other.
1.0. Directly useful for this assignment
1.2. Checking your work
Look up your bomb's ID to see how many points you have, up to which phase of the bomb you have defused, and so on. You have to be on the Rutgers network to access the above link.
2. Tools
There are many ways of defusing your bomb. You can examine it in great detail without ever running the program. This is a useful technique, but it not always easy to do. You can also run it under a debugger, watch what it does step by step, and use this information to defuse it. This is probably the fastest way of defusing it.
We do make one request, please do not use brute force! You could write a program that will try every possible key to find the right one, but the number of possibilities is so large that you won’t be able to try them all in time, or before you run out of points. Exploding the bomb will cost you 0.5 points.
There are many tools which are designed to help you figure out both how programs work, and what is wrong when they don’t work. Here is a list of some of the tools you may find useful in analyzing your bomb, and hints on how to use them.