emulator

package module
v0.0.0-...-857b82e Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: GPL-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const (
	JsonLog    int = iota
	ConsoleLog int = iota
)

Variables

View Source
var (
	STACK_ADDR uint64 = 0x10000000
	STACK_SIZE uint64 = 0x00100000

	HOOK_MEMORY_BASE uint64 = 0x01000000
	HOOK_MEMORY_SIZE uint64 = 0x00200000

	MAP_ALLOC_BASE uint64 = 0x30000000
	MAP_ALLOC_SIZE uint64 = 0xA0000000 - MAP_ALLOC_BASE

	BASE_ADDR uint64 = 0xCBBCB000

	PAGE_SIZE uint64 = 0x1000

	STACK_OFFSET uint64 = 8

	WRITE_FSTAT_TIMES = true
)
View Source
var (
	//TIMEOFDAY
	OVERRIDE_TIMEOFDAY      = false
	OVERRIDE_TIMEOFDAY_SEC  = 0
	OVERRIDE_TIMEOFDAY_USEC = 0
	//CLOCK
	OVERRIDE_CLOCK      = false
	OVERRIDE_CLOCK_TIME = 0
)
View Source
var (
	ErrNotImplemented = errors.New("this is not implemented")

	ErrHeapLessEqualZero  = errors.New("heap map size was <= 0.")
	ErrMmapError          = errors.New("mmap error")
	ErrMapAddrNotMultiple = errors.New("map addr was not multiple of page size")

	ErrUnknownBehavior = errors.New("unknown behavior")

	ErrUnexpectedAsmLength = errors.New("unexpected asm bytes length")
	ErrAsmFailed           = errors.New("asm failed")

	ErrJavaClassLoaded = errors.New("java class already loaded")

	ErrFailConvertToInt = errors.New("failed to parse binary")

	ErrELFReadFail       = errors.New("reader ELF fail")
	ErrELFReadNoDynamic  = errors.New("no dynamic in this ELF")
	ErrELF64NotSupported = errors.New("64bit not supported now")
	ErrELFNHash          = errors.New("can not detect nsymbol by DT_HASH, DT_GNUHASH, not support now")
	ErrELFStSize         = errors.New("unknown handler for stsize")
	ErrELFSOFileTooLong  = errors.New("ELF SO filename is longer than 128")

	ErrELFSymbolNotFound = errors.New("ELF Symbol not found")
)
View Source
var (
	R_ARM_ABS32     uint32 = 2
	R_ARM_GLOB_DAT  uint32 = 21
	R_ARM_JUMP_SLOT uint32 = 22
	R_ARM_RELATIVE  uint32 = 23
	//64
	R_AARCH64_GLOB_DAT  uint32 = 1025
	R_AARCH64_JUMP_SLOT uint32 = 1026
	R_AARCH64_RELATIVE  uint32 = 1027
)

From http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044f/IHI0044F_aaelf.pdf

