about summary refs log tree commit diff stats
path: root/src/wrapped/wrappedlibc.c
diff options
context:
space:
mode:
authorwannacu <76616478+wannacu@users.noreply.github.com>2023-10-27 16:43:06 +0800
committerGitHub <noreply@github.com>2023-10-27 10:43:06 +0200
commit81ca3cd06e17e33c4f19d4aa52030b53cb9f6e42 (patch)
tree23b96a643d1ef2195f2f9b763839e86b48bc4bde /src/wrapped/wrappedlibc.c
parentf8d65a831e6f92314513ab2603e74627bbc1711f (diff)
downloadbox64-81ca3cd06e17e33c4f19d4aa52030b53cb9f6e42.tar.gz
box64-81ca3cd06e17e33c4f19d4aa52030b53cb9f6e42.zip
[WRAPPER] Fixed my_execl (#1044)
* [WRAPPER] Fixed my_execl

* [ARM64_DYNAREC] Added 66 0F 17 and Fixed 66 0F 21
Diffstat (limited to 'src/wrapped/wrappedlibc.c')
-rw-r--r--src/wrapped/wrappedlibc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 47c6da19..d78b6ecb 100644
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -2090,7 +2090,12 @@ EXPORT int32_t my_execl(x64emu_t* emu, const char* path)
         newargv[j++] = getVargN(emu, k+1);
     if(self) newargv[1] = emu->context->fullpath;
     printf_log(LOG_DEBUG, " => execle(\"%s\", %p [\"%s\", \"%s\"...:%d])\n", newargv[0], newargv, newargv[1], i?newargv[2]:"", i);
-    int ret = execv(newargv[0], newargv);
+    int ret = 0;
+    if (!(x64 || x86 || script || self)) {
+        ret = execv(path, newargv);
+    } else {
+        ret = execv(newargv[0], newargv);
+    }
     box_free(newargv);
     return ret;
 }