usercorn

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2017 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BASE         = 0x100000
	UC_MEM_ALIGN = 0x1000
	STACK_BASE   = 0x60000000
	STACK_SIZE   = 0x800000
)

Variables

This section is empty.

Functions

func NewUsercorn

func NewUsercorn(exe string, config *models.Config) (models.Usercorn, error)

Types

type Unicorn

type Unicorn struct {
	uc.Unicorn

	Bsz int
	// contains filtered or unexported fields
}

func NewUnicorn

func NewUnicorn(arch *models.Arch, os *models.OS, order binary.ByteOrder) (*Unicorn, error)

func (*Unicorn) Arch

func (u *Unicorn) Arch() *models.Arch

func (*Unicorn) Assemble

func (u *Unicorn) Assemble(asm string, addr uint64) ([]byte, error)

func (*Unicorn) Bits

func (u *Unicorn) Bits() uint

func (*Unicorn) ByteOrder

func (u *Unicorn) ByteOrder() binary.ByteOrder

func (*Unicorn) Disas

func (u *Unicorn) Disas(addr, size uint64) (string, error)

func (*Unicorn) Mappings

func (u *Unicorn) Mappings() []*models.Mmap

func (*Unicorn) MemMap

func (u *Unicorn) MemMap(addr, size uint64) error

func (*Unicorn) MemMapProt

func (u *Unicorn) MemMapProt(addr, size uint64, prot int) error

func (*Unicorn) MemProtect

func (u *Unicorn) MemProtect(addr, size uint64, prot int) error

func (*Unicorn) MemReserve

func (u *Unicorn) MemReserve(addr, size uint64, force bool) (*models.Mmap, error)

func (*Unicorn) MemUnmap

func (u *Unicorn) MemUnmap(addr, size uint64) error

func (*Unicorn) Mmap

func (u *Unicorn) Mmap(addr, size uint64) (*models.Mmap, error)

func (*Unicorn) MmapWrite

func (u *Unicorn) MmapWrite(addr uint64, p []byte) (uint64, error)

func (*Unicorn) OS

func (u *Unicorn) OS() string

func (*Unicorn) PackAddr

func (u *Unicorn) PackAddr(buf []byte, n uint64) ([]byte, error)

func (*Unicorn) Pop

func (u *Unicorn) Pop() (uint64, error)

func (*Unicorn) PopBytes

func (u *Unicorn) PopBytes(p []byte) error

func (*Unicorn) Push

func (u *Unicorn) Push(n uint64) (uint64, error)

func (*Unicorn) PushBytes

func (u *Unicorn) PushBytes(p []byte) (uint64, error)

func (*Unicorn) ReadRegs

func (u *Unicorn) ReadRegs(regs []int) ([]uint64, error)

func (*Unicorn) RegDump

func (u *Unicorn) RegDump() ([]models.RegVal, error)

func (*Unicorn) UnpackAddr

func (u *Unicorn) UnpackAddr(buf []byte) uint64

type Usercorn

type Usercorn struct {
	*Unicorn
	sync.Mutex

	StackBase uint64
	// contains filtered or unexported fields
}

func NewUsercornRaw

func NewUsercornRaw(l models.Loader, config *models.Config) (*Usercorn, error)

func (*Usercorn) Base

func (u *Usercorn) Base() uint64

func (*Usercorn) BinEntry

func (u *Usercorn) BinEntry() uint64

func (*Usercorn) Brk

func (u *Usercorn) Brk(addr uint64) (uint64, error)

func (*Usercorn) Config

func (u *Usercorn) Config() *models.Config

func (*Usercorn) Entry

func (u *Usercorn) Entry() uint64

func (*Usercorn) Exe

func (u *Usercorn) Exe() string

func (*Usercorn) Exit

func (u *Usercorn) Exit(err error)

func (*Usercorn) Gate

func (u *Usercorn) Gate() *models.Gate

func (*Usercorn) InterpBase

func (u *Usercorn) InterpBase() uint64

func (*Usercorn) Loader

func (u *Usercorn) Loader() models.Loader

func (*Usercorn) Mem

func (u *Usercorn) Mem() memio.MemIO

func (*Usercorn) PrefixPath

func (u *Usercorn) PrefixPath(path string, force bool) string

func (*Usercorn) Printf

func (u *Usercorn) Printf(f string, args ...interface{})

func (*Usercorn) Println

func (u *Usercorn) Println(s interface{})

func (*Usercorn) RegisterAddr

func (u *Usercorn) RegisterAddr(f *os.File, addr, size uint64, off int64)

func (*Usercorn) Run

func (u *Usercorn) Run(args []string, env []string) error

func (*Usercorn) RunShellcode

func (u *Usercorn) RunShellcode(addr uint64, code []byte, setRegs map[int]uint64, regsClobbered []int) error

maps and runs shellcode at addr if regsClobbered is nil, setRegs will be saved/restored if addr is 0, we'll pick one for you if addr is already mapped, we will return an error so non-PIE is your problem will trampoline if unicorn is already running

func (*Usercorn) RunShellcodeMapped

func (u *Usercorn) RunShellcodeMapped(mmap *models.Mmap, code []byte, setRegs map[int]uint64, regsClobbered []int) error

like RunShellcode but you're expected to map memory yourself

func (*Usercorn) SetEntry

func (u *Usercorn) SetEntry(entry uint64)

func (*Usercorn) SetExit

func (u *Usercorn) SetExit(exit uint64)

func (*Usercorn) Start

func (u *Usercorn) Start(pc, end uint64) error

func (*Usercorn) StrucAt

func (u *Usercorn) StrucAt(addr uint64) *models.StrucStream

func (*Usercorn) Symbolicate

func (u *Usercorn) Symbolicate(addr uint64, includeFile bool) (string, error)

func (*Usercorn) Syscall

func (u *Usercorn) Syscall(num int, name string, getArgs func(n int) ([]uint64, error)) (uint64, error)

func (*Usercorn) Trampoline

func (u *Usercorn) Trampoline(fun func() error) error

Jump to

Keyboard shortcuts

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