Documentation
¶
Index ¶
- Constants
- func Asm(processor *Processor, code string) ([]byte, error)
- func Disasm(address uint64, code []byte, processor *Processor) (string, error)
- func PackUint16BE(i uint16) []byte
- func PackUint16LE(i uint16) []byte
- func PackUint32BE(i uint32) []byte
- func PackUint32LE(i uint32) []byte
- func PackUint64BE(i uint64) []byte
- func PackUint64LE(i uint64) []byte
- func UnpackUint16BE(b []byte) uint16
- func UnpackUint16LE(b []byte) uint16
- func UnpackUint32BE(b []byte) uint32
- func UnpackUint32LE(b []byte) uint32
- func UnpackUint64BE(b []byte) uint64
- func UnpackUint64LE(b []byte) uint64
- type Architecture
- type ELF
- func (e *ELF) BSS(offset uint64) (uint64, error)
- func (e *ELF) Disasm(address uint64, nBytes int) (string, error)
- func (e *ELF) GetOpcodeVAddrs(signature []byte) ([]uint64, error)
- func (e *ELF) GetSignatureVAddrs(signature []byte) ([]uint64, error)
- func (e *ELF) OffsetToAddr(offset uint64) (uint64, error)
- func (e *ELF) ROP() (*ROP, error)
- func (e *ELF) Read(address uint64, nBytes int) ([]byte, error)
- func (e *ELF) Read16BE(address uint64) (uint16, error)
- func (e *ELF) Read16LE(address uint64) (uint16, error)
- func (e *ELF) Read32BE(address uint64) (uint32, error)
- func (e *ELF) Read32LE(address uint64) (uint32, error)
- func (e *ELF) Read64BE(address uint64) (uint64, error)
- func (e *ELF) Read64LE(address uint64) (uint64, error)
- func (e *ELF) Read8(address uint64) (uint8, error)
- type Endian
- type FileFormat
- type Gadget
- type Mitigations
- type Processor
- type ROP
- type Remote
- func (r *Remote) Close()
- func (r *Remote) Interactive() error
- func (r *Remote) RecvLine() ([]byte, error)
- func (r *Remote) RecvN(n int) ([]byte, error)
- func (r *Remote) RecvUntil(needle []byte, drop bool) ([]byte, error)
- func (r *Remote) Send(data []byte) (int, error)
- func (r *Remote) SendLine(line []byte) (int, error)
Constants ¶
const ArchAARCH64 = 3
ArchAARCH64 - ARM (64-bit)
const ArchARM = 2
ArchARM - ARM (32-bit)
const ArchI386 = 1
ArchI386 - Intel x86
const ArchIA64 = 6
ArchIA64 - Intel Itanium
const ArchMIPS = 5
ArchMIPS - MIPS
const ArchPPC = 4
ArchPPC - PowerPC
const ArchX8664 = 0
ArchX8664 indicates Intel x86-64 ISA
const ELFFile = 1
ELFFile represents Unix ELF file format
const PEFile = 0
PEFile represents Microsoft PE file format
const UnknownFile = 2
UnknownFile indicates that the file format is unsupported
Variables ¶
This section is empty.
Functions ¶
func Disasm ¶
Disasm disassembles a supplied byte slice and returns a string containing the assembly instructions
func PackUint16BE ¶
PackUint16BE packs a uint16 into a byte slice in big endian format
func PackUint16LE ¶
PackUint16LE packs a uint16 into a byte slice in little endian format
func PackUint32BE ¶
PackUint32BE packs a uint32 into a byte slice in big endian format
func PackUint32LE ¶
PackUint32LE packs a uint32 into a byte slice in little endian format
func PackUint64BE ¶
PackUint64BE packs a uint64 into a byte slice in big endian format
func PackUint64LE ¶
PackUint64LE packs a uint64 into a byte slice in little endian format
func UnpackUint16BE ¶
UnpackUint16BE unpacks a byte slice in big endian format into a uint16
func UnpackUint16LE ¶
UnpackUint16LE unpacks a byte slice in little endian format into a uint16
func UnpackUint32BE ¶
UnpackUint32BE unpacks a byte slice in big endian format into a uint32
func UnpackUint32LE ¶
UnpackUint32LE unpacks a byte slice in little endian format into a uint32
func UnpackUint64BE ¶
UnpackUint64BE unpacks a byte slice in big endian format into a uint64
func UnpackUint64LE ¶
UnpackUint64LE unpacks a byte slice in little endian format into a uint64
Types ¶
type ELF ¶
type ELF struct { E *elf.File Processor *Processor PIE bool Mitigations *Mitigations }
ELF is a struct that contains methods for operating on an ELF file
func (*ELF) BSS ¶
BSS is an ELF method that returns the virtual address of the specified offset into the .bss section
func (*ELF) Disasm ¶
Disasm is an ELF method that disassembles code at the specified virtual address and returns a string containing assembly instructions
func (*ELF) GetOpcodeVAddrs ¶
GetOpcodeVAddrs is an ELF method that searches for the specified sequence of bytes in executable segments only
func (*ELF) GetSignatureVAddrs ¶
GetSignatureVAddrs is an ELF method that searches for the specified sequence of bytes in all segments
func (*ELF) OffsetToAddr ¶
OffsetToVA determines the virtual address for the specified file offset
func (*ELF) ROP ¶
ROP is an ELF method that locates all ROP gadgets in the ELF's executable segments and returns a ROP object
func (*ELF) Read ¶
Read is an ELF method that returns a slice of bytes read from the ELF at the specified virtual address
func (*ELF) Read16BE ¶
Read16BE is an ELF method that reads 16 bits from the ELF at the specified address and returns a Uint16 in big endian byte order
func (*ELF) Read16LE ¶
Read16LE is an ELF method that reads 16 bits from the ELF at the specified address and returns a Uint16 in little endian byte order
func (*ELF) Read32BE ¶
Read32BE is an ELF method that reads 32 bits from the ELF at the specified address and returns a Uint32 in big endian byte order
func (*ELF) Read32LE ¶
Read32LE is an ELF method that reads 32 bits from the ELF at the specified address and returns a Uint32 in little endian byte order
func (*ELF) Read64BE ¶
Read64BE is an ELF method that reads 64 bits from the ELF at the specified address and returns a Uint64 in big endian byte order
type Endian ¶
type Endian int
Endian is a integer type that represents the byte order of a binary
const BigEndian Endian = 1
BigEndian - big endian byte order
const LittleEndian Endian = 0
LittleEndian - little endian byte order
type Gadget ¶
Gadget stores information about a ROP gadgets including the address, instructions, and opcode bytes
type Mitigations ¶
Mitigations is used to store information on exploit mitigations detected while loading the binary
type Processor ¶
type Processor struct { Architecture Architecture Endian Endian }
Processor is a struct that represents a binary's machine type
type ROP ¶
type ROP []*Gadget
ROP is a interface for working with ROP gadgets
type Remote ¶
Remote is an interface for communicating over IP
func NewRemote ¶
NewRemote connects to the specified remote host and returns an initialized Remote instance
func (*Remote) Close ¶
func (r *Remote) Close()
Close is a Remote method for closing the connection if it's active
func (*Remote) Interactive ¶
Interactive is a Remote method that allows the user to interact with a remote process manually
func (*Remote) RecvLine ¶
RecvLine is a Remote method for receiving data over IP until a newline delimiter is detected
func (*Remote) RecvUntil ¶
RecvUntil is a Remote method for receiving data over IP until the specified sequence of bytes is detected