Section

inner class Section(val name: String, val header: MachoSection) : ReadableSection(source)

Constructors

Link copied to clipboard
constructor(name: String, header: MachoSection)

Properties

Link copied to clipboard
open override val header: MachoSection

The header of the section, if exists.

Link copied to clipboard
open override val name: String

The name of the section, if exists.

Link copied to clipboard
open override val size: Long

The size of the section in bytes.

Functions

Link copied to clipboard
open override fun close()

No-op close method.

Link copied to clipboard

Extension function that creates an InputStream from a ReadableSection.

Link copied to clipboard
open fun readAtMost(pos: Long, buf: ByteArray): Int

Reads at most buf.size bytes from the data source starting at pos into the given buf.

open override fun readAtMost(pos: Long, buf: ByteArray, off: Int, len: Int): Int

Reads at most len bytes from the data source starting at the given pos into the buf array, starting at offset off.

Link copied to clipboard

Reads at most buf.size bytes from the data source starting at the 32-bit pos into the given buf.

Reads at most buf.size bytes from the data source starting at the 64-bit pos into the given buf.

inline fun DataAccessor.readAtMost(pos: Address32, buf: ByteArray, off: Int, len: Int): Int
inline fun DataAccessor.readAtMost(pos: Address64, buf: ByteArray, off: Int, len: Int): Int

Reads at most len bytes from the data source starting at the given pos into the buf array, starting at offset off.

Link copied to clipboard
open fun readBytes(sectionOffset: Long, buf: ByteArray, bufOffset: Int, size: Int)

Reads bytes from the section.

Link copied to clipboard
open fun readFully(pos: Long, buf: ByteArray)

Reads exactly buf.size bytes starting at pos into the buffer.

open fun readFully(pos: Long, buf: ByteArray, off: Int, len: Int)

Reads exactly len bytes starting at pos into buf, beginning at offset off.

Link copied to clipboard
inline fun DataAccessor.readFully(pos: Address32, buf: ByteArray)

Reads exactly buf.size bytes starting at the 32-bit pos into the buffer.

inline fun DataAccessor.readFully(pos: Address64, buf: ByteArray)

Reads exactly buf.size bytes starting at the 64-bit pos into the buffer.

inline fun DataAccessor.readFully(pos: Address32, buf: ByteArray, off: Int, len: Int)

Reads exactly len bytes starting at the 32-bit pos into buf, beginning at offset off.

inline fun DataAccessor.readFully(pos: Address64, buf: ByteArray, off: Int, len: Int)

Reads exactly len bytes starting at the 64-bit pos into buf, beginning at offset off.