package linksem

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

elf_note contains data types and functions for interpreting the .note * section/segment of an ELF file, and extracting information from that * section/segment.

type elf32_note = {
  1. elf32_note_namesz : Uint32_wrapper.uint32;
    (*

    The size of the name field.

    *)
  2. elf32_note_descsz : Uint32_wrapper.uint32;
    (*

    The size of the description field.

    *)
  3. elf32_note_type : Uint32_wrapper.uint32;
    (*

    The type of the note.

    *)
  4. elf32_note_name : Byte_sequence.byte_sequence0;
    (*

    The byte sequence corresponding to the name string.

    *)
  5. elf32_note_desc : Byte_sequence.byte_sequence0;
    (*

    The byte sequence corresponding to the desc string.

    *)
}

elf32_note represents the contents of a .note section or segment.

type elf64_note = {
  1. elf64_note_namesz : Uint32_wrapper.uint32;
    (*

    The size of the name field.

    *)
  2. elf64_note_descsz : Uint32_wrapper.uint32;
    (*

    The size of the description field.

    *)
  3. elf64_note_type : Uint32_wrapper.uint32;
    (*

    The type of the note.

    *)
  4. elf64_note_name : Byte_sequence.byte_sequence0;
    (*

    The byte sequence corresponding to the name string.

    *)
  5. elf64_note_desc : Byte_sequence.byte_sequence0;
    (*

    The byte sequence corresponding to the desc string.

    *)
}

elf64_note represents the contents of a .note section or segment.

val nt_prstatus : Nat_big_num.num

Contains copy of prstatus struct

val nt_fpregset : Nat_big_num.num

Contains copy of prstatus struct

Contains copy of fpregset struct

val nt_prpsinfo : Nat_big_num.num

Contains copy of fpregset struct

Contains copy of prpsinfo struct

val nt_prxreg : Nat_big_num.num

Contains copy of prpsinfo struct

Contains copy of prxregset struct

val nt_taskstruct : Nat_big_num.num

Contains copy of prxregset struct

Contains copy of task structure

val nt_platform : Nat_big_num.num

Contains copy of task structure

String from sysinfo(SI_PLATFORM)

val nt_auxv : Nat_big_num.num

String from sysinfo(SI_PLATFORM)

Contains copy of auxv array

val nt_gwindows : Nat_big_num.num

Contains copy of auxv array

Contains copy of gwindows struct

val nt_asrs : Nat_big_num.num

Contains copy of gwindows struct

Contains copy of asrset struct

val nt_pstatus : Nat_big_num.num

Contains copy of asrset struct

Contains copy of pstatus struct

val nt_psinfo : Nat_big_num.num

Contains copy of pstatus struct

Contains copy of psinfo struct

val nt_prcred : Nat_big_num.num

Contains copy of psinfo struct

Contains copy of prcred struct

val nt_utsname : Nat_big_num.num

Contains copy of prcred struct

Contains copy of utsname struct

val nt_lwpstatus : Nat_big_num.num

Contains copy of utsname struct

Contains copy of lwpstatus struct

val nt_lwpsinfo : Nat_big_num.num

Contains copy of lwpstatus struct

Contains copy of lwpinfo struct

val nt_prfpxreg : Nat_big_num.num

Contains copy of lwpinfo struct

Contains copy of fprxregset struct

val nt_siginfo : Nat_big_num.num

Contains copy of fprxregset struct

Contains copy of siginfo_t, size might increase

val nt_file : Nat_big_num.num

Contains copy of siginfo_t, size might increase

Contains information about mapped files

val nt_prxfpreg : Nat_big_num.num

Contains information about mapped files

Contains copy of user_fxsr_struct

val nt_ppc_vmx : Nat_big_num.num

Contains copy of user_fxsr_struct

PowerPC Altivec/VMX registers

val nt_ppc_spe : Nat_big_num.num

PowerPC Altivec/VMX registers

