공부 썸네일형 리스트형 malloc chunk 우리가 malloc 등을 통해 메모리를 할당할 경우, 아래와 같은 청크가 하나 할당되는거랑 똑같습니다. [이전의 청크 크기(할당된 경우)][현재 청크 크기][P][메모리 영역]다음 청크.. 만약 할당 해제를 시키면 청크는 어떻게 변할까요? free()를 통해 할당을 해제시키면.. [이전 청크 크기][현재 청크 크기][P][다음 청크의 포인터][이전 청크의 포인터][미사용 영역]다음 청크... malloc.c에 정의되어있는 구조는 다음과 같습니다. --malloc.c #malloc 자료구조/* Type declarations*/struct malloc_chunk{ INTERNAL_SIZE_T prev_size; /* Size of previous chunk (if free). */ INTERNAL_SIZE.. 더보기 힙 힙 설명은 정말 별거없지만상기시킬겸 유저영역과 커널영역을 다시 보기로 함.일단 간단간단하게 핵심만 설명하자면.. 0xFFFFFFFF (high)kernel section-----------------------[stack section][shared library section][heap section][(uninitialized)data section][(initialized)data section][code section]0x00000000 (low) 뭐 이렇게 생겼다고 한다. 코드영역은 말 그대로 프로그램 실행되면 opcode 올라가는 곳이고.. 데이터 영역은 전역변수나 static같은 변수들이 할당됨여기는 시작과 동시에 할당되고 프로그램이 종료가 되야 소멸함. 힙 영역은 malloc이나 callo.. 더보기 dynamic linker dynamic linker의 내부 구조https://web.archive.org/web/20081215162517/http://x82.inetcop.org/h0me/papers/FC_exploit/relocation.txt dynamic section 덮어쓰기를 이용한 exphttp://pwn3r.tistory.com/entry/Docs-Reusing-Dynamic-Linker-for-Exploitation _dl_runtime_resolver의 함수 정보 조작을 통한 exphttp://gooverto.tistory.com/entry/Return-To-DL-Exploitation 더보기 vdso What is linux-gate.so.1? - by Johan Petersson 요즘 linux desktop에서 ldd를 때려보면 linux-gate.so.1이라는 파일이 보인다. [tolkien@tolkien tmp]$ ldd /bin/ls linux-gate.so.1 => (0xb7f84000) librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb7f66000) libselinux.so.1 => /lib/libselinux.so.1 (0xb7f4d000) libacl.so.1 => /lib/libacl.so.1 (0xb7f45000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7df6000) libpthread.so.0 =>.. 더보기 함수 호출 과정, PLT와 GOT 리눅스 함수 호출 과정이 어떻게 될까? 간단한 printf 함수로 테스트를 해봤습니다. #include int main(){ printf("test~~~"); }다음 프로그램을 작성 후 gdb로 까보면.. (gdb) disas mainDump of assembler code for function main: 0x0804841b :lea ecx,[esp+0x4] 0x0804841f :and esp,0xfffffff0 0x08048422 :push DWORD PTR [ecx-0x4] 0x08048425 :push ebp 0x08048426 :mov ebp,esp 0x08048428 :push ecx 0x08048429 :sub esp,0x4 0x0804842c :sub esp,0xc 0x0804842f :p.. 더보기 syscall 목록 http://docs.cs.up.ac.za/programming/asm/derick_tut/syscalls.html 더보기 이전 1 2 다음