diff options
Diffstat (limited to 'src/wrapped')
| -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.c | 9 | ||||
| -rwxr-xr-x | src/wrapped/wrappedlibc_private.h | 15 |
5 files changed, 18 insertions, 10 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt index 1a50a2f1..7dcdcc32 100644 --- a/src/wrapped/generated/functions_list.txt +++ b/src/wrapped/generated/functions_list.txt @@ -256,7 +256,6 @@ #() iFppd #() iFppL #() iFppp -#() iFppV #() iFSpL #() IFiIi #() IFpIi diff --git a/src/wrapped/generated/wrapper.c b/src/wrapped/generated/wrapper.c index 59db1f3e..6924df29 100644 --- a/src/wrapped/generated/wrapper.c +++ b/src/wrapped/generated/wrapper.c @@ -289,7 +289,6 @@ typedef int32_t (*iFppu_t)(void*, void*, uint32_t); typedef int32_t (*iFppd_t)(void*, void*, double); typedef int32_t (*iFppL_t)(void*, void*, uintptr_t); typedef int32_t (*iFppp_t)(void*, void*, void*); -typedef int32_t (*iFppV_t)(void*, void*, void*); typedef int32_t (*iFSpL_t)(void*, void*, uintptr_t); typedef int64_t (*IFiIi_t)(int32_t, int64_t, int32_t); typedef int64_t (*IFpIi_t)(void*, int64_t, int32_t); @@ -1320,7 +1319,6 @@ void iFppu(x64emu_t *emu, uintptr_t fcn) { iFppu_t fn = (iFppu_t)fcn; R_RAX=fn(( void iFppd(x64emu_t *emu, uintptr_t fcn) { iFppd_t fn = (iFppd_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0]); } void iFppL(x64emu_t *emu, uintptr_t fcn) { iFppL_t fn = (iFppL_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } void iFppp(x64emu_t *emu, uintptr_t fcn) { iFppp_t fn = (iFppp_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } -void iFppV(x64emu_t *emu, uintptr_t fcn) { iFppV_t fn = (iFppV_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); } void iFSpL(x64emu_t *emu, uintptr_t fcn) { iFSpL_t fn = (iFSpL_t)fcn; R_RAX=fn(io_convert((void*)R_RDI), (void*)R_RSI, (uintptr_t)R_RDX); } void IFiIi(x64emu_t *emu, uintptr_t fcn) { IFiIi_t fn = (IFiIi_t)fcn; R_RAX=(uint64_t)fn((int32_t)R_RDI, (int64_t)R_RSI, (int32_t)R_RDX); } void IFpIi(x64emu_t *emu, uintptr_t fcn) { IFpIi_t fn = (IFpIi_t)fcn; R_RAX=(uint64_t)fn((void*)R_RDI, (int64_t)R_RSI, (int32_t)R_RDX); } diff --git a/src/wrapped/generated/wrapper.h b/src/wrapped/generated/wrapper.h index a908a234..bd960aff 100644 --- a/src/wrapped/generated/wrapper.h +++ b/src/wrapped/generated/wrapper.h @@ -286,7 +286,6 @@ void iFppu(x64emu_t *emu, uintptr_t fnc); void iFppd(x64emu_t *emu, uintptr_t fnc); void iFppL(x64emu_t *emu, uintptr_t fnc); void iFppp(x64emu_t *emu, uintptr_t fnc); -void iFppV(x64emu_t *emu, uintptr_t fnc); void iFSpL(x64emu_t *emu, uintptr_t fnc); void IFiIi(x64emu_t *emu, uintptr_t fnc); void IFpIi(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 21329bef..1662f1bf 100755 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -758,8 +758,15 @@ EXPORT int my__IO_vfscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __att EXPORT int my___isoc99_vsscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my_vsscanf"))); EXPORT int my___isoc99_vfscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my_vfscanf"))); -EXPORT int my___isoc99_fscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my_vfscanf"))); #endif +EXPORT int my___isoc99_fscanf(x64emu_t* emu, void* stream, void* fmt, uint64_t* b) +{ + myStackAlignScanf(emu, (const char*)fmt, b, emu->scratch, 2); + PREPARE_VALIST; + + return vfscanf(stream, fmt, VARARGS); +} + EXPORT int my___isoc99_sscanf(x64emu_t* emu, void* stream, void* fmt, uint64_t* b) { myStackAlignScanf(emu, (const char*)fmt, b, emu->scratch, 2); diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h index fc1273be..4e2666d7 100755 --- a/src/wrapped/wrappedlibc_private.h +++ b/src/wrapped/wrappedlibc_private.h @@ -243,6 +243,7 @@ GOW(duplocale, pFp) //GO(endusershell, //GOW(endutent, //GO(endutxent, +DATA(environ, sizeof(void*)) DATAB(__environ, sizeof(void*)) //GO(envz_add, //GO(envz_entry, @@ -680,6 +681,8 @@ GO(iconv_open, LFpp) //GOW(if_nametoindex, //GOW(imaxabs, //GOW(imaxdiv, +DATA(in6addr_any, 16) // type V +DATA(in6addr_loopback, 16) //type V //GOI(index, //GO(inet6_opt_append, //GO(inet6_opt_find, @@ -903,10 +906,10 @@ GO(__isnanf, iFf) GOW(isnanf, iFf) //GO(__isnanl, //GOW(isnanl, -//GO(__isoc99_fscanf, +GOM(__isoc99_fscanf, iFEppV) //GO(__isoc99_fwscanf, //GO(__isoc99_scanf, -GOM(__isoc99_sscanf, iFppV) +GOM(__isoc99_sscanf, iFEppV) //GO(__isoc99_swscanf, //GO(__isoc99_vfscanf, //GO(__isoc99_vfwscanf, @@ -1357,8 +1360,8 @@ GOM(__printf_chk, iFEipV) //GO(process_vm_writev, //GOW(profil, //GO(__profile_frequency, -//DATA(__progname, -//DATA(__progname_full, +DATA(__progname, sizeof(void*)) +DATA(__progname_full, sizeof(void)) //GOW(pselect, //GO(psiginfo, //GO(psignal, @@ -1961,6 +1964,7 @@ GO(timerfd_settime, iFiipp) //GOW(times, //GO(timespec_get, DATAB(__timezone, sizeof(void*)) +DATAV(timezone, sizeof(void*)) //type V GO(tmpfile, pFv) GOW(tmpfile64, pFv) GO(tmpnam, pFp) @@ -1996,7 +2000,8 @@ GOW(truncate64, iFpI) //GO(ttyslot, //GO(__twalk, //GOW(twalk, -DATA(__tzname, 8) +DATA(__tzname, sizeof(void*)) +DATA(tzname, sizeof(void*)) //type V GOW(tzset, vFv) //GO(ualarm, //GO(__uflow, |