Class: Rex::ElfParsey::ElfBase
- Inherits:
-
Object
- Object
- Rex::ElfParsey::ElfBase
- Defined in:
- lib/rex/elfparsey/elfbase.rb
Direct Known Subclasses
Defined Under Namespace
Classes: ElfHeader, GenericHeader, GenericStruct, ProgramHeader
Constant Summary collapse
- ELF_HEADER_SIZE =
ELF Header
52- EI_NIDENT =
16- ELF32_EHDR_LSB =
Rex::Struct2::CStructTemplate.new( [ 'string', 'e_ident', EI_NIDENT, '' ], [ 'uint16v', 'e_type', 0 ], [ 'uint16v', 'e_machine', 0 ], [ 'uint32v', 'e_version', 0 ], [ 'uint32v', 'e_entry', 0 ], [ 'uint32v', 'e_phoff', 0 ], [ 'uint32v', 'e_shoff', 0 ], [ 'uint32v', 'e_flags', 0 ], [ 'uint16v', 'e_ehsize', 0 ], [ 'uint16v', 'e_phentsize', 0 ], [ 'uint16v', 'e_phnum', 0 ], [ 'uint16v', 'e_shentsize', 0 ], [ 'uint16v', 'e_shnum', 0 ], [ 'uint16v', 'e_shstrndx', 0 ] )
- ELF32_EHDR_MSB =
Rex::Struct2::CStructTemplate.new( [ 'string', 'e_ident', EI_NIDENT, '' ], [ 'uint16n', 'e_type', 0 ], [ 'uint16n', 'e_machine', 0 ], [ 'uint32n', 'e_version', 0 ], [ 'uint32n', 'e_entry', 0 ], [ 'uint32n', 'e_phoff', 0 ], [ 'uint32n', 'e_shoff', 0 ], [ 'uint32n', 'e_flags', 0 ], [ 'uint16n', 'e_ehsize', 0 ], [ 'uint16n', 'e_phentsize', 0 ], [ 'uint16n', 'e_phnum', 0 ], [ 'uint16n', 'e_shentsize', 0 ], [ 'uint16n', 'e_shnum', 0 ], [ 'uint16n', 'e_shstrndx', 0 ] )
- ET_NONE =
e_type This member identifies the object file type
0- ET_REL =
No file type
1- ET_EXEC =
Relocatable file
2- ET_DYN =
Executable file
3- ET_CORE =
Shared object file
4- ET_LOPROC =
Core file
0xff00- ET_HIPROC =
Processor-specific
0xffff- EM_M32 =
ET_NONE = 0 # No machine
1- EM_SPARC =
AT&T WE 32100
2- EM_386 =
SPARC
3- EM_68K =
Intel Architecture
4- EM_88K =
Motorola 68000
5- EM_860 =
Motorola 88000
7- EM_MIPS =
Intel 80860
8- EM_MIPS_RS4_BE =
MIPS RS3000 Big-Endian
10- EV_NONE =
e_version This member identifies the object file version
0- EV_CURRENT =
Invalid version
1- EI_MAG0 =
e_ident[] Identification indexes
0- EI_MAG1 =
File identification
1- EI_MAG2 =
File identification
2- EI_MAG3 =
File identification
3- EI_CLASS =
File identification
4- EI_DATA =
File class
5- EI_VERSION =
Data encoding
6- EI_PAD =
File version
7- ELFMAG0 =
EI_MAG0 to EI_MAG3 A file’s first 4 bytes hold a “magic number”, identifying the file as an ELF object file.
0x7f- ELFMAG1 =
?E- ELFMAG2 =
?L- ELFMAG3 =
?F- ELFMAG =
ELFMAG0.chr + ELFMAG1.chr + ELFMAG2.chr + ELFMAG3.chr
- ELFCLASSNONE =
EI_CLASS Identifies the file’s class, or capacity
0- ELFCLASS32 =
Invalid class
1- ELFCLASS64 =
32-bit objects
2- ELFDATANONE =
EI_DATA Specifies the data encoding of the processor-specific data in the object file. The following encodings are currently defined.
0- ELFDATA2LSB =
Invalid data encoding
1- ELFDATA2MSB =
Least significant byte first
2- PROGRAM_HEADER_SIZE =
Program Header
32- ELF32_PHDR_LSB =
Rex::Struct2::CStructTemplate.new( [ 'uint32v', 'p_type', 0 ], [ 'uint32v', 'p_offset', 0 ], [ 'uint32v', 'p_vaddr', 0 ], [ 'uint32v', 'p_paddr', 0 ], [ 'uint32v', 'p_filesz', 0 ], [ 'uint32v', 'p_memsz', 0 ], [ 'uint32v', 'p_flags', 0 ], [ 'uint32v', 'p_align', 0 ] )
- ELF32_PHDR_MSB =
Rex::Struct2::CStructTemplate.new( [ 'uint32n', 'p_type', 0 ], [ 'uint32n', 'p_offset', 0 ], [ 'uint32n', 'p_vaddr', 0 ], [ 'uint32n', 'p_paddr', 0 ], [ 'uint32n', 'p_filesz', 0 ], [ 'uint32n', 'p_memsz', 0 ], [ 'uint32n', 'p_flags', 0 ], [ 'uint32n', 'p_align', 0 ] )
- PF_EXEC =
Flags
1- PF_WRITE =
2- PF_READ =
4- PT_NULL =
Segment Types
0- PT_LOAD =
1- PT_DYNAMIC =
2- PT_INTERP =
3- PT_NOTE =
4- PT_SHLIB =
5- PT_PHDR =
6- PT_LOPROC =
0x70000000- PT_HIPROC =
0x7fffffff