public abstract class AbstractEmulator<T extends NewFileIO> extends Object implements Emulator<T>, MemoryWriteListener
| 限定符和类型 | 字段和说明 |
|---|---|
protected Backend |
backend |
protected DateFormat |
dateFormat |
static long |
DEFAULT_TIMEOUT |
protected SvcMemory |
svcMemory |
protected long |
timeout |
| 构造器和说明 |
|---|
AbstractEmulator(boolean is64Bit,
String processName,
long svcBase,
int svcSize,
File rootDir,
Family family,
Collection<BackendFactory> backendFactories) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected abstract byte[] |
assemble(Iterable<String> assembly) |
Debugger |
attach() |
Debugger |
attach(DebuggerType type) |
void |
close() |
protected abstract void |
closeInternal() |
protected abstract Debugger |
createConsoleDebugger() |
protected abstract Dlfcn |
createDyld(SvcMemory svcMemory) |
protected abstract FileSystem<T> |
createFileSystem(File rootDir) |
protected abstract Memory |
createMemory(UnixSyscallHandler<T> syscallHandler,
String[] envs) |
protected abstract RegisterContext |
createRegisterContext(Backend backend) |
protected abstract UnixSyscallHandler<T> |
createSyscallHandler(SvcMemory svcMemory) |
protected ThreadDispatcher |
createThreadDispatcher() |
protected void |
dumpClass(String className) |
protected void |
dumpGPBProtobufMsg(String className) |
Number |
emulate(long begin,
long until) |
boolean |
emulateSignal(int sig)
emulate signal handler
|
<V> V |
get(String key) |
Backend |
getBackend() |
<V extends RegisterContext> |
getContext() |
Family |
getFamily() |
FileSystem<T> |
getFileSystem() |
int |
getPageAlign() |
protected abstract int |
getPageAlignInternal() |
int |
getPid() |
String |
getProcessName() |
abstract com.sun.jna.Pointer |
getStackPointer() |
SvcMemory |
getSvcMemory() |
ThreadDispatcher |
getThreadDispatcher() |
boolean |
is32Bit() |
boolean |
is64Bit() |
protected abstract boolean |
isPaddingArgument() |
boolean |
isRunning()
是否正在运行
|
void |
onSystemWrite(long addr,
byte[] data) |
int |
popContext() |
void |
pushContext(int off) |
protected Number |
runMainForResult(MainTask task) |
protected void |
searchClass(String keywords) |
void |
serialize(DataOutput out) |
void |
set(String key,
Object value) |
void |
setTimeout(long timeout) |
void |
setTraceSystemMemoryWrite(long begin,
long end,
TraceSystemMemoryWriteListener listener) |
TraceHook |
traceCode()
trace instruction
note: low performance
|
TraceHook |
traceCode(long begin,
long end) |
TraceHook |
traceCode(long begin,
long end,
TraceCodeListener listener) |
TraceHook |
traceRead()
trace memory read
|
TraceHook |
traceRead(long begin,
long end) |
TraceHook |
traceRead(long begin,
long end,
TraceReadListener listener) |
TraceHook |
traceWrite()
trace memory write
|
TraceHook |
traceWrite(long begin,
long end) |
TraceHook |
traceWrite(long begin,
long end,
TraceWriteListener listener) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateURLibraryFile, eEntry, eFunc, getDlfcn, getMemory, getPointerSize, getReturnAddress, getSyscallHandler, getUnwinder, loadLibrary, loadLibrary, showRegs, showRegsdisassemble, disassemble, printAssemblepublic static final long DEFAULT_TIMEOUT
protected final Backend backend
protected long timeout
protected final SvcMemory svcMemory
protected final DateFormat dateFormat
public AbstractEmulator(boolean is64Bit,
String processName,
long svcBase,
int svcSize,
File rootDir,
Family family,
Collection<BackendFactory> backendFactories)
protected ThreadDispatcher createThreadDispatcher()
public final int getPageAlign()
getPageAlign 在接口中 Emulator<T extends NewFileIO>protected abstract int getPageAlignInternal()
public final SvcMemory getSvcMemory()
getSvcMemory 在接口中 Emulator<T extends NewFileIO>public final FileSystem<T> getFileSystem()
getFileSystem 在接口中 Emulator<T extends NewFileIO>protected abstract FileSystem<T> createFileSystem(File rootDir)
protected abstract RegisterContext createRegisterContext(Backend backend)
public <V extends RegisterContext> V getContext()
getContext 在接口中 Emulator<T extends NewFileIO>protected abstract Memory createMemory(UnixSyscallHandler<T> syscallHandler, String[] envs)
protected abstract UnixSyscallHandler<T> createSyscallHandler(SvcMemory svcMemory)
protected abstract Debugger createConsoleDebugger()
public final TraceHook traceRead(long begin, long end)
public TraceHook traceRead(long begin, long end, TraceReadListener listener)
public final TraceHook traceWrite(long begin, long end)
traceWrite 在接口中 Emulator<T extends NewFileIO>public void setTraceSystemMemoryWrite(long begin,
long end,
TraceSystemMemoryWriteListener listener)
setTraceSystemMemoryWrite 在接口中 Emulator<T extends NewFileIO>public void onSystemWrite(long addr,
byte[] data)
onSystemWrite 在接口中 MemoryWriteListenerpublic TraceHook traceWrite(long begin, long end, TraceWriteListener listener)
traceWrite 在接口中 Emulator<T extends NewFileIO>public final TraceHook traceWrite()
EmulatortraceWrite 在接口中 Emulator<T extends NewFileIO>public final TraceHook traceCode()
Emulatorpublic final TraceHook traceCode(long begin, long end)
public TraceHook traceCode(long begin, long end, TraceCodeListener listener)
public void setTimeout(long timeout)
setTimeout 在接口中 Emulator<T extends NewFileIO>timeout - Duration to emulate the code (in microseconds). When this value is 0, we will emulate the code in infinite time, until the code is finished.public boolean isRunning()
Emulatorpublic ThreadDispatcher getThreadDispatcher()
getThreadDispatcher 在接口中 Emulator<T extends NewFileIO>public boolean emulateSignal(int sig)
EmulatoremulateSignal 在接口中 Emulator<T extends NewFileIO>sig - signal numbertrue means called handler function.public final Number emulate(long begin, long until) throws PopContextException
null表示执行未完成,需要线程调度PopContextExceptionpublic abstract com.sun.jna.Pointer getStackPointer()
public final void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionprotected abstract void closeInternal()
public Backend getBackend()
getBackend 在接口中 Emulator<T extends NewFileIO>public String getProcessName()
getProcessName 在接口中 Emulator<T extends NewFileIO>protected abstract boolean isPaddingArgument()
protected void dumpClass(String className)
protected void searchClass(String keywords)
protected void dumpGPBProtobufMsg(String className)
public final void serialize(DataOutput out) throws IOException
serialize 在接口中 SerializableIOExceptionpublic void pushContext(int off)
pushContext 在接口中 Emulator<T extends NewFileIO>public int popContext()
popContext 在接口中 Emulator<T extends NewFileIO>Copyright © 2022. All rights reserved.