PowerPC SPE/EVR registers

val nt_ppc_vsx : Nat_big_num.num

PowerPC SPE/EVR registers

PowerPC VSX registers

val nt_ppc_tar : Nat_big_num.num

PowerPC VSX registers

Target Address Register

val nt_ppc_ppr : Nat_big_num.num

Target Address Register

Program Priority Register

val nt_ppc_dscr : Nat_big_num.num

Program Priority Register

Data Stream Control Register

val nt_ppc_ebb : Nat_big_num.num

Data Stream Control Register

Event Based Branch Registers

val nt_ppc_pmu : Nat_big_num.num

Event Based Branch Registers

Performance Monitor Registers

val nt_ppc_tm_cgpr : Nat_big_num.num

Performance Monitor Registers

TM checkpointed GPR Registers

val nt_ppc_tm_cfpr : Nat_big_num.num

TM checkpointed GPR Registers

TM checkpointed FPR Registers

val nt_ppc_tm_cvmx : Nat_big_num.num

TM checkpointed FPR Registers

TM checkpointed VMX Registers

val nt_ppc_tm_cvsx : Nat_big_num.num

TM checkpointed VMX Registers

TM checkpointed VSX Registers

val nt_ppc_tm_spr : Nat_big_num.num

TM checkpointed VSX Registers

TM Special Purpose Registers

val nt_ppc_tm_ctar : Nat_big_num.num

TM Special Purpose Registers

TM checkpointed Target Address Register

val nt_ppc_tm_cppr : Nat_big_num.num

TM checkpointed Target Address Register

TM checkpointed Program Priority Register

val nt_ppc_tm_cdscr : Nat_big_num.num

TM checkpointed Program Priority Register

TM checkpointed Data Stream Control Register

val nt_386_tls : Nat_big_num.num

TM checkpointed Data Stream Control Register

i386 TLS slots (struct user_desc)

val nt_386_ioperm : Nat_big_num.num

i386 TLS slots (struct user_desc)

x86 io permission bitmap (1=deny)

val nt_x86_xstate : Nat_big_num.num

x86 io permission bitmap (1=deny)

x86 extended state using xsave

val nt_s390_high_gprs : Nat_big_num.num

x86 extended state using xsave

s390 upper register halves

val nt_s390_timer : Nat_big_num.num

s390 upper register halves

s390 timer register

val nt_s390_todcmp : Nat_big_num.num

s390 timer register

s390 TOD clock comparator register

val nt_s390_todpreg : Nat_big_num.num

s390 TOD clock comparator register

s390 TOD programmable register

val nt_s390_ctrs : Nat_big_num.num

s390 TOD programmable register

s390 control registers

val nt_s390_prefix : Nat_big_num.num

s390 control registers

s390 prefix register

val nt_s390_last_break : Nat_big_num.num

s390 prefix register

s390 breaking event address

val nt_s390_system_call : Nat_big_num.num

s390 breaking event address

s390 system call restart data

val nt_s390_tdb : Nat_big_num.num

s390 system call restart data

s390 transaction diagnostic block

val nt_arm_vfp : Nat_big_num.num

s390 transaction diagnostic block

ARM VFP/NEON registers

val nt_arm_tls : Nat_big_num.num

ARM VFP/NEON registers

ARM TLS register

val nt_arm_hw_break : Nat_big_num.num

ARM TLS register

ARM hardware breakpoint registers

val nt_arm_hw_watch : Nat_big_num.num

ARM hardware breakpoint registers

ARM hardware watchpoint registers

val nt_arm_system_call : Nat_big_num.num

ARM hardware watchpoint registers

ARM system call number

val nt_arm_sve : Nat_big_num.num

ARM system call number

ARM Scalable Vector Extension registers

val nt_version : Nat_big_num.num

Contains a version string.

val nt_procstat_proc : Nat_big_num.num

Procstat proc data.

val nt_procstat_files : Nat_big_num.num

