From 5e54ccdd8fc74821520b3667fd03a46d6323bc2a Mon Sep 17 00:00:00 2001 From: CubicStone31 Date: Wed, 23 Feb 2022 20:29:20 +0800 Subject: [PATCH] fix target crash issue caused by movaps alignment requirement --- inject-x86_64.c | 1 + 1 file changed, 1 insertion(+) diff --git a/inject-x86_64.c b/inject-x86_64.c index e6506aa..5388875 100644 --- a/inject-x86_64.c +++ b/inject-x86_64.c @@ -35,6 +35,7 @@ void injectSharedLibrary(long mallocaddr, long freeaddr, long dlopenaddr) // save addresses of free() and __libc_dlopen_mode() on the stack for later use asm( + "and $0xfffffffffffff000, %rsp \n" // rsi is going to contain the address of free(). it's going to get wiped // out by the call to malloc(), so save it on the stack for later "push %rsi \n"