Next: , Previous: , Up: IO procedures   [Contents][Index]


2.2.2 Convenience procedures

The procedures below will allocate bytevectors of the required size, read the raw data, and then parse it as appropriate, finally returning the corresponding Scheme record (see Record constructors).

Procedure: read-elf-ident port

Reads an <elf-ident> from port. Typically you do not want to use this procedure; instead you would rather use read-elf-header to obtain the entire ELF header.

Procedure: read-elf-header port

Reads an <elf-header> from port. It will recognize the architecture (32-bit or 64-bit) and read the rest of the header accordingly.

Procedure: read-elf-program-header elf-header port

Reads an <elf-program-header> from port. The elf-header argument must be an instance of <elf-header>.

Procedure: read-elf-segment program-header port

Reads the bytes of a segment from port and returns them as a freshly allocated bytevector. The program-header argument must be an instance of <elf-program-header>.

Procedure: read-elf-section-header elf-header port

Reads an <elf-section-header> from port. The elf-header argument must be an instance of <elf-header>.

Procedure: read-elf-section section-header port

Reads the bytes of a section from port and returns them as a freshly allocated bytevector. The section-header argument must be an instance of <elf-section-header>.

Procedure: read-elf-sym elf-header port

Reads an <elf-sym> from port. The elf-header argument must be an instance of <elf-header>.

Procedure: read-elf-rel elf-header port

Reads an <elf-rel> from port. The elf-header argument must be an instance of <elf-header>.

Procedure: read-elf-rela elf-header port

Reads an <elf-rela> from port. The elf-header argument must be an instance of <elf-header>.

Procedure: read-elf-dyn elf-header port

Reads an <elf-dyn> from port. The elf-header argument must be an instance of <elf-header>.

Procedure: read-elf-nhdr elf-header port

Reads an <elf-nhdr> from port. The elf-header argument must be an instance of <elf-header>.

Procedure: read-elf-note elf-header port

Reads an <elf-note> from port. The elf-header argument must be an instance of <elf-header>.


Next: Looping constructs, Previous: Raw byte reading, Up: IO procedures   [Contents][Index]