View Source
var (
	// PT
	PT_NULL    uint32 = 0
	PT_LOAD    uint32 = 1
	PT_DYNAMIC uint32 = 2
	PT_INTERP  uint32 = 3
	PT_NOTE    uint32 = 4
	PT_SHLIB   uint32 = 5
	PT_PHDR    uint32 = 6
	// DT
	DT_NULL         uint32 = 0
	DT_NEEDED       uint32 = 1
	DT_PLTRELSZ     uint32 = 2
	DT_PLTGOT       uint32 = 3
	DT_HASH         uint32 = 4
	DT_STRTAB       uint32 = 5
	DT_SYMTAB       uint32 = 6
	DT_RELA         uint32 = 7
	DT_RELASZ       uint32 = 8
	DT_RELAENT      uint32 = 9
	DT_STRSZ        uint32 = 10
	DT_SYMENT       uint32 = 11
	DT_INIT         uint32 = 0x0c
	DT_INIT_ARRAY   uint32 = 0x19
	DT_FINI_ARRAY   uint32 = 0x1a
	DT_INIT_ARRAYSZ uint32 = 0x1b
	DT_FINI_ARRAYSZ uint32 = 0x1c
	DT_SONAME       uint32 = 14
	DT_RPATH        uint32 = 15
	DT_SYMBOLIC     uint32 = 16
	DT_REL          uint32 = 17
	DT_RELSZ        uint32 = 18
	DT_RELENT       uint32 = 19
	DT_PLTREL       uint32 = 20
	DT_DEBUG        uint32 = 21
	DT_TEXTREL      uint32 = 22
	DT_JMPREL       uint32 = 23
	DT_LOPROC       uint32 = 0x70000000
	DT_HIPROC       uint32 = 0x7fffffff
	// SHN
	SHN_UNDEF        uint16 = 0
	SHN_LORESERVE    uint16 = 0xff00
	SHN_LOPROC       uint16 = 0xff00
	SHN_HIPROC       uint16 = 0xff1f
	SHN_ABS          uint16 = 0xfff1
	SHN_COMMON       uint16 = 0xfff2
	SHN_HIRESERVE    uint16 = 0xffff
	SHN_MIPS_ACCOMON uint16 = 0xff00
	// STB
	STB_LOCAL   uint16 = 0
	STB_GLOBAL  uint16 = 1
	STB_WEAK    uint16 = 2
	STT_NOTYPE  uint16 = 0
	STT_OBJECT  uint16 = 1
	STT_FUNC    uint16 = 2
	STT_SECTION uint16 = 3
	STT_FILE    uint16 = 4
)
View Source
var (
	JNI_FALSE uint64 = 0
	JNI_TRUE  uint64 = 0

	JNI_VERSION_1_1 uint64 = 0x00010001
	JNI_VERSION_1_2 uint64 = 0x00010002
	JNI_VERSION_1_4 uint64 = 0x00010004
	JNI_VERSION_1_6 uint64 = 0x00010006

	JNI_OK        uint64 = 0            // no error
	JNI_ERR       uint64 = __negVal(-1) // generic error
	JNI_EDETACHED uint64 = __negVal(-2) // thread detached from the VM
	JNI_EVERSION  uint64 = __negVal(-3) // JNI version error
	JNI_ENOMEM    uint64 = __negVal(-4) // Out of memory
	JNI_EEXIST    uint64 = __negVal(-5) // VM already created
	JNI_EINVAL    uint64 = __negVal(-6) // Invalid argument

	JNI_COMMIT uint64 = 1 // copy content, do not free buffer
	JNI_ABORT  uint64 = 2 // free buffer w/o copying back

)
View Source
var (
	CLOCK_REALTIME           uint64 = 0
	CLOCK_MONOTONIC          uint64 = 1
	CLOCK_PROCESS_CPUTIME_ID uint64 = 2
	CLOCK_THREAD_CPUTIME_ID  uint64 = 3
	CLOCK_MONOTONIC_RAW      uint64 = 4
	CLOCK_REALTIME_COARSE    uint64 = 5
	CLOCK_MONOTONIC_COARSE   uint64 = 6
	CLOCK_BOOTTIME           uint64 = 7
	CLOCK_REALTIME_ALARM     uint64 = 8
	CLOCK_BOOTTIME_ALARM     uint64 = 9

	FUTEX_WAIT            uint64 = 0
	FUTEX_WAKE            uint64 = 1
	FUTEX_FD              uint64 = 2
	FUTEX_REQUEUE         uint64 = 3
	FUTEX_CMP_REQUEUE     uint64 = 4
	FUTEX_WAKE_OP         uint64 = 5
	FUTEX_LOCK_PI         uint64 = 6
	FUTEX_UNLOCK_PI       uint64 = 7
	FUTEX_TRYLOCK_PI      uint64 = 8
	FUTEX_WAIT_BITSET     uint64 = 9
	FUTEX_WAKE_BITSET     uint64 = 10
	FUTEX_WAIT_REQUEUE_PI uint64 = 11
	FUTEX_CMP_REQUEUE_PI  uint64 = 12

	FUTEX_PRIVATE_FLAG   uint64 = 128
	FUTEX_CLOCK_REALTIME uint64 = 256

	FUTEX_CMD_MASK uint64 = uint64(tmp)

	//fcntl
	/* command values */
	F_DUPFD  uint64 = 0 /* duplicate file descriptor */
	F_GETFD  uint64 = 1 /* get file descriptor flags */
	F_SETFD  uint64 = 2 /* set file descriptor flags */
	F_GETFL  uint64 = 3 /* get file status flags */
	F_SETFL  uint64 = 4 /* set file status flags */
	F_GETOWN uint64 = 5 /* get SIGIO/SIGURG proc/pgrp */
	F_SETOWN uint64 = 6 /* set SIGIO/SIGURG proc/pgrp */
	F_GETLK  uint64 = 7 /* get record locking information */
	F_SETLK  uint64 = 8 /* set record locking information */
	F_SETLKW uint64 = 9 /* F_SETLK; wait if blocked */

	/* file descriptor flags (F_GETFD, F_SETFD) */
	FD_CLOEXEC uint64 = 1 /* close-on-exec flag */

	/* record locking flags (F_GETLK, F_SETLK, F_SETLKW) */
	F_RDLCK uint64 = 1     /* shared or read lock */
	F_UNLCK uint64 = 2     /* unlock */
	F_WRLCK uint64 = 3     /* exclusive or write lock */
	F_WAIT  uint64 = 0x010 /* Wait until lock is granted */
	F_FLOCK uint64 = 0x020 /* Use flock(2) semantics for lock */
	F_POSIX uint64 = 0x040 /* Use POSIX semantics for lock */
)
View Source
var (
	PF_X uint32 = 0x1
	PF_W uint32 = 0x2
	PF_R uint32 = 0x4
)
View Source
var (
	OVERRIDE_URANDOM     = false
	OVERRIDE_URANDOM_INT = 1
	S_STATUS             = `` /* 836-byte string literal not displayed */

)

