elf.h

本文介绍了ELF可执行和链接格式的文件头和程序段头结构,包括ELF MAGIC定义、elfhdr结构的各个字段以及proghdr结构的详细解释,重点讨论了类型、地址、大小和标志等关键信息。
// http://en.wikipedia.org/wiki/Executable_and_Linkable_Format
// http://www.ouah.org/RevEng/x430.htm

// Format of an ELF executable file

#define ELF_MAGIC 0x464C457FU  // "\x7FELF" in little endian

// File header
struct elfhdr {
  uint magic;  // must equal ELF_MAGIC
  uchar elf[12];
  ushort type;  // 1, 2, 3, 4 specify whether the object is relocatable, executable, shared, or core, respectively
  ushort machine;  // Specifies target instruction set architecture.
  uint version;  // Set to 1 for the original version of ELF
  uint entry;  // This is the memory address of the entry point from where the process starts executing. This field is either 32 or 64 bits long depending on the format defined earlier
  uint phoff;  // Points to the start of the program header table. It usually follows the file header immediately making the offset 0x40 for 64-bit ELF executables
  uint shoff;  // Points to the start of the section header table
  uint flags;  // I
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值