ELF_RAWFILE(3) Libelf Programmer's Manual ELF_RAWFILE(3) NAME elf_rawfile - Retrieve a pointer to the entire raw ELF file image SYNOPSIS #include char *elf_rawfile(Elf *elf, size_t *ptr); DESCRIPTION The elf_rawfile() function returns a pointer to the entire contents of the ELF file represented by elf. This data is unprocessed and includes every- thing from the ELF header to the final byte. If the ELF descriptor was opened from memory or the file has already been memory-mapped or fully read, this function returns a pointer to the inter- nal buffer. If the ELF data has not yet been read or mapped, it is loaded on demand. If ptr is non-NULL, the total size in bytes of the raw file is stored in *ptr. The returned buffer is read-only and managed internally by libelf. The ap- plication must not modify or free it. PARAMETERS elf A handle previously returned by elf_begin(3). ptr If not NULL, receives the size in bytes of the ELF file. RETURN VALUE Returns a pointer to the start of the ELF file data. On failure, NULL is returned and *ptr (if non-NULL) is set to 0. SEE ALSO libelf(3), elf(5) ATTRIBUTES allbox; lbx lb lb l l l. Interface Attribute Value T{ elf_rawfile() T} Thread safety MT-Safe REPORTING BUGS Report bugs to or https://source- ware.org/bugzilla/. Libelf 2025-06-30 ELF_RAWFILE(3)