Functions

func AccessibleObject

func AccessibleObject() *javaClass

func ConvHex

func ConvHex(ft string, p interface{}) string

func Executable

func Executable() *javaClass

func Field

func Field(parent *javaClass, fieldName string) *javaClass

func GetSegmentProtection

func GetSegmentProtection(prot_in uint32) int

func IntToBytes

func IntToBytes(i int64, sz int) (r []byte)

func IsAbs

func IsAbs(path string) bool

func JavaClassDef

func JavaClassDef() *javaClass

func JavaFieldDef

func JavaFieldDef(name string) *javaField

Usage: JavaFieldDef("st").

Sig("Ljava/lang/String;").
Static("hello").
Ignore()

func JavaMethodDef

func JavaMethodDef(name string, native bool) *javaMethod

Usage: JavaMethodDef("getString", false).

Sig("(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;").
Args([]string{"jobject", "jstring"}).
Callback()

JavaMethodDef("beHealthy", true).

Sig("(II[B)[B").

func LE_BytesToUint

func LE_BytesToUint(b []byte) uint64

func LE_BytesToUint32

func LE_BytesToUint32(b []byte) uint32

func LE_BytesToUint64

func LE_BytesToUint64(b []byte) uint64

func LoadConfig

func LoadConfig(path string, c *Config) error

func LoadOrCreateConfig

func LoadOrCreateConfig(path string, c *Config) error

func Method

func Method(declaringClass *javaClass, met *javaMethod) *javaClass

func MyOpen

func MyOpen(fd string, flag int) (*os.File, error)

def my_open(fd, flag):

global g_isWin
if(g_isWin):
    flag = flag | os.O_BINARY
#
return os.open(fd, flag)

func NativeReadArgs

func NativeReadArgs(mu uc.Unicorn, argsCount int) []uint64

func NativeTranslateArg

func NativeTranslateArg(emu *Emulator, val interface{}) uint64

func NativeWriteArgRegister

func NativeWriteArgRegister(emu *Emulator, reg int, val interface{}) error

func NativeWriteArgs

func NativeWriteArgs(emu *Emulator, args ...interface{}) error

func NewClass

func NewClass(clazz *javaClass) *jClass

func NewJClass

func NewJClass(val interface{}) *jclass

func NewJObject

func NewJObject(val interface{}) *jobject

func NextClassId

func NextClassId() uint64

func NextFieldId

func NextFieldId() uint64

func NextMethodId

func NextMethodId() uint64

func Object

func Object() *javaClass

func PageEnd

func PageEnd(addr uint64) uint64

func PageStart

func PageStart(addr uint64) uint64

func ReadByteArray

func ReadByteArray(mu uc.Unicorn, address, size uint64) ([]byte, error)

func ReadPtr

func ReadPtr(mu uc.Unicorn, address uint64) (uint64, error)

func ReadUints

func ReadUints(mu uc.Unicorn, address uint64, num int) ([]uint64, error)

func ReadUtf8

func ReadUtf8(mu uc.Unicorn, address uint64) ([]byte, error)

func RegContextRestore

func RegContextRestore(mu uc.Unicorn, ctx *RegistryContext) error

func SaveConfig

func SaveConfig(path string, c *Config) error

func SystemPathToVfsPath

func SystemPathToVfsPath(vfs_root, path string) (string, error)

func VfsPathToSystemPath

func VfsPathToSystemPath(vfs_root, path string) string

func WriteUints

func WriteUints(mu uc.Unicorn, address uint64, nums []uint64) (err error)

