83 lines
3.1 KiB
Plaintext
83 lines
3.1 KiB
Plaintext
File: Common Object File Format (COFF)
|
|
|
|
About: COFF File Structure
|
|
|
|
(start code)
|
|
|
|
+-----------------------+
|
|
| |
|
|
| File Header |
|
|
| |
|
|
+-----------------------+----
|
|
| | \
|
|
| Optional File Header | | Only for executable file
|
|
| (a.out header) | /
|
|
+-----------------------+----
|
|
| | \
|
|
| Section Header 1 | |
|
|
| | |
|
|
+-----------------------+ |
|
|
. . | Section Headers
|
|
. . |
|
|
+-----------------------+ |
|
|
| | |
|
|
| Section Header n | |
|
|
| | /
|
|
+-----------------------+----
|
|
| | \
|
|
| Section 1 Raw Data | |
|
|
| | |
|
|
+-----------------------+ |
|
|
. . | Raw data
|
|
. . | (Executable Code and Initialized Data)
|
|
+-----------------------+ |
|
|
| | |
|
|
| Section n Raw Data | |
|
|
| | /
|
|
+-----------------------+----
|
|
| | \
|
|
| Section 1 Relocation | |
|
|
| Information | |
|
|
+-----------------------+ |
|
|
. . | Relocation
|
|
. . | Information
|
|
+-----------------------+ |
|
|
| | |
|
|
| Section n Relocation | |
|
|
| Information | /
|
|
+-----------------------+----
|
|
| |
|
|
| Symbol Table |
|
|
| |
|
|
+-----------------------+
|
|
| |
|
|
| String Table |
|
|
| |
|
|
+-----------------------+
|
|
|
|
(end)
|
|
|
|
|
|
About: File Header
|
|
|
|
| Type | Description |
|
|
|----------+---------------------------------|
|
|
| uint16_t | Version ID (~0x014c~ for i386) |
|
|
| uint16_t | Number of section headers |
|
|
| uint32_t | Timestamp |
|
|
| uint32_t | Symtab address |
|
|
| uint32_t | Number of entries in the symtab |
|
|
| uint16_t | Optional header size |
|
|
| uint16_t | Flags |
|
|
|
|
About: Optional Header
|
|
|
|
About: Section Header
|
|
|
|
About: Usefull links
|
|
|
|
- <https://wiki.osdev.org/COFF>
|
|
- <http://www.delorie.com/djgpp/doc/coff/filhdr.html>
|
|
- <Official Microsoft COFF Specification (2016) at https://web.archive.org/web/20230703150217/https%3A%2F%2Fdownload.microsoft.com%2Fdownload%2F9%2Fc%2F5%2F9c5b2167-8017-4bae-9fde-d599bac8184a%2Fpecoff_v83.docx>
|
|
- <UNIX System V/386 Release 3.2 Programmer's Guide, Volume II at http://bitsavers.org/pdf/att/unix/System_V_386_Release_3.2/UNIX_System_V_386_Release_3.2_Programmers_Guide_Vol2_1989.pdf>
|