CS 211编程代做、代写c/c++,Java程序
CS 211编程代做、代写c/c++,Java程序
CS 211 - Computer Architecture
Instructor: Prof. Santosh Nagarakatte
Assignment 4
Disassembling and Defusing a Binary Bomb
March 25, 2024
Due by April 10, 2024 - 5:00PM
dis·as·sem·ble (vt)
take apart: to take something such as a piece of machinery apart.
– Bing Dictionary
0 Overview
The purpose of Assignment 4 (PA4) is for you to become familiar with x86 64 Instruction Set Architecture (ISA).
The nefarious Dr. Evil has planted a slew of ”binary bombs” on our machines. A binary bomb is a program
that consists of a sequence of phases. Each phase expects you to type a particular string on 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 everyone a bomb to defuse. Your mission,
which you have no choice but to accept, is to defuse your bomb before the due date. Good luck, and welcome to
the bomb squad!
1 Instructions
The bombs were constructed specifically for the Linux operating system. You must do this assignment on the iLab
machines. You will not defuse the bomb otherwise and will not get credit.
In fact, there is a rumor that Dr. Evil has ensured the bomb will always blow up if run elsewhere. There are
several other tamper-proofing devices built into the bomb as well, or so they say.
Open an Internet Browser and go to the URL: http://skylake.cs.rutgers.edu:17300. This address is only “visible” when you access it on iLab machines through weblogin. Fill the form up with your NetID
and your email address to get your bomb package. The file that you will get is in the format bombN.tar, where N is
your bomb ID, i.e. ID.
If you haven’t downloaded it in the iLab machines, copy the file to there and untar your bomb into your home
directory.
We recommend that you download no more than two bombs. Copy the bomb that you downloaded into your
iLab account and work with it.
$ tar -xvf bomb<ID>.tar
It will create a directory bomb< ID > that should contain the following files:
1
• bomb: The executable binary bomb
• bomb.c: Source file with the bomb’s main routine
• README: File with the bomb ID and extra information
Your job is to defuse the bomb. You can use many tools to help you with this; please look at the tools section
for some tips and ideas. The best way is to use a debugger to step through the disassembled binary.
The bomb has 9 phases. The phases get progressively harder to defuse, but the expertise you gain as you move
from phase to phase should offset this difficulty. Nonetheless, the latter phases are not easy, so please don’t wait
until the last minute to start. (If you’re stumped, check the hints section at the end of this document.)
The bomb ignores blank input lines. If you run your bomb with a command line argument, for example,
./bomb mysolution.txt
then it will read the input lines from mysolution.txt until it reaches EOF (end of file), and then switch over to
stdin (standard input from the terminal). 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.
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 the registers and the memory states.
One of the nice side-effects of doing the lab is that you will get very good at using a debugger. This is a crucial
skill that will pay big dividends the rest of your career.
IMPORTANT: Every time that the bomb explodes, you will lose 0.5 points. It is important that you use
breakpoints and avoid those unnecessary explosions.
2 Resources
There are a number of online resources that will help you understand any assembly instructions you may encounter
while examining the bomb. In particular, the programming manuals for x86 processors distributed by Intel and
AMD can be valuable. They both describe the same ISA, but sometimes one may be easier to understand than the
other.
It is important to realize that the assembly syntax of the instructions on the Intel manual follows the Intel
assembly language, while in the book, in gcc, and in gdb they all use the AT&T assembly language. They are
perfectly interchangable, you can identify the differences in this webpage:
http://asm.sourceforge.net/articles/linasm.html
2.1 Checking your Work
We provided a webpage where you can check your work. Access:
http://skylake.cs.rutgers.edu:17300/scoreboard to verify how many points you have, up to
which phase you have defused the bomb, and so on. You have to be on the iLab machines to access the above link.
3 Tools
There are many ways of defusing your bomb. You can examine it in great detail without ever running the program,
and figure out exactly what it does. This is a useful technique, but it not always easy to do. You can also run it
under a debugger, watch what it does step by step, and use this information to defuse it. This is probably the fastest
way of defusing it.
2
We do make one request, please do not use brute force! You could write a program that will try every possible
key to find the right one, but the number of possibilities is so large that you won’t be able to try them all in time.
There are many tools which are designed to help you figure out both how programs work, and what is wrong
when they don’t work. Here is a list of some of the tools you may find useful in analyzing your bomb, and hints on
how to use them.
• gdb: The GNU debugger is a command line debugger tool available on virtually every platform. You can
trace through a program line by line, examine memory and registers, look at both the source code and
assembly code (we are not giving you the source code for most of your bomb), set breakpoints, set memory
watch points, and write scripts. Here are some tips for using gdb.
– To keep the bomb from blowing up every time you type in a wrong input, you’ll want to learn how to
set breakpoints.
– The CS:APP Student Site has a very handy gdb summary (there is also a more extensive tutorial).
– For other documentation, type help at the gdb command prompt, or type ”man gdb”, or ”info gdb” at a
Unix prompt. Some people also like to run gdb under gdb-mode in emacs.
• objdump -t bomb: This will print out the bomb’s symbol table. The symbol table includes the names of all
functions and global variables in the bomb, the names of all the functions the bomb calls, and their addresses.
You may learn something by looking at the function names!
• objdump -d bomb: Use this to disassemble all of the code in the bomb. You can also just look at individual
functions. Reading the assembler code can tell you how the bomb works. Although objdump -d gives you a
lot of information, it doesn’t tell you the whole story. Calls to system-level functions may look cryptic. For
example, a call to sscanf might appear as:
8048c36: e8 99 f c ff ff call 80488d4 < init + 0x1a0 >
To determine that the call was to sscanf, you would need to disassemble within gdb.
• strings -t x bomb: This utility will display the printable strings in your bomb and their offset within the
bomb.
Looking for a particular tool? How about documentation? Don’t forget, the commands apropos and man
are your friends. In particular, man ascii is more useful than you’d think. If you get stumped, use the course’s
discussion board on Canvas.
4 Submission
You have to e-submit the assignment using Canvas. Your submission should be a tar file named bomb < ID > .tar
that can be extracted using the command:
tar -xf bomb<ID>.tar
Extracting your tar file must give a directory called bomb < ID >. This directory should contain the same
files that you downloaded, along with the file mysolution.txt to defuse the bomb.
To create the tar file that you will submit after finishing your programming assignment, you will use the following command line, in the parent directory of bomb < ID >:
tar -cvf bomb<ID>.tar bomb<ID>/
3
5 Grading
Your grade will be based on how many stages of the bomb you have defused. Be careful to follow all instructions.
If something doesn’t seem right, ask.
6 Collaboration
You are not supposed to assist your friends or other students in solving the bombs. You are required not to use any
online resource other than ones explicitly described above. If in doubt, ask. Keep in mind that your final will test
you based on the skills learned in this assignment.
请加QQ:99515681 邮箱:99515681@qq.com WX:codinghelp
- 2024金智维大模型应用暨新品发布会成功举办,助推新质生产力发展
- Ins群发营销软件,Instagram打粉工具,让你的营销无往不利!
- Ins批量筛选群发营销采集神器,Instagram营销工具,助你轻松营销!
- Telegram协议号安全性解析:如何保护网络通信的核心标识?
- EIG 旗下 MidOcean Energy 将收购 SK Earthon 在秘鲁液化天然气(PLNG)公司 20% 的股份
- Ins群发消息工具,Instagram模拟器群发软件,助你实现营销梦想!
- 心花怒放 WhatsApp拉群营销工具为我的生意注入了蓬勃的活力
- 聚焦新质生产力:从年报解读粤企“新”动向
- 喊出要借助AI大模型重塑旗下所有业务的百度,到了检验成果的时候
- WhatsApp拉群营销工具改变我的命运,营业额飙升到新高度
- Instagram群发脚本助手,Ins群发注册工具,助你实现营销目标!
- Ins引流助手,Instagram打粉工具,助你轻松赢得市场!
- 郑州大学第一附属医院:构建智能化报告系统平台,加速个体化用药时代到来
- 创新仙方 科技魔法师的奇迹心得 WhatsApp拉群营销工具点亮商业星空
- 我曾陷入LINE营销的迷失,直到遇到这个工具,找到了回家的路!
- 低封控软件推荐!Instagram自动私信营销助手,Ins引流轻松搞定!
- Telegram批量私信营销软件,TG一键群发私信助手,电报群发私信软件
- Ins群发工具震撼发布,Instagram营销软件助你快速引流!
- 碧桂园服务2023年营收426.1亿元,受行业影响较小,第三方收入占比达历史新高
- WhatsApp协议号靠谱吗/ws频道号/ws劫持号/ws注册
- Ins/Instagram群发私信打粉软件推荐,ins好用的营销利器!
- 未来商战,风起云涌,我一名科技魔法师,手握WhatsApp拉群营销工具,决心打破次元,开创业务新境界。
- CSC3150代写、Java/C++程序语言代做
- Ins群发群控工具,Instagram多开云控群发,助你实现营销目标!
- 小区电动车安全整治,碧桂园服务在行动!
- 杭州威雅夏校:四大主题营联动英国威科姆阿贝夏校,释放夏日多巴胺!
- 世贸通美国投资移民:又一批EB5投资人在移民美国上I-829获批
- Telegram营销软件采集器,TG全自动群组采集软件,电报群成员采集利器
- 法规合规,信息有序! 跨境电商VB代拉群,保障您的品牌安全推广
- instagram外贸营销都在用的软件,ins最强营销引流群发助手
推荐
- 如何经营一家好企业,需要具备什么要素特点 我们大多数人刚开始创办一家企业都遇到经营 科技
- 智慧驱动 共创未来| 东芝硬盘创新数据存储技术 为期三天的第五届中国(昆明)南亚社会公共安 科技
- 苹果罕见大降价,华为的压力给到了? 1、苹果官网罕见大降价冲上热搜。原因是苹 科技
- 老杨第一次再度抓握住一瓶水,他由此产生了新的憧憬 瘫痪十四年后,老杨第一次再度抓握住一瓶水,他 科技
- 全力打造中国“创业之都”名片,第十届中国创业者大会将在郑州召开 北京创业科创科技中心主办的第十届中国创业 科技
- B站更新决策机构名单:共有 29 名掌权管理者,包括陈睿、徐逸、李旎、樊欣等人 1 月 15 日消息,据界面新闻,B站上周发布内部 科技
- 疫情期间 这个品牌实现了疯狂扩张 记得第一次喝瑞幸,还是2017年底去北京出差的 科技
- 创意驱动增长,Adobe护城河够深吗? Adobe通过其Creative Cloud订阅捆绑包具有 科技
- 丰田章男称未来依然需要内燃机 已经启动电动机新项目 尽管电动车在全球范围内持续崛起,但丰田章男 科技
- 升级的脉脉,正在以招聘业务铺开商业化版图 长久以来,求职信息流不对称、单向的信息传递 科技