CompOrg Fall 2002 Homework #3

CompOrg Binary Puzzle Squad

Due Date: 10/17/02 (by 11:59:59PM)
Only Electronic Submissions!

Late Penalty: 10% per day

This counts for two homeworks!

Assignment

You have been selected to be a member of an elite group of cyber-techno-digi-gurus who are needed to solve some binary puzzles. Your have been selected due to your expertise in X86 assmembly language, your knowledge of data representation and computer arithmetic, and your extensive knowledge of how to read an ASCII reference chart.

You will be given a "binary puzzle" which you must solve. If you are not capable of solving the puzzle, one of two possible things will happen:

  1. You will get a bad grade on this assignment.
  2. The world will end.

I can't remember which will actually happen... feel free to use whichever one provides you with more motivation.

Binary Puzzle

A binary puzzle is an executable program that consists of six phases. Each phases expects the user to enter a particular string (via stdin). If the expected string is entered, the phase has been solved and the progam moves on to the next phase. If the expected string is not entered, the program prints "BOOM" and quits. Your job is to solve as many phases as possible.

Each phase tests a different aspect of machine language programs:

Phase 1:comparison
Phase 2: loops
Phase 3: conditionals/switches
Phase 4: recursive calls and the stack discipline
Phase 5: pointers
Phase 6: linked lists/pointers/structs

There is also a challenging "secret phase"... (but it's a secret)

Each student will get a unique puzzle, the solution to your puzzle (the sequence of expected strings) is different than everyone else's. Feel free to help each other with general concepts (you can work together), but you are not allowed to submit solutions to your puzzle unless you determined the solutions. In other words - if you need help, feel free to ask Dave or the TAs or anyone else to help you get started, but you must have a complete understanding of how to figure out what the solution is (you will certainly need this ability on a test!).

The phases are ordered in increasing difficulty, and phase 1 is pretty easy. Don't underestimate the project just because you can solve the first phase - the subsequent phases get harder!

How to get your puzzle

There are puzzles available for each of the Unix-environments listed below. To get a puzzle for your environment just click on the appropriate icon.

Linux cygwin BSD

Your puzzle will be sent in a zip file that includes:

We assume that you can handle a zip file! Under Windows you can use WinZip (available at www.winzip.com). Under Unix you can use unzip to unzip a zip file.

NOTE: The "puzzle server" that sends you a binary puzzle (when you click on one of the above icons) will make sure that your puzzle is not sent to anyone else! It is not acceptable that two students submit the same puzzle ID - everyone needs to get a unique puzzle (with a unique solution!). Each student needs only one puzzle, so please don't download lots of them (there are a fixed number of puzzles pre-made, and if the server runs out this will inconvience other students who have not yet received one puzzle!).

How to submit

Submission of your homework is via email, the general idea is to send an email message with your solution and puzzle ID file as attachments. There is an automated email submission system that will respond to your submission right away, so you will have a record that we got your file.

All projects must be submitted via email to comporg-submit@cs.rpi.edu. The subject line of the submission message should contain a single number '3' indicating the HW number. Your submission must include the following:

IMPORTANT! Make sure your email message includes your full name, we can't record your grade unless we know your name!

Don't send your puzzle program in your submission! These programs are dangerous and we certainly don't want to be messing with them (that's why we have you experts handing things...).

You can expect a return email indicating receipt of your project submission immediately. This receipt will include a list of all the files that were successfully extracted by the submission script - please look over the receipt carefully to make sure your submission worked.

Multiple Submissions: You can resubmit up to 10 times for each project, we will always grade the last submission received unless you tell us otherwise.

Grading

Grades will be determined by the number of phases you are able to solve:

It is possible to get partial credit for a phase (up to 1/2 the points). To get extra credit you need to include a description of how far you got figuring out the phase (show us the assembly code and describe what you think is happening, etc). Partial credit points will not be awarded if we can't understand your description (you need to make sure that you convince us that you have some understanding of what is happening in the code for the phase).

HINTS:
  • There are lots of helpful tools available on Unix:

    The book describes how to use objdump and gdb to dissasemble code and (in the case of gdb) debug assembly language programs.

  • You may find that you need to look up ASCII character values, here is an ASCII reference table that shows hex values and corresponding ASCII characters:

    | 00 nul| 01 soh| 02 stx| 03 etx| 04 eot| 05 enq| 06 ack| 07 bel|
    | 08 bs | 09 ht | 0a nl | 0b vt | 0c np | 0d cr | 0e so | 0f si |
    | 10 dle| 11 dc1| 12 dc2| 13 dc3| 14 dc4| 15 nak| 16 syn| 17 etb|
    | 18 can| 19 em | 1a sub| 1b esc| 1c fs | 1d gs | 1e rs | 1f us |
    | 20 sp | 21  ! | 22  " | 23  # | 24  $ | 25  % | 26  & | 27  ' |
    | 28  ( | 29  ) | 2a  * | 2b  + | 2c  , | 2d  - | 2e  . | 2f  / |
    | 30  0 | 31  1 | 32  2 | 33  3 | 34  4 | 35  5 | 36  6 | 37  7 |
    | 38  8 | 39  9 | 3a  : | 3b  ; | 3c  < | 3d  = | 3e  > | 3f  ? |
    | 40  @ | 41  A | 42  B | 43  C | 44  D | 45  E | 46  F | 47  G |
    | 48  H | 49  I | 4a  J | 4b  K | 4c  L | 4d  M | 4e  N | 4f  O |
    | 50  P | 51  Q | 52  R | 53  S | 54  T | 55  U | 56  V | 57  W |
    | 58  X | 59  Y | 5a  Z | 5b  [ | 5c  \ | 5d  ] | 5e  ^ | 5f  _ |
    | 60  ` | 61  a | 62  b | 63  c | 64  d | 65  e | 66  f | 67  g |
    | 68  h | 69  i | 6a  j | 6b  k | 6c  l | 6d  m | 6e  n | 6f  o |
    | 70  p | 71  q | 72  r | 73  s | 74  t | 75  u | 76  v | 77  w |
    | 78  x | 79  y | 7a  z | 7b  { | 7c  | | 7d  } | 7e  ~ | 7f del|