Documentation ¶
Index ¶
- Variables
- func Assemble(asm string, addr uint64, arch *Arch) ([]byte, error)
- func Demangle(name string) string
- func Disas(mem []byte, addr uint64, arch *Arch, pad ...int) (string, error)
- func HexDump(base uint64, mem []byte, bits int) []string
- func Repr(p []byte, strsize int) string
- func Save(u Usercorn) ([]byte, error)
- type Arch
- type Change
- type ChangeMask
- type Changes
- type Config
- type ExitStatus
- type Gate
- type Loader
- type Loop
- type LoopDetect
- type MappedFile
- type MemLog
- func (m *MemLog) Adjacent(addr uint64, p []byte, write bool) (delta *memDelta, dup bool)
- func (m *MemLog) Empty() bool
- func (m *MemLog) Flush(indent string, bits int) string
- func (m *MemLog) Freeze()
- func (m *MemLog) Reset()
- func (m *MemLog) String(indent string, bits int) string
- func (m *MemLog) Update(addr uint64, size int, value int64, write bool)
- func (m *MemLog) UpdateBytes(addr uint64, p []byte, write bool)
- type Mmap
- type MmapAddrSort
- type OS
- type Reg
- type RegVal
- type SaveBody
- type SaveHeader
- type SaveMem
- type SaveReg
- type Segment
- type SegmentData
- type Stackframe
- type Stacktrace
- type StatusDiff
- type StrucStream
- type Symbol
- type Uname
- type Usercorn
Constants ¶
This section is empty.
Variables ¶
View Source
var SAVE_MAGIC = "UCSV"
Functions ¶
Types ¶
type Arch ¶
type Arch struct { Bits int Radare string CS_ARCH int CS_MODE uint KS_ARCH ks.Architecture KS_MODE ks.Mode UC_ARCH int UC_MODE int PC int SP int OS map[string]*OS Regs regMap GdbXml string DefaultRegs []string // contains filtered or unexported fields }
func (*Arch) RegisterOS ¶
type ChangeMask ¶
type Config ¶
type Config struct { Output io.WriteCloser Color bool Demangle bool ForceBase uint64 ForceInterpBase uint64 LoadPrefix string LoopCollapse int NativeFallback bool SavePost string SavePre string SkipInterp bool Strsize int TraceBlock bool TraceExec bool TraceMatch []string TraceMatchDepth int TraceMem bool TraceMemBatch bool TraceReg bool TraceSys bool Verbose bool PrefixArgs []string }
type Gate ¶
func (*Gate) UnlockStart ¶
func (g *Gate) UnlockStart()
func (*Gate) UnlockStop ¶
func (g *Gate) UnlockStop()
func (*Gate) UnlockStopRelock ¶
func (g *Gate) UnlockStopRelock()
type LoopDetect ¶
func NewLoopDetect ¶
func NewLoopDetect(length int) *LoopDetect
func (*LoopDetect) Detect ¶
func (l *LoopDetect) Detect() *Loop
func (*LoopDetect) Reset ¶
func (l *LoopDetect) Reset()
type MappedFile ¶
type MappedFile struct { Name string Off int64 Addr, Size uint64 Symbols []Symbol DWARF *dwarf.Data }
func (*MappedFile) Contains ¶
func (m *MappedFile) Contains(addr uint64) bool
func (*MappedFile) FileLine ¶
func (m *MappedFile) FileLine(addr uint64) string
func (*MappedFile) SymbolLookup ¶
func (m *MappedFile) SymbolLookup(name string) *Symbol
TODO: Use a map for O(n) -> O(1) TODO: Do I want this to just return addr? Part of problem is adjusting for memory offset, and it's gross if the caller needs to do that manually.
func (*MappedFile) Symbolicate ¶
func (m *MappedFile) Symbolicate(addr uint64) (result Symbol, distance uint64)
type MemLog ¶
type MemLog struct {
// contains filtered or unexported fields
}
type MmapAddrSort ¶
type MmapAddrSort []*Mmap
func (MmapAddrSort) Len ¶
func (m MmapAddrSort) Len() int
func (MmapAddrSort) Less ¶
func (m MmapAddrSort) Less(i, j int) bool
func (MmapAddrSort) Swap ¶
func (m MmapAddrSort) Swap(i, j int)
type OS ¶
type SaveHeader ¶
type SaveHeader struct { Magic string `struc:"[4]byte"` Version uint32 UcMajor, UcMinor uint32 UcArch, UcMode uint32 PC uint64 BodySize uint64 `struc:"sizeof=Compressed"` Compressed []byte }
func (*SaveHeader) PackBody ¶
func (s *SaveHeader) PackBody(b *SaveBody) error
func (*SaveHeader) UnpackBody ¶
func (s *SaveHeader) UnpackBody() (*SaveBody, error)
type SegmentData ¶
func (*SegmentData) ContainsPhys ¶
func (s *SegmentData) ContainsPhys(addr uint64) bool
func (*SegmentData) ContainsVirt ¶
func (s *SegmentData) ContainsVirt(addr uint64) bool
func (*SegmentData) Data ¶
func (s *SegmentData) Data() ([]byte, error)
type Stackframe ¶
type Stackframe struct {
PC, SP uint64
}
func (*Stackframe) Pretty ¶
func (s *Stackframe) Pretty(u Usercorn) string
type Stacktrace ¶
type Stacktrace struct {
Stack []Stackframe
}
func (*Stacktrace) Empty ¶
func (s *Stacktrace) Empty() bool
func (*Stacktrace) Freeze ¶
func (s *Stacktrace) Freeze(pc, sp uint64) []Stackframe
func (*Stacktrace) Len ¶
func (s *Stacktrace) Len() int
func (*Stacktrace) Peek ¶
func (s *Stacktrace) Peek() Stackframe
func (*Stacktrace) Pop ¶
func (s *Stacktrace) Pop() Stackframe
func (*Stacktrace) Push ¶
func (s *Stacktrace) Push(pc, sp uint64)
func (*Stacktrace) Update ¶
func (s *Stacktrace) Update(pc, sp uint64)
type StatusDiff ¶
type StatusDiff struct { U Usercorn // contains filtered or unexported fields }
func (*StatusDiff) Changes ¶
func (s *StatusDiff) Changes(onlyChanged bool) *Changes
type StrucStream ¶
type StrucStream struct { Stream io.ReadWriter Options *struc.Options }
func (*StrucStream) Pack ¶
func (s *StrucStream) Pack(vals ...interface{}) error
func (*StrucStream) Unpack ¶
func (s *StrucStream) Unpack(vals ...interface{}) error
type Usercorn ¶
type Usercorn interface { uc.Unicorn Arch() *Arch OS() string Bits() uint ByteOrder() binary.ByteOrder Assemble(asm string, addr uint64) ([]byte, error) Disas(addr, size uint64) (string, error) Config() *Config Run(args, env []string) error Trampoline(func() error) error Gate() *Gate Printf(fmt string, args ...interface{}) Println(s interface{}) RegisterAddr(f *os.File, addr, size uint64, off int64) Symbolicate(addr uint64, includeFile bool) (string, error) Brk(addr uint64) (uint64, error) Mappings() []*Mmap MemReserve(addr, size uint64, force bool) (*Mmap, error) Mmap(addr, size uint64) (*Mmap, error) MmapWrite(addr uint64, p []byte) (uint64, error) Mem() memio.MemIO StrucAt(addr uint64) *StrucStream PackAddr(buf []byte, n uint64) ([]byte, error) UnpackAddr(buf []byte) uint64 PopBytes(p []byte) error PushBytes(p []byte) (uint64, error) Pop() (uint64, error) Push(n uint64) (uint64, error) ReadRegs(reg []int) ([]uint64, error) RegDump() ([]RegVal, error) RunShellcodeMapped(mmap *Mmap, code []byte, setRegs map[int]uint64, regsClobbered []int) error RunShellcode(addr uint64, code []byte, setRegs map[int]uint64, regsClobbered []int) error Exe() string Loader() Loader InterpBase() uint64 Base() uint64 Entry() uint64 BinEntry() uint64 SetEntry(entry uint64) SetExit(exit uint64) // TODO: PrefixPath will be replaced by a full VFS subsystem PrefixPath(s string, force bool) string Syscall(num int, name string, getArgs func(n int) ([]uint64, error)) (uint64, error) Exit(err error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.