binaryx

package
v0.0.0-...-4810326 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2016 License: MIT Imports: 2 Imported by: 0

README

binaryx

This package aims to provide a uniform representation for the data of ELF, MACH-O and PE binary executables, dynamic libraries, object files.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File interface {
	Arch() string
	Os() string
	ImportedLibraries() ([]string, error)
	ImportedSymbols() ([]string, error)
	DWARF() (*dwarf.Data, error)
	Sections() []Section
	Type() FileType
	Format() Format
	Entry() uint64
	Close() error
}

type FileType

type FileType uint8

A Type is the binary file type, e.g. an object file, executable, or dynamic library.

const (
	Executable FileType = 1 + iota
	DynamicLibrary
	Object
)

func (FileType) String

func (t FileType) String() string

type Format

type Format uint8

Format specifies the file format of a binary executable.

const (
	// FormatELF represents the Executable and Linkable Format (ELF).
	FormatELF Format = 1 + iota
	// FormatMACHO represents the Mach-O (MACHO) file format.
	FormatMACHO
	// FormatPE represents the Portable Executable (PE) file format.
	FormatPE
)

File formats.

func (Format) String

func (f Format) String() string

type Perm

type Perm uint8

Perm specifies the access permissions of a segment or section in memory.

const (
	// PermExecute specifies that the memory is executable.
	PermExecute Perm = 1 << iota
	// PermWrite specifies that the memory is writeable.
	PermWrite
	// PermRead specifies that the memory is readable.
	PermRead
)

Access permissions.

type Section

type Section interface {
	SectionHeader
	Data() ([]byte, error)
	Open() io.ReadSeeker
	io.ReaderAt
}

type SectionHeader

type SectionHeader interface {
	Name() string
	Addr() uint64
	Perm() Perm
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL