Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
value class Address32(val value: UInt) : Comparable<Address32>

Represents a 32-bit address in a PE file.

Link copied to clipboard
value class Address64(val value: ULong) : Comparable<Address64>

Represents a 64-bit address in a PE file.

Link copied to clipboard
open class CommonFileException @JvmOverloads constructor(message: String? = null, cause: Throwable? = null) : RuntimeException
Link copied to clipboard

Defines an interface for random-access data reading.

Link copied to clipboard
expect class EOFException(message: String?) : IOException

Represents an end-of-file exception.

actual class EOFException(message: String?) : IOException
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
expect interface FileFormat<out T : OpenedFile>

Represents a object or executable file format.

actual interface FileFormat<out T : OpenedFile>

Represents a object or executable file format.

actual interface FileFormat<out T : OpenedFile>

Represents a object or executable file format.

actual interface FileFormat<out T : OpenedFile>

Represents a object or executable file format.

actual interface FileFormat<out T : OpenedFile>

Represents a object or executable file format.

actual interface FileFormat<out T : OpenedFile>

Represents a object or executable file format.

Link copied to clipboard

Represents an imported symbol in an executable file

Link copied to clipboard

Represents a container that holds import symbols

Link copied to clipboard
expect open class IOException(message: String?, cause: Throwable?) : Exception

Represents an I/O exception.

actual typealias IOException = java.io.IOException
actual open class IOException(message: String?, cause: Throwable?) : Exception
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Represents a section of a file that can be read.

Link copied to clipboard
Link copied to clipboard

Provides a way to read a simple structure object

Link copied to clipboard

An implementation of InputStream that reads data from a ReadableSection. This class provides a way to read section data using the standard Java InputStream API.

Link copied to clipboard

Represents a 32-bit time stamp in PE/COFF file format.

Link copied to clipboard

Functions

Link copied to clipboard
inline fun Address32(value: Int): Address32

Convert from raw value to 32-bit address.

Link copied to clipboard
inline fun Address64(value: Int): Address64
inline fun Address64(value: Long): Address64
inline fun Address64(value: UInt): Address64
Link copied to clipboard

Detects the type of the executable file from the provided ByteArray.

Detects the type of the executable file from the given path.

Detects the type of the executable file from the provided DataAccessor.

Detects the type of the executable file from the given file.

Detects the type of the executable file from the given path.

Detects the type of the executable file from the given path.

Detects the type of the executable file from the given path.

Detects the type of the executable file from the given path.

Detects the type of the executable file from the given path.

Link copied to clipboard
Link copied to clipboard

Extension function that creates an InputStream from a ReadableSection.

Link copied to clipboard

Returns true if this is an ELF file.

Link copied to clipboard

Returns true if this is a Mach-O file.

Link copied to clipboard

Returns true if this is a PE file.

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
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.

Link copied to clipboard
inline fun Int.toAddr(): Address32
inline fun Long.toAddr(): Address64
inline fun UInt.toAddr(): Address32
inline fun ULong.toAddr(): Address64