Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
This lab serves as a newly added experiential learning module within CISC221, offering
hands-on exposure to binary files and assembly code debugging at the instruction set
level of the x86 processor. Understanding debugging at this level is crucial for grasping
computer architecture and gaining reverse engineering proficiency. Such skills are vital
to fields like code optimization, embedded systems, and cybersecurity. Furthermore, it
fosters essential debugging skills applicable across diverse programming domains. By
emphasizing the lab's hands-on approach, its challenging yet rewarding nature, and the
career prospects it offers, students are motivated to engage actively, deepening their
comprehension of low-level computing and laying a foundation for advanced learning in
related subjects.
Good luck, and welcome to the bomb squad!
I. Description
This lab is for a digital binary bomb, with the schematic shown below.
2
As illustrated in the diagram, the binary bomb is composed of four distinct phases, each
requiring a specific input string, set of numbers, or combination thereof for successful
defusal. Correctly entering the required input disarms the phase, allowing the bomb to
advance to the next stage. Failure to provide accurate input triggers an explosion,
signaled by the display of "BOOM!!!" before termination. The entire bomb is considered
defused only when all four phases have been disarmed. Each student will receive their
own bomb to defuse as part of this mini-project. Your objective is to successfully
disarm your assigned bomb before the designated due date.
The executable binary file is the bomb is called “bomb_lab” and is located at the
CASLAB machines in the following directory linux>cas/course/cisc221. To access the
bomb_lab file, you should first go up to root directory by typing (cd ..) twice, then
navigate to the following folder linux>cas/course/cisc221 as shown below
You can then run the bomb by (./bomb_lab) or debug the bomb by (gdb bomb_lab).
II. Overview
The Bomb consists of four phases (sub-problems):
1) Phase 1: Requires a textual input, for example, "Hello world."
2) Phase 2: Requires an array of six numbers, for example, 12 34 81 23 10 22.
3) Phase 3: Requires three inputs in the order of integer, character, and integer, with
the first integer falling within the range of 0 to 7, for example, 3 Z 1.
4) Phase 4: Requires a textual input, for example, "Goodbye!"
You should work on the gdb debugger to trace clues, disassemble functions, investigate
the contents of the registers/stack to find the defusal passcodes for each phase. The
most important registers that you should keep track of their content are
? %rax: return value
? %rsp: stack pointer
? %rdi: 1st argument
? %rsi: 2nd argument
? %rdx: 3rd argument
? %rbp: base pointer
3
Please note that registers are typed in the gdb debugger preceded by a dollar sign
($rax) not a percentage sign. For instance to check the data in %rax, you type (info
registers $rax)
To help you find some clues, Table 1 highlights the most important labels for each phase
and Table 2 lists all the debugging commands that you will need to defuse your bomb
Table 1. most important labels
Table 2. gdb common commands
command desc example
run runs the loaded executable program run
break
[func_name]
breaks once you call a specific function break phase_1
break *
mem_loc
breaks when you execute the instruction at
a certain address
break * 0x0000555555555ef9
info
breakpoints
displays information about all breakpoints
currently set
info breakpoints
deletel
breakpoints
delete a specific breakpoint delete breakpoints 10 //delete
breakpoint number 10
continue continue to the next breakpoint continue
stepi steps through a single x86 instruction.