
csapp
hazel1313
这个作者很懒,什么都没留下…
展开
-
【深入理解计算机系统csapp lab】malloc lab
做malloclab首先要熟悉课本9.9的内容,尤其是9.9.12,如果不知道从哪里入手,可以和我一样,从实现课本介绍的简单分配器开始,然后在这个基础上改编。试验后最终采取的是隐式空闲链表+分离的显式空闲链表,分离存储的块大小为{16-32},{33-64},{65-128}···,空闲块在链表中按从小到大排列,这样首次匹配的结果接近最佳匹配。mm.h在这里插入代码片...原创 2021-02-10 21:48:38 · 2342 阅读 · 0 评论 -
【深入理解计算机系统csapp lab】shell lab
/* * eval - Evaluate the command line that the user has just typed in * * If the user has requested a built-in command (quit, jobs, bg or fg) * then execute it immediately. Otherwise, fork a child process and * run the job in the context of the child.原创 2020-11-19 20:29:23 · 722 阅读 · 0 评论 -
【深入理解计算机系统csapp lab】cachelab
Part A:#include <stdio.h>#include <unistd.h>#include <getopt.h>#include <string.h>#include <stdlib.h>#include <math.h>#include <limits.h>#include "cachelab.h"typedef enum{false,true} bool;typedef struct原创 2020-11-19 20:27:45 · 503 阅读 · 0 评论 -
【深入理解计算机系统csapp lab】attacklab
Attack labAttack lab的handout写的非常详细,容易上手。一共分为两部分:第一部分是code injection attack,有3个phase;第二部分是return-oriented programming,需要在已有的程序里找需要执行的指令来完成整个程序,有2个phase。Phase 1:在这部分需要做的工作很简单,利用缓存区溢出,把位于getbuf栈帧底部的返回地址改为函数touch1的地址即可。在反汇编的代码中找到getbuf函数:00000000004017a8原创 2020-11-19 20:17:16 · 1290 阅读 · 0 评论 -
【深入理解计算机系统csapp lab】bomblab
bomblab一共有六关,每一关都需要输入正确的密码首先打开bomb.c文件,看到main函数主要有6个phase,每一关大概都是这样的:input = read_line(); /* Get input */phase_1(input); /* Run the phase */phase_defused(); /* Drat! They fig原创 2020-11-09 11:22:36 · 2412 阅读 · 0 评论