func WriteUtf8

func WriteUtf8(mu uc.Unicorn, address uint64, val []byte) error

Types

type Config

type Config struct {
	PkgName   string `json:"pkg_name"`
	Pid       int    `json:"pid"`
	Uid       int    `json:"uid"`
	AndroidID string `json:"android_id"`
	Ip        string `json:"ip"`
	Mac       Mac    `json:"mac"`
}

func NewDefaultConfig

func NewDefaultConfig() *Config

type ELFReader

type ELFReader struct {
	// contains filtered or unexported fields
}

func NewELFReader

func NewELFReader(filename string) (*ELFReader, error)

func (*ELFReader) GetDynStringByRelSym

func (elfr *ELFReader) GetDynStringByRelSym(relSym int) string

func (*ELFReader) GetInit

func (elfr *ELFReader) GetInit() uint32

func (*ELFReader) GetInitArray

func (elfr *ELFReader) GetInitArray() (uint32, uint32)

func (*ELFReader) GetLoad

func (elfr *ELFReader) GetLoad() []phdr

func (*ELFReader) GetRels

func (elfr *ELFReader) GetRels() rels

func (*ELFReader) GetSoNeeded

func (elfr *ELFReader) GetSoNeeded() []string

func (*ELFReader) GetSymbols

func (elfr *ELFReader) GetSymbols() []dyn

func (*ELFReader) StNameToName

func (elfr *ELFReader) StNameToName(stname uint32) string

func (*ELFReader) WriteSoInfo

func (elfr *ELFReader) WriteSoInfo(mu uc.Unicorn, loadBase, infoBase uint64) (uint32, error)

type Emulator

type Emulator struct {
	Memory *MemoryMap

	Vfs             *VirtualFileSystem
	Hooker          *Hooker
	JavaClassLoader *JavaClassLoader
	JavaVM          *JavaVM
	Modules         *Modules
	NativeMemory    *NativeMemory
	NativeHooks     *NativeHooks

	Pcb *Pcb
	Mu  uc.Unicorn
	// contains filtered or unexported fields
}

func NewEmulator

func NewEmulator(opt *Options) (*Emulator, error)

func (*Emulator) CallNative

func (emu *Emulator) CallNative(address uint32, args ...interface{}) (uint64, error)

func (*Emulator) CallSymbol

func (emu *Emulator) CallSymbol(module *Module, symbolName string, args ...interface{}) (uint64, error)

func (*Emulator) LoadLibrary

func (emu *Emulator) LoadLibrary(filename string, doInit bool) (*Module, error)

type FieldValue

type FieldValue interface{}

type Hooker

type Hooker struct {
	// contains filtered or unexported fields
}

func NewHooker

func NewHooker(emu *Emulator, logger zl.Logger, base, size uint64) *Hooker

func (*Hooker) WriteFunctionTable

func (hk *Hooker) WriteFunctionTable(table map[uint64]HookerCallback) (uint64, uint64)

type HookerCallback

type HookerCallback func(NativeMethodContext) error

type InterruptHandler

type InterruptHandler struct {
	// contains filtered or unexported fields
}

func NewInterruptHandler

func NewInterruptHandler(mu uc.Unicorn) *InterruptHandler

func (*InterruptHandler) SetHandler

func (ih *InterruptHandler) SetHandler(intno uint32, handler func(uc.Unicorn))

func (*InterruptHandler) SetLogger

func (ih *InterruptHandler) SetLogger(logger zl.Logger)

type JavaClassLoader

type JavaClassLoader struct {
	ClassById   map[uint64]*javaClass
	ClassByName map[string]*javaClass
}

func NewJavaClassLoader

func NewJavaClassLoader() *JavaClassLoader

func (*JavaClassLoader) AddClass

func (jc *JavaClassLoader) AddClass(cls *javaClass, force bool) error

type JavaVM

type JavaVM struct {
	JniEnv *JniEnv
	// contains filtered or unexported fields
}

func NewJavaVM

func NewJavaVM(emu *Emulator, jcl *JavaClassLoader, hooker *Hooker, logger zl.Logger) *JavaVM

func (*JavaVM) Addr

func (jvm *JavaVM) Addr() uint64

func (*JavaVM) AddrPtr

func (jvm *JavaVM) AddrPtr() uint64

type JniEnv

type JniEnv struct {
	// contains filtered or unexported fields
}

func NewJniEnv

func NewJniEnv(emu *Emulator, jcl *JavaClassLoader, hk *Hooker) *JniEnv

