You are on page 1of 1

DEFUSING A BINARY BOMB

INTRODUCTION
The goal of this assignment is to understand how programs run at a system level. We will
examine an executable file with low-level tools such as the Gnu debugger (GDB) in order to
understand what the executable does and how it does it. We do not have access to the C source
code for the program.

The bomb program reads a sequence of inputs from the console. Each subsequent input is fed
into one of the 5 “phases” of the bomb. The phases are implemented as functions phase_1,
phase_2, etc. For each phase, a user’s input will first be read by the bomb as a string. Any further
tokenization of parsing of this string will be done by the phases, or their supporting functions.

In each phase, certain inputs will be “accepted”, in which case the phase is “defused”, and the
program will proceed to the next phase. However, most inputs will cause the phase to “explode”,
as indicated by this output:

BOOM!!! The bomb has blown up.

If we type 6 lines of input without seeing the above output, then you have defused the whole
bomb. Note that for some phases, our first input will have an effect on what input(s) defuse a
phase.
The GNU debugger will help us figure out what the assembly language code is doing.

You may notice use of verb!sscanf! throughout many of the phases of the code. The sscanf
function works the same as scanf, except it receives a string as though it were user input. The
string is passed as the first parameter to sscanf. For example:

You might also like