elf-section-data-by-name ( elf: Elf32/64_Ehdr name: string -- header/f uchar-array/f )


Vocabulary
elf

Inputs
elfa Elf32/64_Ehdr
namea string


Outputs
header/fan object
uchar-array/fan object


Definition


TYPED:: elf-section-data-by-name
( elf: Elf32/64_Ehdr name: string -- header/f uchar-array/f )
elf elf-section-headers :> sections elf e_shstrndx>> :> ndx
elf ndx sections nth elf-section-data
>c-ptr :> section-names 1 sections [
sh_name>> section-names <displaced-alien>
ascii alien>string name =
] find-from nip
[ dup elf swap elf-section-data ] [ f f ] if* ;