func (*JniEnv) AddLocalReference

func (je *JniEnv) AddLocalReference(obj *jobject) uint64

func (*JniEnv) ClearLocals

func (je *JniEnv) ClearLocals()

func (*JniEnv) GetLocalReference

func (je *JniEnv) GetLocalReference(idx uint64) uint64

type Mac

type Mac []byte

type MemoryMap

type MemoryMap struct {
	// contains filtered or unexported fields
}

func NewMemoryMap

func NewMemoryMap(mu uc.Unicorn, allocMinAddr, allocMaxAddr uint64) *MemoryMap

func (*MemoryMap) CheckAddr

func (m *MemoryMap) CheckAddr(addr uint64, prot int) (bool, error)

func (*MemoryMap) DumpMaps

func (m *MemoryMap) DumpMaps(wrt io.Writer) error

func (*MemoryMap) IsMultiple

func (m *MemoryMap) IsMultiple(addr uint64) bool

func (*MemoryMap) IsOverlap

func (m *MemoryMap) IsOverlap(addr1, end1, addr2, end2 uint64) bool

func (*MemoryMap) Map

func (m *MemoryMap) Map(address, size uint64, prot int, vf interface{}, offset uint64) (uint64, error)

func (*MemoryMap) Protect

func (m *MemoryMap) Protect(addr, lenx uint64, prot int) error

func (*MemoryMap) Unmap

func (m *MemoryMap) Unmap(addr, size uint64) error

type MethodContext

type MethodContext struct {
	// contains filtered or unexported fields
}

func (*MethodContext) Call

func (ctx *MethodContext) Call()

func (*MethodContext) GetArg

func (ctx *MethodContext) GetArg(i int) interface{}

func (*MethodContext) GetArgArrayObject

func (ctx *MethodContext) GetArgArrayObject(i int) []*javaClass

func (*MethodContext) GetArgMethodId

func (ctx *MethodContext) GetArgMethodId(i int) uint64

func (*MethodContext) GetArgObject

func (ctx *MethodContext) GetArgObject(i int) *javaClass

func (*MethodContext) GetArgString

func (ctx *MethodContext) GetArgString(i int) string

func (*MethodContext) GetEmu

func (ctx *MethodContext) GetEmu() *Emulator

func (*MethodContext) GetReturn

func (ctx *MethodContext) GetReturn() interface{}

func (*MethodContext) Return

func (ctx *MethodContext) Return(v interface{})

func (*MethodContext) ReturnString

func (ctx *MethodContext) ReturnString(s string)

type MethodFunction

type MethodFunction func(*MethodContext)

type Module

type Module struct {
	// contains filtered or unexported fields
}

func NewModule

func NewModule(
	filename string,
	base,
	size uint64,
	symRes map[string]uint32,
	initArray []uint32,
	soinfoPtr uint32) *Module

func (*Module) CallInit

func (m *Module) CallInit(emu *Emulator)

func (*Module) FindSymbol

func (m *Module) FindSymbol(symbolStr string) (uint32, bool)

func (*Module) IsSymbolAddr

func (m *Module) IsSymbolAddr(addr uint32) (string, bool)

func (*Module) Name

func (m *Module) Name() string

type Modules

type Modules struct {
	// contains filtered or unexported fields
}

/

func NewModules

func NewModules(emu *Emulator, vfsRoot string, logger zl.Logger) *Modules

func (*Modules) AddSymbolHook

func (ms *Modules) AddSymbolHook(symName string, addr uint64)

func (*Modules) FindModule

func (ms *Modules) FindModule(addr uint64) *Module

func (*Modules) FindModuleByName

func (ms *Modules) FindModuleByName(filename string) *Module

func (*Modules) FindSymbol

func (ms *Modules) FindSymbol(addr uint32) (string, bool)

func (*Modules) FindSymbolStr

func (ms *Modules) FindSymbolStr(symbolStr string) (uint64, bool)

func (*Modules) GetModules

func (ms *Modules) GetModules() []*Module

func (*Modules) LoadModule

func (ms *Modules) LoadModule(filename string, doInit bool) (*Module, error)

func (*Modules) MemReserve

func (ms *Modules) MemReserve(start, end uint64) uint64

type NativeHooks

type NativeHooks struct {
	// contains filtered or unexported fields
}

func NewNativeHooks

func NewNativeHooks(emu *Emulator, nm *NativeMemory, ms *Modules, hk *Hooker, vfs *VirtualFileSystem, logger zl.Logger) *NativeHooks

