#include <stdlib.h>
int a = 0xa;
const char b[] = "d_str";
int c;
int foo(int arg){
int d = 0xd;
return 0;
}
int main(){
int *e = malloc(sizeof(*e));
return 0;
}
문제 1. e는 어느 세그먼트의 데이터를 가리키는가?
답: 힙
문제 2. foo가 위치하는 세그먼트는 어디인가?
답: 코드
문제 3. a가 위치하는 세그먼트는 어디인가?
답: 데이터
문제 4. b가 위치하는 세그먼트는 어디인가?
답: 읽기 전용 데이터 (rodata)
문제 5. c가 위치하는 세그먼트는 어디인가?
답: BSS
문제 6. "d_str"이 위치하는 세그먼트는 어디인가?
답: 읽기 전용 데이터 (rodata)
문제 7. d가 위치하는 세그먼트는 어디인가?
답: 스택
728x90
'문제 풀이 > [DreamHack]' 카테고리의 다른 글
[DreamHack] SystemHacking Stage2 - x86 Assembly: Essential Part 1 (0) | 2022.12.20 |
---|---|
[DreamHack] SystemHacking Stage2 - Quiz: Computer Architecture (0) | 2022.12.19 |
[DreamHack] SystemHacking Stage2 - Background: Computer Architecture (0) | 2022.12.19 |
[DreamHack] System Hacking Stage2 - Background: Linux Memory Layout (0) | 2022.12.19 |
[DreamHack] System Hacking - STAGE 1 리눅스 환경 구축 (0) | 2022.12.19 |