elflib
Version:
ELF file reader and writer
61 lines (60 loc) • 3.03 kB
TypeScript
import { uint8, uint16, uint32, uint64 } from './primitive.js';
import { Structs } from './structs.js';
import * as Enums from './enums.js';
export declare class Header extends Structs.Header {
constructor();
/** The architecture of the ELF file, either 32 or 64 bits. */
get class(): Enums.Class;
/** The endianness of the data in the ELF file. */
get endian(): Enums.Endian;
/** The version of the ELF file. There is currently only one version. */
get version(): Enums.Version;
/** The ABI (Application Binary Interface) of this ELF file. This is typically not used and set to SystemV. */
get abi(): Enums.ABI;
/** The ABI version. This is ABI specific data but is generally not used. */
get abiVersion(): uint8;
/** The type of ELF file this is (e.g. executable, object file, shared library). */
get type(): Enums.Type;
/** The ISA (Instruction Set Architecture) for this ELF file. This corresponds to the type of processor this ELF file is for
* and does not necessarily include the entire specification of the ISA. isaVersion and flags may contain more information. */
get isa(): Enums.ISA;
/** The version of ISA used. The interpretation of version is ISA specific. */
get isaVersion(): uint32;
/** The virtual address of the entry point. */
get entryPoint(): uint32 | uint64;
/** Offset in the ELF file of the first program header entry. */
get programHeadersOffset(): uint32;
/** Offset in the ELF file of the first section header entry. */
get sectionHeadersOffset(): uint32;
/** Flags for the ISA used. The interpretation is ISA specific. */
get flags(): uint32;
/** The size of 1 program header entry. */
get programHeadersEntrySize(): uint16;
/** The total number of program header entries in the file. */
get programHeadersEntryCount(): uint16;
/** The size of 1 section header entry. */
get sectionHeadersEntrySize(): uint16;
/** The total number of section header entries in the file. */
get sectionHeadersEntryCount(): uint16;
/** The section index for the section headers string table (if any). */
get shstrIndex(): uint16;
get bits(): 32 | 64;
set class(_class: Enums.Class);
set endian(endian: Enums.Endian);
set version(version: Enums.Version);
set abi(abi: Enums.ABI);
set abiVersion(abiVersion: uint8);
set type(type: Enums.Type);
set isa(isa: Enums.ISA);
set isaVersion(isaVersion: uint32);
set entryPoint(entryPoint: uint32 | uint64);
set programHeadersOffset(programHeadersOffset: uint32);
set sectionHeadersOffset(sectionHeadersOffset: uint32);
set flags(flags: uint32);
set programHeadersEntrySize(programHeadersEntrySize: uint16);
set programHeadersEntryCount(programHeadersEntryCount: uint16);
set sectionHeadersEntrySize(sectionHeadersEntrySize: uint16);
set sectionHeadersEntryCount(sectionHeadersEntryCount: uint16);
set shstrIndex(shstrIndex: uint16);
set bits(bits: 32 | 64);
}