type NativeMemory

type NativeMemory struct {
	// contains filtered or unexported fields
}

func NewNativeMemory

func NewNativeMemory(mu uc.Unicorn, mem *MemoryMap, sh *SyscallHandlers, vfs *VirtualFileSystem, logger zl.Logger) *NativeMemory

type NativeMethodContext

type NativeMethodContext struct {
	// contains filtered or unexported fields
}

func (NativeMethodContext) Emu

func (nmc NativeMethodContext) Emu() *Emulator

func (NativeMethodContext) GetArgs

func (nmc NativeMethodContext) GetArgs(count int) []uint64

func (NativeMethodContext) Mu

func (nmc NativeMethodContext) Mu() uc.Unicorn

func (NativeMethodContext) Return

func (nmc NativeMethodContext) Return(res uint64) error

func (NativeMethodContext) Return2

func (nmc NativeMethodContext) Return2(low, high uint64) error

type Options

type Options struct {
	VfsRoot    string
	ConfigPath string
	VfpInstSet bool
	LogColor   bool
	LogAs      int
	Config     *Config
}

func NewDefaultOptions

func NewDefaultOptions() *Options

type Pcb

type Pcb struct {
	// contains filtered or unexported fields
}
var (
	GPcb *Pcb
)

func GetPcb

func GetPcb() *Pcb

func NewPcb

func NewPcb() *Pcb

func (*Pcb) AddFd

func (p *Pcb) AddFd(name, nameInSystem string, fo *os.File) uintptr

func (*Pcb) GetFdDetail

func (p *Pcb) GetFdDetail(fd uintptr) *VirtualFile

func (*Pcb) GetPid

func (p *Pcb) GetPid() int

func (*Pcb) HasFd

func (p *Pcb) HasFd(fd uintptr) bool

func (*Pcb) Remove

func (p *Pcb) Remove(fd uintptr)

type RegistryContext

type RegistryContext struct {
	R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, SP, LR, PC, CPSR uint64
}

func RegContextSave

func RegContextSave(mu uc.Unicorn) (*RegistryContext, error)

type SyscallCallback

type SyscallCallback func(uc.Unicorn, ...uint64) (uint64, bool)

type SyscallHandler

type SyscallHandler struct {
	Idx      uint64
	Name     string
	ArgCount int
	Callback SyscallCallback
}

func NewSyscallHandler

func NewSyscallHandler() *SyscallHandler

type SyscallHandlers

type SyscallHandlers struct {
	// contains filtered or unexported fields
}

func NewSyscallHandlers

func NewSyscallHandlers(ih *InterruptHandler) *SyscallHandlers

func (*SyscallHandlers) SetHandler

func (sh *SyscallHandlers) SetHandler(idx uint64, name string, argCount int, callback SyscallCallback)

func (*SyscallHandlers) SetLogger

func (sh *SyscallHandlers) SetLogger(logger zl.Logger)

type SyscallHooks

type SyscallHooks struct {
	// contains filtered or unexported fields
}

func NewSyscallHooks

func NewSyscallHooks(mu uc.Unicorn, sh *SyscallHandlers) *SyscallHooks

func (*SyscallHooks) ARM_cacheflushHandle

func (s *SyscallHooks) ARM_cacheflushHandle(mu uc.Unicorn, args ...uint64) (uint64, bool)

syscall ARM_cacheflush

func (*SyscallHooks) SetLogger

func (s *SyscallHooks) SetLogger(logger zl.Logger)

type VirtualFile

type VirtualFile struct {
	Name         string
	NameInSystem string
	Description  uintptr
	// contains filtered or unexported fields
}

func NewVirtualFile

func NewVirtualFile(name, nameInSystem string, fo *os.File) *VirtualFile

func (*VirtualFile) CloseResource

func (vf *VirtualFile) CloseResource()

type VirtualFileSystem

type VirtualFileSystem struct {
	// contains filtered or unexported fields
}

func NewVirtualFileSystem

func NewVirtualFileSystem(root string, sh *SyscallHandlers, mem *MemoryMap, logger zl.Logger, config *Config) *VirtualFileSystem

func (*VirtualFileSystem) ClearProcDir

func (vfs *VirtualFileSystem) ClearProcDir() error

WIP, add failback

func (*VirtualFileSystem) TranslatePath

func (vfs *VirtualFileSystem) TranslatePath(filename string) string

with caution of escape-access

Directories

Path Synopsis
examples module

Jump to

Keyboard shortcuts

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