[glibc] tcache malloc.c 분석 포스트에 모든 내용을 담기 어려울 것 같아서 내용을 분리했다. tcache는 libc의 전역변수가 아니라 heap에 malloc으로 공간을 할당받은 구조체에서 관리한다. (malloc.c 분석 참고) tcache malloc(0x10) 부터 malloc(0x40) 까지 호출하고, 각 chunk를 모두 free하면 아래와 같이 tcache의 count와 entries 필드에 정보가 추가된 것을 볼 수 있다. Initialize stdio heap space malloc: 0x224a6b0 (size = 0x20) malloc: 0x224a6d0 (size = 0x30) malloc: 0x224a700 (size = 0x40) malloc: 0x224a740 (size = 0x50) f.. Pwn_Others/Concepts 5년 전
[glibc] struct _IO_FILE - glibc 2.29 > struct _IO_FILE 구조체는 /libio/bits/types/struct_FILE.h에 정의되어 있다. 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 struct _IO_FILE { int _flags; /* High-order word is _IO_MAGIC; rest is flags. */ /* The following pointers correspond to the C++ streambuf protocol. */ char *_IO_read_.. Pwn_Others/Concepts 5년 전