操作系统代写 |OS 代写

UCL CS 0019 Computer System

Introduction

The nefarious Dr. Evil has planted a slew of “binary bombs” on our class server. A binary bomb is a program that consists of a sequence of phases. Each phase expects you to type a particular string on the standard input stdin. If you type the correct string, then the phase is defused and the bomb proceeds to the next phase. Otherwise, the bomb explodes by printing "BOOM!!!" and then terminating. The bomb is defused when every phase has been defused.

There are too many bombs for us to deal with, so we are giving each student a different bomb to defuse. Your mission, which you have no choice but to accept, is to defuse your bomb before the due date. Good luck!

Get Your Bomb

To obtain your bomb, you must first register for the 0019 grading server. You received email from the instructors with a link to a handout providing instructions on how to do so. Please follow the instructions in that email before proceeding further.

After you register successfully, you will find your bomb within your registration GitHub repo in a tar.gz file called bombk.tar.gz, where k is the unique number of your bomb.

CW1 involves your stepping through and analyzing the execution of an x86-64 binary pro- gram. It therefore only functions on machines with an x86-64 CPU.1 We provide several re- motely ssh-accessible machines running a standard 0019 Linux environment on x86-64 hard- ware at UCL CS for you to use to run your bomb while working on CW1. You can find instruc- tions on how to access these 0019 Linux machines via ssh on the 0019 courseworks web page: http://www.cs.ucl.ac.uk/staff/B.Karp/0019/s2024/cw.html.

Once you are logged into an x86-64 Linux machine, obtain an updated copy of your regis- tration git repo. If you already have your registration repo on an x86-64 Linux host, just issue the command git pull in the shell while working in the directory for your local copy of the repo. Otherwise, clone the repo from GitHub by typing

    git clone https://github.com/UCLCS0019/YOUR-REGREPO-NAME

in the shell, where YOUR-REGREPO-NAME is the name of your registration repo from when you completed the CW0 grading server registration process.

Copy the bombk.tar.gz file to the directory where you wish to do your work. If you’re working on a UCL CS-hosted VM, make sure the directory is readable only by your user ID. Then run tar -xzvf bombk.tar.gz in that directory. Doing so will extract the following files: 

Defuse Your Bomb

Before running your bomb, read this entire coursework handout!

Your job is to defuse your bomb. Doing so involves supplying it with just the right input. You will rapidly notice that while there is a bomb.c file, it doesn’t actually contain the code for the various phases. You’re going to be defusing the bomb using x86 assembly language (lucky you!).

The bombs seem to be tamper-proofed in a couple ways. For one, they can only be defused when run on a machine connected to the Internet. Running the bomb on a machine without Internet connectivity won’t do anything. There are several other tamper-proofing devices built into the bomb as well, we hear!

You can use many tools to help you defuse your bomb. Probably the best way is to use your favorite debugger to step through the disassembled binary.

Each time your bomb explodes it notifies Dr. Evil, who informs us, and you lose 1/2 point (up to a maximum of 20 points) in the final score for the coursework. So there are consequences to exploding the bomb. You must be careful!

The first four phases are worth 10 points each. Phases 5 and 6 are a little more difficult, so they are worth 15 points each. So the maximum score is 70 points.

Although phases get progressively harder to defuse, the expertise you gain as you move from phase to phase should offset this difficulty. However, the last phase will challenge everyone, so please don’t wait until the last minute to start.

The bomb ignores blank input lines. If you run your bomb with a command-line argument, for example,

    % ./bomb psol.txt

then it will read the input lines from psol.txt until it reaches the end of file, and then switch over to stdin. In a moment of weakness, Dr. Evil added this feature so you don’t have to keep retyping the solutions to phases you have already defused. Make sure to include a newline at the end of the file!

To avoid accidentally detonating the bomb, you will need to learn how to single-step through the assembly code and how to set breakpoints. You will also need to learn how to inspect both registers and memory state. One of the nice side-effects of doing the lab is that you will get very good at using a debugger!

Submission

There is no explicit submission step. The bomb automatically notifies the class staff of your progress as you work on it. You can keep track of how you are doing and see where you stand (anonymously) against the rest of the class by looking at the class scoreboard at:

    https://studcw2.cs.ucl.ac.uk:15213/scoreboard



咨询 Alpha 小助手,获取更多课业帮助