์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- ํ๋ก์ด๋์์
- ๊ทธ๋ฆฌ๋ ์๊ณ ๋ฆฌ์ฆ
- ๋น์ฃผ๊ธฐ์ ํธ
- ํ๋ ์ ๊ตฌ์กฐ
- ์ฐ๋ถํฌdb
- tcp ์ธ๊ทธ๋จผํธ
- til
- well known ํฌํธ
- tcp ํ๋กํ ์ฝ
- ์ค๋ธ์
- ํฐ์คํ ๋ฆฌ์ฑ๋ฆฐ์ง
- i-type
- ํ ํฐ ๋ฒ์ค
- IEEE 802
- xv6
- ์ฃผ๊ธฐ์ ํธ
- ์๋น์ค ํ๋ฆฌ๋ฏธํฐ๋ธ
- ๋ฐ์ดํฐ ์ ์ก
- ์ค๋ ๋
- ์ค๋ฅ๊ฒ์ถ
- ์ฝ๋ฉํ ์คํธ์ค๋น
- 99ํด๋ฝ
- ํญํด99
- mariadb
- leetcode
- ๊ฐ๋ฐ์์ทจ์
- ์ค๋ฅ์ ์ด
- ์์๋ฒํธ
- git merge
- reducible
- Today
- Total
Unfazedโ๏ธ๐ฏ
The ELF (Executable and Linkable Format) and PE (Portable Executable) formats/ ELF ํ์ผ, PE ํฌ๋งท? ๋ณธ๋ฌธ
The ELF (Executable and Linkable Format) and PE (Portable Executable) formats/ ELF ํ์ผ, PE ํฌ๋งท?
9taetae9 2023. 9. 16. 22:41The ELF (Executable and Linkable Format) and PE (Portable Executable) formats are two of the most common file formats for executables, shared libraries, and even some object files on various computer systems. They each serve to allow the OS and loader to understand how to execute and link the code they contain.
Brief overview of each:
ELF (Executable and Linkable Format):
Usage: Primarily used in Unix-like systems such as Linux, BSD, and Solaris.
Sections: Contains several sections that hold the executable code, debugging information, program data, relocation information, and more. Common sections include .text (executable code), .data (initialized data), and .bss (uninitialized data).
Header: Every ELF file starts with a file header that describes the file's format, machine architecture, entry point, and offsets to other sections.
Dynamic Linking: ELF supports both static and dynamic linking. Dynamic linking is managed through sections like .dynsym, .dynstr, .got, and .plt.
Extensibility: The format is designed to be extensible and is used on various architectures including x86, x86-64, ARM, and many others.
ELF(Executable and Linkable Format)๋ ์คํ ํ์ผ, ๋ชฉ์ ํ์ผ, ๊ณต์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ทธ๋ฆฌ๊ณ ์ฝ์ด ๋คํ๋ฅผ ์ํ ํ์ค ํ์ผ ํ์์ด๋ค. 1999๋ 86open ํ๋ก์ ํธ์ ์ํด x86 ๊ธฐ๋ฐ ์ ๋์ค, ์ ๋์ค ๊ณ์ด ์์คํ ๋ค์ ํ์ค ๋ฐ์ด๋๋ฆฌ ํ์ผ ํ์์ผ๋ก ์ ํ๋์๋ค.
๊ฐ ELF ํ์ผ์ ํ๋์ ELF ํค๋์ ํ์ผ ๋ฐ์ดํฐ๋ก ์ด๋ฃจ์ด์ง๋ค. ํ์ผ ๋ฐ์ดํฐ๋ ๋ค์์ ํฌํจํ๋ค.
- 0๊ฐ ๋๋ ๊ทธ ์ด์์ ์ธ๊ทธ๋จผํธ๋ค์ ์ ์ํ๋ ํ๋ก๊ทธ๋จ ํค๋ ํ ์ด๋ธ
- 0๊ฐ ๋๋ ๊ทธ ์ด์์ ์น์ ๋ค์ ์ ์ํ๋ ์น์ ํค๋ ํ ์ด๋ธ
- ํ๋ก๊ทธ๋จ ํค๋ ํ ์ด๋ธ ๋๋ ์น์ ํค๋ ํ ์ด๋ธ์ ์ํธ๋ฆฌ๋ค์ ์ํด ์ฐธ์กฐ๋๋ ๋ฐ์ดํฐ
์น์ ๋ค์ด ๋งํน๊ณผ ์ฌ๋ฐฐ์น์ ํ์ํ ์ค์ํ ์ ๋ณด๋ฅผ ํฌํจํ๋ ๋ฐ๋ฉด, ์ธ๊ทธ๋จผํธ๋ค์ ํ์ผ์ ๋ฐํ์ ์คํ์ ํ์ํ ์ ๋ณด๋ฅผ ํฌํจํ๋ค. ์ ์ฒด ํ์ผ์ ์ด๋ค ๋ฐ์ดํธ๋ ์ต๋ ํ ๊ฐ์ ์น์ ์ ์ํด ์์ ๋ ์ ์์ผ๋ฉฐ ์ด๋ ํ ์น์ ์ ์ํด์๋ ์์ ๋์ง ์์ ๊ณ ์ ๋ฐ์ดํธ๋ค์ด ์กด์ฌํ ์ ์๋ค.
ELF ํ์ผ์ ๊ตฌ์กฐ
PE (Portable Executable):
Usage: Primarily used on Windows operating systems for EXE, DLL (Dynamic Link Libraries), and some object files.
Structure: PE format is derived from the older COFF (Common Object File Format). A PE file consists of a DOS header, PE signature, COFF header, optional header, and one or more sections.
Sections: Just like ELF, PE contains various sections that house executable code, data, and other resources. Examples include .text (executable code), .data (initialized data), .rdata (read-only data), and .idata (import directory table).
Header: Contains information about the file's size, location of entry point, image base (preferred loading address), and various other characteristics.
Dynamic Linking: Supports dynamic linking through import and export tables. The Import Address Table (IAT) is used to resolve function addresses at runtime.
Extensibility: PE files support various architectures, but the most common are x86 and x86-64. Windows on ARM also uses a variant of PE.
PE ํฌ๋งท(Portable Executable)์ ์๋์ฐ ์ด์ ์ฒด์ ์์ ์ฌ์ฉ๋๋ ์คํ ํ์ผ, DLL, object ์ฝ๋, FON ํฐํธ ํ์ผ ๋ฑ์ ์ํ ํ์ผ ํ์์ด๋ค. PE ํฌ๋งท์ ์๋์ฐ ๋ก๋๊ฐ ์คํ ๊ฐ๋ฅํ ์ฝ๋๋ฅผ ๊ด๋ฆฌํ๋๋ฐ ํ์ํ ์ ๋ณด๋ฅผ ์บก์ํํ ๋ฐ์ดํฐ ๊ตฌ์กฐ์ฒด์ด๋ค. ์ด๊ฒ์ ๋งํน์ ์ํ ๋์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฐธ์กฐ, API ์ต์คํฌํธ์ ์ํฌํธ ํ ์ด๋ธ, ์์ ๊ด๋ฆฌ ๋ฐ์ดํฐ ๊ทธ๋ฆฌ๊ณ TLS ๋ฐ์ดํฐ๋ฅผ ํฌํจํ๋ค. ์๋์ฐ NT ์ด์์ฒด์ ์์, PE ํฌ๋งท์ EXE, DLL, SYS (Device driver), ๊ทธ๋ฆฌ๊ณ ๋ค๋ฅธ ํ์ผ ์ข ๋ฅ๋ค์์ ์ฐ์ธ๋ค.
In summary, while ELF and PE serve the same general purposes, they have different structures and are used on different operating systems. Familiarity with these formats can be invaluable when working in systems programming, reverse engineering, or cybersecurity fields.
์ฐธ๊ณ ์ํค๋ฐฑ๊ณผ :
https://ko.wikipedia.org/wiki/ELF_%ED%8C%8C%EC%9D%BC_%ED%98%95%EC%8B%9D
https://ko.wikipedia.org/wiki/PE_%ED%8F%AC%EB%A7%B7
๋ค์๊ธ : https://9taetae9.tistory.com/3
'Operating System (์ด์์ฒด์ )' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
๋ฉํฐ์ค๋ ๋ฉ, ์ปจํ ์คํธ ์ค์์น, ์ค์ผ์ค๋ง, ํ๋ก์ธ์ค vs ์ค๋ ๋ (0) | 2025.02.06 |
---|---|
์ค๋ ๋ ์์ ์ฑ Thread Safety (0) | 2024.01.29 |
ํ์ด๋จธ ์ธํฐ๋ฝํธ(timer interrupt) ๋ฐ์ ์ฃผ๊ธฐ?/ tick interrupt, timer interrupt (+ xv6 ) (0) | 2023.10.18 |
ํ๋ก๊ทธ๋จ๊ณผ ํ๋ก์ธ์ค์ ์ฐจ์ด/(feat. ์์คํ ์ฝ) (0) | 2023.10.16 |
ELF ํ์ผ? ELF ํค๋? (0) | 2023.09.16 |