CS 202 - Homework 7

Due: Friday 4/20, at 5pm

This homework is the "bomb lab" from the Bryant and O'Hallaron text, customized for our course. Here is the write-up.

You may work in groups of two (highly recommended!), or by yourself if you prefer. Grading happens automatically; your current score will be displayed (anonymously) on the scoreboard.

To get started, form a team and check out your personal bomb here. If you work in a team, enter both usernames separated by an underscore, and one of the emails. You will need to save the bomb on basin or on one of the lab machines.

This is a difficult lab and will require significant time. For added incentive to get started early, your total score will be computed as follows:

total = min(10, score_Fri) + min(25, score_Mon) + score_final

where:
  score_Fri is your score as of 5pm this Friday, 4/13; 
  score_Mon is your score as of 5pm on Monday, 4/16; 
  score_final is your score (max 70) by the deadline, 5pm on Friday 4/20.

Your final score is out of 100; up to 105 is possible. You cannot take any extensions on any of the deadlines. Please keep track of the total time; you will report it on the submission page (link below).

Honor code note: You (obviously) may not share any of the solutions to any of the stages (which will also differ by bomb). Also, you may not provide specific instructions on how to diffuse a stage once you figured it out. But you may help your classmates by explaining general concepts and by giving suggestions of what to try next (e.g., "have you examined the memory pointed to by register X?" or "have you tried setting a breakpoint in Y?").


Hints

Hints and clarifications will be posted here; please reload this page often.

Here are the most important gdb instructions:

gdb -tui bomb  // start gdb on your bomb
lay asm        // show disassembled code
lay reg        // show registers

start          // start program from the top

step           // step one C instruction
next           // like step, but "step over" function calls

stepi          // step one assembly instruction
nexti          // like stepi, but "step over" function calls

b LOC          // set breakpoint at LOC
run            // run from beginning until it hits breakpoint
run a.txt      // run, taking bomb input from text file

cont           // continue running until next breakpoint

x/3dw $rax     // examine 3 4-byte words in memory pointed to by %rax in decimal
               // (for other variants of the powerful x command see the linked documentation)

Control-D      // one way to quit out of gdb
Other hints:


Electronic submission

While your grade is determined by your online scores, I still want you to submit your text file with your solutions, mainly so I get a record of the total time taken and your collaborators. Please upload your textfile "psol.txt" via the HW 7 submission page by the due date. (It's fine if your file has a different name, you can ignore the warning.) Only one person per team should submit (whoever checked out the bomb). Minus 3 points if you don't submit!


Good luck and have fun!