[core] Fix `failed to open [anon:linker_alloc]` (#1082)

Fix LSPosed/LSPatch#17
This commit is contained in:
LoveSy 2021-09-08 23:45:28 +08:00 committed by GitHub
parent b49aa00df5
commit 6a2e53134f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -228,7 +228,7 @@ bool ElfImg::findModuleBase() {
while (fgets(buff, sizeof(buff), maps)) {
if ((strstr(buff, "r-xp") || strstr(buff, "r--p")) && strstr(buff, elf.data())) {
if ((buff[0] == '/' && (strstr(buff, "r-xp") || strstr(buff, "r--p"))) && strstr(buff, elf.data())) {
found = 1;
LOGD("found: %s", buff);
std::string_view b = buff;

View File

@ -67,7 +67,7 @@ namespace lspd {
void InitSymbolCache() {
LOGD("InitSymbolCache");
sym_initialized = FindLibArt();
sym_do_dlopen = SandHook::ElfImg("linker").getSymbAddress<void *>(
sym_do_dlopen = SandHook::ElfImg("/linker").getSymbAddress<void *>(
"__dl__Z9do_dlopenPKciPK17android_dlextinfoPKv");
if (!sym_initialized) [[unlikely]] {
sym_initialized = false;