how2heap-2.23-02-fastbin_dup_into_stack

发布于:2024-01-05 ⋅ 阅读:(149) ⋅ 点赞:(0)
试读部分
fastbin_dup_into_stack和fastbin_dup没啥区别 https://blog.csdn.net/u014679440/article/details/135383465 仅仅是欲修改的位置,在栈中 #include <stdio.h> #include <stdlib.h> int main() { fprintf(stderr, "This file extends on fastbin_dup.c by tricking malloc into\n" "returning a pointer to a controlled location (in this case, the stack).\n"); unsigned long long stack_var; fprintf(stderr, "The address we want malloc() to return is %p.\n", 8+(char *)&stack_var); fprintf(stderr, "Allocating 3 buffers.\n"); int *a = malloc(8); int *b = malloc(8); int *c = malloc(8); fprintf(stderr, "1st malloc(8): %p\n", a); fprintf(stderr, "2nd malloc(8): %p\n", b); fprintf(stderr, "3rd malloc(8): %p\n", c); fprintf(stderr, "Freeing the first one...\n"); free(a); fprintf(stderr, "If we free %p again, thin……
本文为 VIP 文章,已展示部分内容,开通 VIP 后查看全文

觉得这篇文章有帮助?

点个赞,或赞赏支持作者持续创作

微信公众号

今日签到

点亮在社区的每一天
去签到