luoyesiqiu / local_dlfcn

读取本地so文件的符号的偏移

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

local_dlfcn

读取本地so文件的符号的偏移

用法

#ifdef __LP64__
    const char *lib_path = "/system/lib64/libc.so";
#else
    const char *lib_path = "/system/lib/libc.so";
#endif

const char *sym_name = "open";

struct local_dlfcn_handle *handle = static_cast<local_dlfcn_handle *>(local_dlopen(lib_path));
off_t offset = local_dlsym(handle,sym_name);
local_dlclose(handle);

感谢

About

读取本地so文件的符号的偏移


Languages

Language:C 48.3%Language:Java 22.2%Language:CMake 17.7%Language:C++ 11.8%