오브의 빛나는 별

2부 13장 PE File Format(5) 본문

리버싱

2부 13장 PE File Format(5)

오브의 별 2022. 4. 24. 19:36
반응형

안녕하세요, 오브입니다.

오늘은 섹션 헤더에 대해 살펴보겠습니다.

https://staraube.tistory.com/51?category=548043

 

2부 13장 PE File Format(1)

안녕하세요, 오브입니다. 오늘은 PE 파일의 기본구조와 VA, RVA에 대해 알아보겠습니다. PE File Format 13.1. 소개 PE 파일: Windows 운영체제에서 사용되는 실행 파일 형식. 기존 UNIX에서 사용되는 COFF 기

staraube.tistory.com

https://staraube.tistory.com/52

 

2부 13장 PE File Format(2)

안녕하세요, 오브입니다. 오늘은 PE 헤더의 많은 구조체 중 DOS Header와 DOS Stub에 대해 알아보겠습니다. https://staraube.tistory.com/51?category=548043 PE File Format 13.3. PE 헤더 13.3.1. DOS Header D..

staraube.tistory.com

https://staraube.tistory.com/53

 

2부 13장 PE File Format(3)

안녕하세요, 오브입니다. 오늘은 NT Header에 대해 알아보겠습니다. https://staraube.tistory.com/51?category=548043 https://staraube.tistory.com/52?category=548043 PE File Format 13.3.3. NT Header NT he..

staraube.tistory.com

https://staraube.tistory.com/54

 

2부 13장 PE File Format(4)

안녕하세요, 오브입니다. 오늘은 NT Header의 Optional Header에 대해 알아보겠습니다. https://staraube.tistory.com/51?category=548043 2부 13장 PE File Format(1) 안녕하세요, 오브입니다. 오늘은 PE 파일의..

staraube.tistory.com

 

 

PE File Format
  • 섹션 헤더: 각 섹션의 속성을 정의
  • PE 파일은 code, data, resource 등 각각의 섹션으로 나눠서 저장
  • PE 파일을 여러 개의 섹션 구조로 만들었을 때 장점
    • 프로그램 안정성
  • overflow 발생 시 다음 code를 덮어서 프로그램 망가짐

⇒ 비슷한 성격의 자료를 섹션이라고 하여 모아둠. 각각의 섹션 속성을 기술할 섹션 헤더 필요

  • code/data/resource 마다 각각의 특성, 접근 권한 등 다르게 설정
종류 액세스 권한
code 실행, 읽기 권한
data 비실행, 읽기, 쓰기 권한
resource 비실행, 읽기 권한

 

IMAGE_SECTION_HEADER 중요 멤버

항목 의미
VirtualSize 메모리에서 섹션이 차지하는 크기
VirtualAddress VirtualAddress
SizeOfRawData 파일에서 섹션이 차지하는 크기
PointerToRawData 파일에서 섹션의 시작 위치
Characteristics 섹션의 속성
  • SectionAlignment와 FileAlignment에 맞게 결정
  • VirtualSize와 SizeOfRawData는 서로 다른 값. 즉, 파일에서의 섹션 크기와 메모리에 로딩된 섹션의 크기는 다름
  • Characteristics는 bit OR로 이루어짐
  • Name 멤버는 C언어 문자열처럼 NULL로 끝나지 않음. ASCII 값만 안와도 됨
  • 파일에서의 PE와 메모리에서의 PE는 서로 다른 모양을 가짐. 이를 구별하기 위해 메모리에 로딩된 상태를 이미지라는 용어로 구별
반응형

'리버싱' 카테고리의 다른 글

2부 13장 PE File Format(실습1)-32bits  (0) 2022.05.14
2부 13장 PE File Format(4)  (0) 2022.04.24
2부 13장 PE File Format(3)  (0) 2022.04.24
2부 13장 PE File Format(2)  (0) 2022.04.23
2부 13장 PE File Format(1)  (0) 2022.04.23