void fuck_the_heap(){ int i; uint8_t *chunks[0x200]; int seed; int fd; fd = open("/dev/urandom", O_RDONLY); if(fd < 0){ exit(1); } if(read(fd, &seed, 4)!=4){ exit(1); } close(fd); srand(seed); for(i=0;i<0x100;i++){ chunks[i] = new uint8_t[rand() & 0xFF]; } for(i=0;i<0x100;i++){ if(rand() % 3 == 0){ delete[] chunks[i]; } chunks[i] = NULL; } seed = 0; }
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!