public abstract class AbstractLoader<T extends NewFileIO> extends Object implements Memory, Loader
| Modifier and Type | Field and Description |
|---|---|
protected Backend |
backend |
protected boolean |
callInitFunction |
protected Emulator<T> |
emulator |
protected List<HookListener> |
hookListeners |
protected LibraryResolver |
libraryResolver |
protected Map<Long,MemoryMap> |
memoryMap |
protected long |
mmapBaseAddress |
protected MMapListener |
mMapListener |
protected List<ModuleListener> |
moduleListeners |
protected long |
sp |
protected int |
stackSize |
protected UnixSyscallHandler<T> |
syscallHandler |
protected Boolean[] |
threadStackMap |
MAX_THREADS, MMAP_BASE, STACK_BASE, STACK_SIZE_OF_MAIN_PAGE, STACK_SIZE_OF_PAGE, STACK_SIZE_OF_THREAD_PAGE| Constructor and Description |
|---|
AbstractLoader(Emulator<T> emulator,
UnixSyscallHandler<T> syscallHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHookListener(HookListener listener) |
void |
addModuleListener(ModuleListener listener) |
protected long |
allocateMapAddress(long mask,
long length) |
UnidbgPointer |
allocateStack(int size) |
int |
allocateThreadIndex() |
UnidbgPointer |
allocateThreadStack(int index) |
protected abstract LibraryFile |
createLibraryFile(File file) |
void |
disableCallInitFunction() |
protected void |
dump(com.sun.jna.Pointer pointer,
long size,
File outFile) |
Module |
findModule(String name) |
Module |
findModuleByAddress(long address) |
void |
freeThreadIndex(int index) |
Collection<MemoryMap> |
getMemoryMap() |
MMapListener |
getMMapListener() |
protected long |
getModuleBase(Module module) |
long |
getStackBase() |
long |
getStackPoint() |
int |
getStackSize() |
Module |
load(File elfFile) |
Module |
load(File elfFile,
boolean forceCallInit) |
Module |
load(LibraryFile libraryFile) |
Module |
load(LibraryFile libraryFile,
boolean forceCallInit) |
protected abstract Module |
loadInternal(LibraryFile libraryFile,
boolean forceCallInit) |
Module |
loadVirtualModule(String name,
Map<String,UnidbgPointer> symbols)
加载虚拟模块
|
protected Alignment |
mem_map(long address,
long size,
int prot,
String libraryName,
long align) |
UnidbgPointer |
mmap(int length,
int prot) |
int |
mprotect(long address,
int length,
int prot) |
int |
munmap(long start,
int length) |
protected void |
notifyModuleLoaded(Module module) |
UnidbgPointer |
pointer(long address) |
void |
serialize(DataOutput out) |
void |
setCallInitFunction(boolean callInit) |
void |
setLibraryResolver(LibraryResolver libraryResolver) |
protected void |
setMMapBaseAddress(long address) |
void |
setMMapListener(MMapListener listener) |
void |
setStackPoint(long sp) |
UnidbgPointer |
writeStackBytes(byte[] data) |
UnidbgPointer |
writeStackString(String str) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbrk, getLastErrno, malloc, mmap2, setErrnodlclose, dlopen, dlopen, dlsym, getLoadedModules, getMaxLengthLibraryName, getMaxSizeOfLibraryprotected final Backend backend
protected final UnixSyscallHandler<T extends NewFileIO> syscallHandler
protected long sp
protected long mmapBaseAddress
protected Boolean[] threadStackMap
protected MMapListener mMapListener
protected boolean callInitFunction
protected final List<HookListener> hookListeners
protected LibraryResolver libraryResolver
protected int stackSize
protected final List<ModuleListener> moduleListeners
public AbstractLoader(Emulator<T> emulator, UnixSyscallHandler<T> syscallHandler)
public int allocateThreadIndex()
allocateThreadIndex in interface Memorypublic void freeThreadIndex(int index)
freeThreadIndex in interface Memorypublic UnidbgPointer allocateThreadStack(int index)
allocateThreadStack in interface Memorypublic void setMMapListener(MMapListener listener)
setMMapListener in interface Memorypublic MMapListener getMMapListener()
getMMapListener in interface Memoryprotected void setMMapBaseAddress(long address)
public Collection<MemoryMap> getMemoryMap()
getMemoryMap in interface Memorypublic final UnidbgPointer mmap(int length, int prot)
protected final long allocateMapAddress(long mask,
long length)
public final int mprotect(long address,
int length,
int prot)
public final Module load(LibraryFile libraryFile)
protected abstract LibraryFile createLibraryFile(File file)
public final Module load(LibraryFile libraryFile, boolean forceCallInit)
protected abstract Module loadInternal(LibraryFile libraryFile, boolean forceCallInit)
public final void disableCallInitFunction()
disableCallInitFunction in interface Loaderpublic void setCallInitFunction(boolean callInit)
setCallInitFunction in interface Loaderpublic final void addHookListener(HookListener listener)
addHookListener in interface Loaderpublic void setLibraryResolver(LibraryResolver libraryResolver)
setLibraryResolver in interface Loaderpublic final UnidbgPointer allocateStack(int size)
allocateStack in interface Memorypublic final UnidbgPointer writeStackString(String str)
writeStackString in interface StackMemorypublic final UnidbgPointer writeStackBytes(byte[] data)
writeStackBytes in interface StackMemorypublic final UnidbgPointer pointer(long address)
public long getStackBase()
getStackBase in interface Memorypublic int getStackSize()
getStackSize in interface Memorypublic final void setStackPoint(long sp)
setStackPoint in interface Memorypublic long getStackPoint()
getStackPoint in interface Memorypublic final void addModuleListener(ModuleListener listener)
addModuleListener in interface Loaderprotected final void notifyModuleLoaded(Module module)
protected final void dump(com.sun.jna.Pointer pointer,
long size,
File outFile)
throws IOException
IOExceptionprotected final Alignment mem_map(long address, long size, int prot, String libraryName, long align)
public final Module findModuleByAddress(long address)
findModuleByAddress in interface Loaderprotected long getModuleBase(Module module)
public final Module findModule(String name)
findModule in interface Loaderpublic Module loadVirtualModule(String name, Map<String,UnidbgPointer> symbols)
LoaderloadVirtualModule in interface Loaderpublic void serialize(DataOutput out) throws IOException
serialize in interface SerializableIOExceptionCopyright © 2026. All rights reserved.