Procstat proc data.

Procstat files data.

val nt_procstat_vmmap : Nat_big_num.num

Procstat files data.

Procstat vmmap data.

val nt_procstat_groups : Nat_big_num.num

Procstat vmmap data.

Procstat groups data.

val nt_procstat_umask : Nat_big_num.num

Procstat groups data.

Procstat umask data.

val nt_procstat_rlimit : Nat_big_num.num

Procstat umask data.

Procstat rlimit data.

val nt_procstat_osrel : Nat_big_num.num

Procstat rlimit data.

Procstat osreldate data.

val nt_procstat_psstrings : Nat_big_num.num

Procstat osreldate data.

Procstat ps_strings data.

val nt_procstat_auxv : Nat_big_num.num

Procstat ps_strings data.

Procstat auxv data.

type elf64_nt_file_entry = {
  1. elf64_nt_file_entry_start : Uint64_wrapper.uint64;
  2. elf64_nt_file_entry_end : Uint64_wrapper.uint64;
  3. elf64_nt_file_entry_offset : Uint64_wrapper.uint64;
  4. elf64_nt_file_entry_filename : string;
}

elf64_nt_file_entry represents the contents of a NT_FILE note entry.

type elf64_nt_file = {
  1. elf64_nt_file_count : Uint64_wrapper.uint64;
  2. elf64_nt_file_page_size : Uint64_wrapper.uint64;
  3. elf64_nt_file_entries : elf64_nt_file_entry list;
}

elf64_nt_file represents the contents of a NT_FILE note.

type elf64_nt_procstat_vmentry = {
  1. elf64_nt_procstat_vmentry_type : Uint32_wrapper.uint32;
    (*

    Type of map entry.

    *)
  2. elf64_nt_procstat_vmentry_start : Uint64_wrapper.uint64;
    (*

    Starting address.

    *)
  3. elf64_nt_procstat_vmentry_end : Uint64_wrapper.uint64;
    (*

    Finishing address.

    *)
  4. elf64_nt_procstat_vmentry_offset : Uint64_wrapper.uint64;
    (*

    Mapping offset in object

    *)
  5. elf64_nt_procstat_vmentry_vn_fileid : Uint64_wrapper.uint64;
    (*

    inode number if vnode

    *)
  6. elf64_nt_procstat_vmentry_vn_fsid : Uint32_wrapper.uint32;
    (*

    dev_t of vnode location

    *)
  7. elf64_nt_procstat_vmentry_flags : Uint32_wrapper.uint32;
    (*

    Flags on map entry.

    *)
  8. elf64_nt_procstat_vmentry_resident : Uint32_wrapper.uint32;
    (*

    Number of resident pages.

    *)
  9. elf64_nt_procstat_vmentry_protection : Uint32_wrapper.uint32;
    (*

    Protection bitmask.

    *)
  10. elf64_nt_procstat_vmentry_ref_count : Uint32_wrapper.uint32;
    (*

    VM obj ref count.

    *)
  11. elf64_nt_procstat_vmentry_shadow_count : Uint32_wrapper.uint32;
    (*

    VM obj shadow count.

    *)
  12. elf64_nt_procstat_vmentry_vn_type : Uint32_wrapper.uint32;
    (*

    Vnode type.

    *)
  13. elf64_nt_procstat_vmentry_vn_size : Uint64_wrapper.uint64;
    (*

    File size.

    *)
  14. elf64_nt_procstat_vmentry_vn_rdev : Uint32_wrapper.uint32;
    (*

    Device id if device.

    *)
  15. elf64_nt_procstat_vmentry_vn_mode : Uint32_wrapper.uint32;
    (*

    File mode.

    *)
  16. elf64_nt_procstat_vmentry_status : Uint32_wrapper.uint32;
    (*

    Status flags.

    *)
  17. elf64_nt_procstat_vmentry_path : string;
    (*

    Path to VM obj, if any.

    *)
}

