ctfwiki
Angelki
相信自己一定可以的!
展开
-
ctfwiki笔记--Linux堆基础
参考链接:https://ctf-wiki.github.io/ctf-wiki/pwn/linux/glibc-heap/heap_overview/#_51、Linux在内存分配与使用的过程中,核心思想是:只有当真正访问一个地址的时候,系统才会建立虚拟页面与物理页面的映射关系。所以虽然操作系统已经给程序分配了很大的内存空间,但是这块内存其实只是虚拟内存。只有当用户使用相应的内存时,系统才会真...原创 2019-04-30 17:06:01 · 2677 阅读 · 1 评论 -
ctfwiki笔记--Linux堆相关结构
引言:由malloc申请的内存称为chunk。这块内存在ptmalloc内部用malloc_chunk结构体表示。当程序申请的chunk被free后,会被加入到相应的空闲管理列表中。(1)无论一个chunk大小如何,分配还是空闲,都是用一个统一的结构malloc_chunk结构表示:/* This struct declaration is misleading (but accurat...转载 2019-06-13 21:51:32 · 750 阅读 · 0 评论 -
ctfwiki--arena
arena无论是主线程还是新创建的线程,在第一次申请内存时,都会有独立的arena。对于不同的系统,arena 的数量如下:For 32 bit systems: Number of arena = 2 * number of cores.For 64 bit systems: Number of arena = 8 * number of cores.显然并不是每...转载 2019-06-20 15:03:16 · 520 阅读 · 0 评论 -
ctfwiki--堆的基础操作
参考链接:https://ctf-wiki.github.io/ctf-wiki/pwn/linux/glibc-heap/implementation/basic-zh/#__comments堆的基础操作unlinkunlink 用来将一个双向链表(只存储空闲的 chunk)中的一个元素取出来,可能在其他地方使用。(1)malloc从恰好合适的 large bin 中获取 chunk...转载 2019-06-20 15:40:30 · 2027 阅读 · 0 评论 -
ctfwiki--堆初始化
参考链接:https://ctf-wiki.github.io/ctf-wiki/pwn/linux/glibc-heap/implementation/malloc_state-zh/堆的初始化堆初始化是在用户第一次申请内存执行 malloc_consolidate 再执行 malloc_init_state 实现的。可以参考malloc_state相关函数。malloc_init_sta...转载 2019-06-20 15:59:40 · 649 阅读 · 1 评论