Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Fix next offset on Android 9
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 authored and RikkaW committed Mar 22, 2021
1 parent 97d20b8 commit 237850a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion riru/src/main/cpp/hide_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ namespace Hide {
static bool setup(const SandHook::ElfImg &linker) {
get_realpath_sym = reinterpret_cast<decltype(get_realpath_sym)>(linker.getSymbAddress(
"__dl__ZNK6soinfo12get_realpathEv"));
auto vsdo = *reinterpret_cast<soinfo **>(linker.getSymbAddress("__dl__ZL4vdso"));
for (size_t i = 0; i < 1024 / sizeof(void *); i++) {
if (*(void **) ((uintptr_t) solist + i * sizeof(void *)) == somain) {
auto *possible_next = *(void **) ((uintptr_t) solist + i * sizeof(void *));
if (possible_next == somain || (vsdo != nullptr && possible_next == vsdo)) {
solist_next_offset = i * sizeof(void *);
return AndroidProp::GetApiLevel() < 26 || get_realpath_sym != nullptr;
}
Expand Down

0 comments on commit 237850a

Please sign in to comment.