diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-03-09 09:34:31 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-03-09 09:34:31 +0100 |
| commit | de8a3de7aefa7f9668d60a9fb46d096d536a4de3 (patch) | |
| tree | f6c3e36ba38903445491ef35b88bd67ef7a78fbd /src | |
| parent | cdd33ffec4ce977b77aa3b915c48419da827b44c (diff) | |
| download | box64-de8a3de7aefa7f9668d60a9fb46d096d536a4de3.tar.gz box64-de8a3de7aefa7f9668d60a9fb46d096d536a4de3.zip | |
Added some more libc wrapped functions
Diffstat (limited to 'src')
| -rw-r--r-- | src/wrapped/generated/functions_list.txt | 1 | ||||
| -rw-r--r-- | src/wrapped/generated/wrapper.c | 2 | ||||
| -rw-r--r-- | src/wrapped/generated/wrapper.h | 1 | ||||
| -rwxr-xr-x | src/wrapped/wrappedlibc_private.h | 76 |
4 files changed, 39 insertions, 41 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt index 05ea550d..aa98667d 100644 --- a/src/wrapped/generated/functions_list.txt +++ b/src/wrapped/generated/functions_list.txt @@ -34,6 +34,7 @@ #() dFi #() dFd #() dFp +#() lFi #() lFp #() LFv #() LFp diff --git a/src/wrapped/generated/wrapper.c b/src/wrapped/generated/wrapper.c index f0e82962..b80d841e 100644 --- a/src/wrapped/generated/wrapper.c +++ b/src/wrapped/generated/wrapper.c @@ -67,6 +67,7 @@ typedef float (*fFp_t)(void*); typedef double (*dFi_t)(int32_t); typedef double (*dFd_t)(double); typedef double (*dFp_t)(void*); +typedef intptr_t (*lFi_t)(int32_t); typedef intptr_t (*lFp_t)(void*); typedef uintptr_t (*LFv_t)(void); typedef uintptr_t (*LFp_t)(void*); @@ -899,6 +900,7 @@ void fFp(x64emu_t *emu, uintptr_t fcn) { fFp_t fn = (fFp_t)fcn; emu->xmm[0].f[0] void dFi(x64emu_t *emu, uintptr_t fcn) { dFi_t fn = (dFi_t)fcn; emu->xmm[0].d[0]=fn((int32_t)R_RDI); } void dFd(x64emu_t *emu, uintptr_t fcn) { dFd_t fn = (dFd_t)fcn; emu->xmm[0].d[0]=fn(emu->xmm[0].d[0]); } void dFp(x64emu_t *emu, uintptr_t fcn) { dFp_t fn = (dFp_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI); } +void lFi(x64emu_t *emu, uintptr_t fcn) { lFi_t fn = (lFi_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI); } void lFp(x64emu_t *emu, uintptr_t fcn) { lFp_t fn = (lFp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI); } void LFv(x64emu_t *emu, uintptr_t fcn) { LFv_t fn = (LFv_t)fcn; R_RAX=(uintptr_t)fn(); } void LFp(x64emu_t *emu, uintptr_t fcn) { LFp_t fn = (LFp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI); } diff --git a/src/wrapped/generated/wrapper.h b/src/wrapped/generated/wrapper.h index 3825f939..c5295024 100644 --- a/src/wrapped/generated/wrapper.h +++ b/src/wrapped/generated/wrapper.h @@ -64,6 +64,7 @@ void fFp(x64emu_t *emu, uintptr_t fnc); void dFi(x64emu_t *emu, uintptr_t fnc); void dFd(x64emu_t *emu, uintptr_t fnc); void dFp(x64emu_t *emu, uintptr_t fnc); +void lFi(x64emu_t *emu, uintptr_t fnc); void lFp(x64emu_t *emu, uintptr_t fnc); void LFv(x64emu_t *emu, uintptr_t fnc); void LFp(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h index bea70d25..85ed0554 100755 --- a/src/wrapped/wrappedlibc_private.h +++ b/src/wrapped/wrappedlibc_private.h @@ -1738,37 +1738,37 @@ DATA(stdout, sizeof(void*)) //GOW(step, //GO(stime, //GOI(__stpcpy, -//GOI(stpcpy, -//GO(__stpcpy_chk, +GO(stpcpy, pFpp) +GO(__stpcpy_chk, pFppL) //GO(__stpcpy_small, -//GOI(__stpncpy, -//GOI(stpncpy, -//GO(__stpncpy_chk, -//GOI(__strcasecmp, -//GOI(strcasecmp, +GO(__stpncpy, pFppL) +GOW(stpncpy, pFppL) +GO(__stpncpy_chk, pFppLL) +GO(__strcasecmp, iFpp) +GO(strcasecmp, iFpp) //GOI(__strcasecmp_l, //GOI(strcasecmp_l, -//GO(__strcasestr, -//GOW(strcasestr, -//GOI(strcat, -//GO(__strcat_chk, -//GOI(strchr, -//GOI(strchrnul, +GO(__strcasestr, pFpp) +GOW(strcasestr, pFpp) +GO(strcat, pFpp) +GO(__strcat_chk, pFppL) +GO(strchr, pFpi) +GO(strchrnul, pFpi) GO(strcmp, iFpp) -//GO(strcoll, -//GO(__strcoll_l, -//GOW(strcoll_l, -//GOI(strcpy, -//GO(__strcpy_chk, +GO(strcoll, iFpp) +GO(__strcoll_l, iFppp) +GOW(strcoll_l, iFppp) +GO(strcpy, pFpp) +GO(__strcpy_chk, pFppL) //GO(__strcpy_small, -//GOI(strcspn, +GO(strcspn, LFpp) //GO(__strcspn_c1, //GO(__strcspn_c2, //GO(__strcspn_c3, -//GO(__strdup, -//GOW(strdup, -//GO(strerror, -//GO(strerror_l, +GO(__strdup, pFp) +GOW(strdup, pFp) +GO(strerror, pFi) +GO(strerror_l, pFip) //GO(__strerror_r, //GOW(strerror_r, //GO(strfmon, @@ -1913,18 +1913,12 @@ GOM(swapcontext, iFEpp) //Weak //GO(sync_file_range, //GO(syncfs, GOM(syscall, iFEv) -//GO(__sysconf, -//GOW(sysconf, +GO(__sysconf, lFi) +GOW(sysconf, lFi) //GO(__sysctl, //GOW(sysctl, -//DATA(_sys_errlist, -//DATA(_sys_errlist, -//DATA(_sys_errlist, -//DATA(_sys_errlist, -//DATA(sys_errlist, -//DATA(sys_errlist, -//DATA(sys_errlist, -//DATA(sys_errlist, +DATA(_sys_errlist, sizeof(void*)) +DATA(sys_errlist, sizeof(void*)) //GOW(sysinfo, //GO(syslog, //GO(__syslog_chk, @@ -1959,20 +1953,20 @@ GOM(__sysv_signal, pFip) //GO(thrd_equal, //GO(thrd_sleep, //GO(thrd_yield, -//GOI(time, -//GO(timegm, +GO(time, LFp) +GO(timegm, LFp) //GOW(timelocal, //GO(timerfd_create, //GO(timerfd_gettime, //GO(timerfd_settime, //GOW(times, //GO(timespec_get, -//DATAB(__timezone, -//GO(tmpfile, -//GOW(tmpfile64, -//GO(tmpnam, -//GO(tmpnam_r, -//GO(toascii, +DATAB(__timezone, sizeof(void*)) +GO(tmpfile, pFv) +GOW(tmpfile64, pFv) +GO(tmpnam, pFp) +GO(tmpnam_r, pFp) +GO(toascii, iFi) //GOW(__toascii_l, //GO(_tolower, //GO(tolower, |