elf64_nt_procstat_vmentry represents the contents of a FreeBSD NT_PROCSTAT_VMMAP note entry (see `struct kinfo_vmentry`).

val note_align : Nat_big_num.num -> Nat_big_num.num

read_elf32_note endian bs0 transcribes an ELF note section from byte * sequence bs0 assuming endianness endian. May fail if transcription fails * (i.e. if the byte sequence is not sufficiently long).

read_elf64_note endian bs0 transcribes an ELF note section from byte * sequence bs0 assuming endianness endian. May fail if transcription fails * (i.e. if the byte sequence is not sufficiently long).

obtain_elf32_note_sections endian sht bs0 returns all note sections present * in an ELF file, as indicated by the file's section header table sht, reading * them from byte sequence bs0 assuming endianness endian. May fail if * transcription of a note section fails.

obtain_elf64_note_sections endian sht bs0 returns all note sections present * in an ELF file, as indicated by the file's section header table sht, reading * them from byte sequence bs0 assuming endianness endian. May fail if * transcription of a note section fails.

obtain_elf32_note_segments endian pht bs0 returns all note segments present * in an ELF file, as indicated by the file's program header table pht, reading * them from byte sequence bs0 assuming endianness endian. May fail if * transcription of a note section fails.

obtain_elf64_note_segments endian pht bs0 returns all note segments present * in an ELF file, as indicated by the file's program header table pht, reading * them from byte sequence bs0 assuming endianness endian. May fail if * transcription of a note section fails.

obtain_elf32_note_section_and_segments endian pht sht bs0 returns all note * sections and segments present in an ELF file, as indicated by the file's * program header table pht and section header table sht, reading * them from byte sequence bs0 assuming endianness endian. May fail if * transcription of a note section or segment fails.

obtain_elf64_note_section_and_segments endian pht sht bs0 returns all note * sections and segments present in an ELF file, as indicated by the file's * program header table pht and section header table sht, reading * them from byte sequence bs0 assuming endianness endian. May fail if * transcription of a note section or segment fails.

val name_string_of_elf32_note : elf32_note -> string

name_string_of_elf32_note note extracts the name string of an ELF note * section, interpreting the section's uninterpreted name field as a string.

val name_string_of_elf64_note : elf64_note -> string

name_string_of_elf64_note note extracts the name string of an ELF note * section, interpreting the section's uninterpreted name field as a string.

read_freebsd_note_desc unwraps a FreeBSD note description, checking that the size of

type elf64_psstrings = {
  1. elf64_psstrings_argvstr : Uint64_wrapper.uint64;
  2. elf64_psstrings_nargvstr : Uint32_wrapper.uint32;
    (*

    the number of argument strings

    *)
  3. elf64_psstrings_envstr : Uint64_wrapper.uint64;
  4. elf64_psstrings_nenvstr : Uint32_wrapper.uint32;
    (*

    the number of environment strings

    *)
}

elf64_psstrings is FreeBSD's `struct ps_strings`

type mmap_entry = {
  1. mmap_entry_start : Nat_big_num.num;
  2. mmap_entry_end : Nat_big_num.num;
  3. mmap_entry_offset : Nat_big_num.num;
  4. mmap_entry_path : string;
}

A mmap table entry suitable for both Linux and FreeBSD.

val read_nt_file_entries : Endianness.endianness -> elf64_note list -> mmap_entry list Error.error
val read_nt_procstat_vmmap : Endianness.endianness -> elf64_note list -> mmap_entry list Error.error
val read_mmap_table : Endianness.endianness -> elf64_note list -> mmap_entry list Error.error
val get_mmap_entry_at : mmap_entry list -> Nat_big_num.num -> mmap_entry option
val read_all_elf64_nt_auxv : Endianness.endianness -> elf64_note list -> Auxv.elf64_auxv list Error.error
OCaml

Innovation. Community. Security.