From 52d86177c5d7e70df4018ec8c9ef7a7da5bf030a Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 7 Jun 2021 18:36:25 +0200 Subject: Added wrapped execv family functions --- src/wrapped/generated/functions_list.txt | 2 ++ src/wrapped/generated/wrappedlibctypes.h | 2 ++ src/wrapped/wrappedlibc.c | 4 ++-- src/wrapped/wrappedlibc_private.h | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt index 890960b1..d3b2636e 100644 --- a/src/wrapped/generated/functions_list.txt +++ b/src/wrapped/generated/functions_list.txt @@ -1414,6 +1414,7 @@ wrappedlibc: - iFpp: - __vprintf_chk - dl_iterate_phdr + - execv - execvp - sigaltstack - swapcontext @@ -1470,6 +1471,7 @@ wrappedlibc: - __isoc99_vsscanf - __vfprintf_chk - __vsscanf + - execve - vasprintf - vfprintf - vsscanf diff --git a/src/wrapped/generated/wrappedlibctypes.h b/src/wrapped/generated/wrappedlibctypes.h index 68d4f6e5..e011448e 100644 --- a/src/wrapped/generated/wrappedlibctypes.h +++ b/src/wrapped/generated/wrappedlibctypes.h @@ -82,6 +82,7 @@ typedef int64_t (*iFpippppp_t)(void*, int64_t, void*, void*, void*, void*, void* GO(munmap, iFpL_t) \ GO(__vprintf_chk, iFpp_t) \ GO(dl_iterate_phdr, iFpp_t) \ + GO(execv, iFpp_t) \ GO(execvp, iFpp_t) \ GO(sigaltstack, iFpp_t) \ GO(swapcontext, iFpp_t) \ @@ -122,6 +123,7 @@ typedef int64_t (*iFpippppp_t)(void*, int64_t, void*, void*, void*, void*, void* GO(__isoc99_vsscanf, iFppp_t) \ GO(__vfprintf_chk, iFppp_t) \ GO(__vsscanf, iFppp_t) \ + GO(execve, iFppp_t) \ GO(vasprintf, iFppp_t) \ GO(vfprintf, iFppp_t) \ GO(vsscanf, iFppp_t) \ diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 48b6591b..d1426c18 100755 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -1501,7 +1501,7 @@ EXPORT int32_t my_execv(x64emu_t* emu, const char* path, char* const argv[]) #if 1 if (x86 || self) { int skip_first = 0; - if(strlen(path)>=strlen("wine-preloader") && strcmp(path+strlen(path)-strlen("wine-preloader"), "wine-preloader")==0) + if(strlen(path)>=strlen("wine64-preloader") && strcmp(path+strlen(path)-strlen("wine64-preloader"), "wine64-preloader")==0) skip_first++; // count argv... int n=skip_first; @@ -1527,7 +1527,7 @@ EXPORT int32_t my_execve(x64emu_t* emu, const char* path, char* const argv[], ch #if 1 if (x86 || self) { int skip_first = 0; - if(strlen(path)>=strlen("wine-preloader") && strcmp(path+strlen(path)-strlen("wine-preloader"), "wine-preloader")==0) + if(strlen(path)>=strlen("wine64-preloader") && strcmp(path+strlen(path)-strlen("wine64-preloader"), "wine64-preloader")==0) skip_first++; // count argv... int n=skip_first; diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h index 52599e3a..0263d38f 100755 --- a/src/wrapped/wrappedlibc_private.h +++ b/src/wrapped/wrappedlibc_private.h @@ -292,8 +292,8 @@ GO(eventfd_write, iFiU) //GO(execl, //GO(execle, GOM(execlp, iFEpV) -//GO(execv, -//GOW(execve, +GOM(execv, iFEpp) +GOM(execve, iFEppp) //Weak GOM(execvp, iFEpp) //GOW(execvpe, GO(_exit, vFi) -- cgit 1.4.1