From afa771a98051e9f8f055b6db10adeb22331390b9 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Thu, 17 Feb 2022 07:16:41 +0800 Subject: [PATCH] Set dlopen reserved size to unlimited --- native/jni/zygisk/entry.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/native/jni/zygisk/entry.cpp b/native/jni/zygisk/entry.cpp index ce3ae7fd8..aa277f067 100644 --- a/native/jni/zygisk/entry.cpp +++ b/native/jni/zygisk/entry.cpp @@ -112,9 +112,9 @@ static void first_stage_entry() { info.reserved_addr = addr; // The existing address is guaranteed to fit, as 1st stage and 2nd stage // are exactly the same ELF (same inode). However, the linker could over - // estimate the required size and refuse to dlopen. Add 2 more page_sizes - // (one at the beginning and one at the end) as a safety measure. - info.reserved_size = size + 2 * 4096; + // estimate the required size and refuse to dlopen. The estimated size + // is not accurate so size the size to unlimited. + info.reserved_size = -1; } setenv(INJECT_ENV_2, "1", 1);