You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
fix: not dropping SoInfo of unclosed modules; fix: not performing maps spoofing (#187)
This commit fixes the issue where unclosed modules, as in not being requested to be "dlclose"d, wouldn't have their SoInfo structures freed. It also fixes the issue of maps spoofing not being performed due to the "spoof_maps" parameter being erroneously set to false in the second "clean_trace" call.
This commit is contained in:
@@ -711,10 +711,10 @@ void ZygiskContext::run_modules_post() {
|
|||||||
|
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
for (const auto &m : modules) {
|
for (const auto &m : modules) {
|
||||||
module_addrs[i++] = m.getHandle();
|
module_addrs[i++] = m.getEntry();
|
||||||
}
|
}
|
||||||
|
|
||||||
clean_trace("/data/adb", module_addrs, modules.size(), modules.size(), modules_unloaded, false);
|
clean_trace("/data/adb", module_addrs, modules.size(), modules.size(), modules_unloaded, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -948,8 +948,8 @@ void clean_trace(const char *path, void **module_addrs, size_t module_addrs_leng
|
|||||||
mprotect(addr, size, PROT_READ);
|
mprotect(addr, size, PROT_READ);
|
||||||
}
|
}
|
||||||
memcpy(copy, addr, size);
|
memcpy(copy, addr, size);
|
||||||
|
mprotect(copy, size, map.perms);
|
||||||
mremap(copy, size, size, MREMAP_MAYMOVE | MREMAP_FIXED, addr);
|
mremap(copy, size, size, MREMAP_MAYMOVE | MREMAP_FIXED, addr);
|
||||||
mprotect(addr, size, map.perms);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ case 5: \
|
|||||||
bool tryUnload() const { return unload && dlclose(handle) == 0; };
|
bool tryUnload() const { return unload && dlclose(handle) == 0; };
|
||||||
void clearApi() { memset(&api, 0, sizeof(api)); }
|
void clearApi() { memset(&api, 0, sizeof(api)); }
|
||||||
int getId() const { return id; }
|
int getId() const { return id; }
|
||||||
void *getHandle() const { return handle; }
|
void *getEntry() const { return entry.ptr; }
|
||||||
|
|
||||||
ZygiskModule(int id, void *handle, void *entry);
|
ZygiskModule(int id, void *handle, void *entry);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user