diff options
| -rw-r--r-- | src/wrapped/generated/functions_list.txt | 9 | ||||
| -rw-r--r-- | src/wrapped/generated/wrappedlibctypes.h | 7 | ||||
| -rw-r--r-- | src/wrapped/generated/wrapper.c | 4 | ||||
| -rw-r--r-- | src/wrapped/generated/wrapper.h | 2 | ||||
| -rwxr-xr-x | src/wrapped/wrappedlibc.c | 35 | ||||
| -rwxr-xr-x | src/wrapped/wrappedlibc_private.h | 8 |
6 files changed, 61 insertions, 4 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt index 55732c29..274f91b8 100644 --- a/src/wrapped/generated/functions_list.txt +++ b/src/wrapped/generated/functions_list.txt @@ -859,6 +859,7 @@ #() iFEiiN #() iFEipp #() iFEipV +#() iFEipA #() iFEupu #() iFEupp #() iFEpii @@ -1381,6 +1382,7 @@ #() vFppppp #() iFEiipp #() iFEiipV +#() iFEiipA #() iFEippi #() iFEippL #() iFEippp @@ -3700,6 +3702,9 @@ wrappedlibc: - sigaction - iFipV: - __printf_chk + - dprintf +- iFipA: + - vdprintf - iFpLi: - mprotect - iFppi: @@ -3763,6 +3768,10 @@ wrappedlibc: - epoll_ctl - iFiiiN: - semctl +- iFiipV: + - __dprintf_chk +- iFiipA: + - __vdprintf_chk - iFipii: - epoll_wait - iFippi: diff --git a/src/wrapped/generated/wrappedlibctypes.h b/src/wrapped/generated/wrappedlibctypes.h index 3b492850..4df5c085 100644 --- a/src/wrapped/generated/wrappedlibctypes.h +++ b/src/wrapped/generated/wrappedlibctypes.h @@ -42,6 +42,7 @@ typedef int32_t (*iFiip_t)(int32_t, int32_t, void*); typedef int32_t (*iFiiN_t)(int32_t, int32_t, ...); typedef int32_t (*iFipp_t)(int32_t, void*, void*); typedef int32_t (*iFipV_t)(int32_t, void*, ...); +typedef int32_t (*iFipA_t)(int32_t, void*, va_list); typedef int32_t (*iFpLi_t)(void*, uintptr_t, int32_t); typedef int32_t (*iFppi_t)(void*, void*, int32_t); typedef int32_t (*iFppp_t)(void*, void*, void*); @@ -59,6 +60,8 @@ typedef void (*vFiipA_t)(int32_t, int32_t, void*, va_list); typedef void (*vFpLLp_t)(void*, uintptr_t, uintptr_t, void*); typedef int32_t (*iFiiip_t)(int32_t, int32_t, int32_t, void*); typedef int32_t (*iFiiiN_t)(int32_t, int32_t, int32_t, ...); +typedef int32_t (*iFiipV_t)(int32_t, int32_t, void*, ...); +typedef int32_t (*iFiipA_t)(int32_t, int32_t, void*, va_list); typedef int32_t (*iFipii_t)(int32_t, void*, int32_t, int32_t); typedef int32_t (*iFippi_t)(int32_t, void*, void*, int32_t); typedef int32_t (*iFippL_t)(int32_t, void*, void*, uintptr_t); @@ -176,6 +179,8 @@ typedef int32_t (*iFppipppp_t)(void*, void*, int32_t, void*, void*, void*, void* GO(register_printf_specifier, iFipp_t) \ GO(sigaction, iFipp_t) \ GO(__printf_chk, iFipV_t) \ + GO(dprintf, iFipV_t) \ + GO(vdprintf, iFipA_t) \ GO(mprotect, iFpLi_t) \ GO(ftw, iFppi_t) \ GO(ftw64, iFppi_t) \ @@ -222,6 +227,8 @@ typedef int32_t (*iFppipppp_t)(void*, void*, int32_t, void*, void*, void*, void* GO(qsort, vFpLLp_t) \ GO(epoll_ctl, iFiiip_t) \ GO(semctl, iFiiiN_t) \ + GO(__dprintf_chk, iFiipV_t) \ + GO(__vdprintf_chk, iFiipA_t) \ GO(epoll_wait, iFipii_t) \ GO(fstatat, iFippi_t) \ GO(fstatat64, iFippi_t) \ diff --git a/src/wrapped/generated/wrapper.c b/src/wrapped/generated/wrapper.c index f9d142ae..e61365a1 100644 --- a/src/wrapped/generated/wrapper.c +++ b/src/wrapped/generated/wrapper.c @@ -895,6 +895,7 @@ typedef int32_t (*iFEiip_t)(x64emu_t*, int32_t, int32_t, void*); typedef int32_t (*iFEiiN_t)(x64emu_t*, int32_t, int32_t, ...); typedef int32_t (*iFEipp_t)(x64emu_t*, int32_t, void*, void*); typedef int32_t (*iFEipV_t)(x64emu_t*, int32_t, void*, void*); +typedef int32_t (*iFEipA_t)(x64emu_t*, int32_t, void*, void*); typedef int32_t (*iFEupu_t)(x64emu_t*, uint32_t, void*, uint32_t); typedef int32_t (*iFEupp_t)(x64emu_t*, uint32_t, void*, void*); typedef int32_t (*iFEpii_t)(x64emu_t*, void*, int32_t, int32_t); @@ -1417,6 +1418,7 @@ typedef void (*vFppppL_t)(void*, void*, void*, void*, uintptr_t); typedef void (*vFppppp_t)(void*, void*, void*, void*, void*); typedef int32_t (*iFEiipp_t)(x64emu_t*, int32_t, int32_t, void*, void*); typedef int32_t (*iFEiipV_t)(x64emu_t*, int32_t, int32_t, void*, void*); +typedef int32_t (*iFEiipA_t)(x64emu_t*, int32_t, int32_t, void*, void*); typedef int32_t (*iFEippi_t)(x64emu_t*, int32_t, void*, void*, int32_t); typedef int32_t (*iFEippL_t)(x64emu_t*, int32_t, void*, void*, uintptr_t); typedef int32_t (*iFEippp_t)(x64emu_t*, int32_t, void*, void*, void*); @@ -3695,6 +3697,7 @@ void iFEiip(x64emu_t *emu, uintptr_t fcn) { iFEiip_t fn = (iFEiip_t)fcn; R_RAX=( void iFEiiN(x64emu_t *emu, uintptr_t fcn) { iFEiiN_t fn = (iFEiiN_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } void iFEipp(x64emu_t *emu, uintptr_t fcn) { iFEipp_t fn = (iFEipp_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } void iFEipV(x64emu_t *emu, uintptr_t fcn) { iFEipV_t fn = (iFEipV_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); } +void iFEipA(x64emu_t *emu, uintptr_t fcn) { iFEipA_t fn = (iFEipA_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } void iFEupu(x64emu_t *emu, uintptr_t fcn) { iFEupu_t fn = (iFEupu_t)fcn; R_RAX=(int32_t)fn(emu, (uint32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } void iFEupp(x64emu_t *emu, uintptr_t fcn) { iFEupp_t fn = (iFEupp_t)fcn; R_RAX=(int32_t)fn(emu, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } void iFEpii(x64emu_t *emu, uintptr_t fcn) { iFEpii_t fn = (iFEpii_t)fcn; R_RAX=(int32_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } @@ -4217,6 +4220,7 @@ void vFppppL(x64emu_t *emu, uintptr_t fcn) { vFppppL_t fn = (vFppppL_t)fcn; fn(( void vFppppp(x64emu_t *emu, uintptr_t fcn) { vFppppp_t fn = (vFppppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } void iFEiipp(x64emu_t *emu, uintptr_t fcn) { iFEiipp_t fn = (iFEiipp_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } void iFEiipV(x64emu_t *emu, uintptr_t fcn) { iFEiipV_t fn = (iFEiipV_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); } +void iFEiipA(x64emu_t *emu, uintptr_t fcn) { iFEiipA_t fn = (iFEiipA_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } void iFEippi(x64emu_t *emu, uintptr_t fcn) { iFEippi_t fn = (iFEippi_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } void iFEippL(x64emu_t *emu, uintptr_t fcn) { iFEippL_t fn = (iFEippL_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } void iFEippp(x64emu_t *emu, uintptr_t fcn) { iFEippp_t fn = (iFEippp_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } diff --git a/src/wrapped/generated/wrapper.h b/src/wrapped/generated/wrapper.h index de78fc02..33431229 100644 --- a/src/wrapped/generated/wrapper.h +++ b/src/wrapped/generated/wrapper.h @@ -896,6 +896,7 @@ void iFEiip(x64emu_t *emu, uintptr_t fnc); void iFEiiN(x64emu_t *emu, uintptr_t fnc); void iFEipp(x64emu_t *emu, uintptr_t fnc); void iFEipV(x64emu_t *emu, uintptr_t fnc); +void iFEipA(x64emu_t *emu, uintptr_t fnc); void iFEupu(x64emu_t *emu, uintptr_t fnc); void iFEupp(x64emu_t *emu, uintptr_t fnc); void iFEpii(x64emu_t *emu, uintptr_t fnc); @@ -1418,6 +1419,7 @@ void vFppppL(x64emu_t *emu, uintptr_t fnc); void vFppppp(x64emu_t *emu, uintptr_t fnc); void iFEiipp(x64emu_t *emu, uintptr_t fnc); void iFEiipV(x64emu_t *emu, uintptr_t fnc); +void iFEiipA(x64emu_t *emu, uintptr_t fnc); void iFEippi(x64emu_t *emu, uintptr_t fnc); void iFEippL(x64emu_t *emu, uintptr_t fnc); void iFEippp(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 78f17f69..6052d964 100755 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -733,6 +733,41 @@ EXPORT int my___vfwprintf_chk(x64emu_t *emu, void* F, int flag, void* fmt, x64_v return vfwprintf(F, fmt, VARARGS); } +EXPORT int my_dprintf(x64emu_t *emu, int d, void* fmt, void* b) { + myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 2); + PREPARE_VALIST; + return vdprintf(d, fmt, VARARGS); +} + +EXPORT int my___dprintf_chk(x64emu_t *emu, int d, int flag, void* fmt, void* b) { + (void)flag; + myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 3); + PREPARE_VALIST; + return vdprintf(d, fmt, VARARGS); +} + + +EXPORT int my_vdprintf(x64emu_t *emu, int d, void* fmt, x64_va_list_t b) { + #ifdef CONVERT_VALIST + CONVERT_VALIST(b); + #else + myStackAlignValist(emu, (const char*)fmt, emu->scratch, b); + PREPARE_VALIST; + #endif + return vdprintf(d, fmt, VARARGS); +} + +EXPORT int my___vdprintf_chk(x64emu_t *emu, int d, int flag, void* fmt, x64_va_list_t b) { + (void)flag; + #ifdef CONVERT_VALIST + CONVERT_VALIST(b); + #else + myStackAlignValist(emu, (const char*)fmt, emu->scratch, b); + PREPARE_VALIST; + #endif + return vdprintf(d, fmt, VARARGS); +} + #if 0 EXPORT void *my_div(void *result, int numerator, int denominator) { *(div_t *)result = div(numerator, denominator); diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h index dce1647f..6a977e15 100755 --- a/src/wrapped/wrappedlibc_private.h +++ b/src/wrapped/wrappedlibc_private.h @@ -219,8 +219,8 @@ GOWM(dl_iterate_phdr, iFEpp) //GO(_dl_sym, //GO(_dl_vsym, GOW(dngettext, pFpppL) -//GO(dprintf, iFipV) -//GO(__dprintf_chk, +GOM(dprintf, iFEipV) +GOM(__dprintf_chk, iFEiipV) GO(drand48, dFv) GO(drand48_r, iFpp) GOW(dup, iFi) @@ -2051,8 +2051,8 @@ GO(utmpxname, iFp) GO(valloc, pFL) GOWM(vasprintf, iFEppA) GOM(__vasprintf_chk, iFEpipp) -//GOW(vdprintf, iFipA) -//GO(__vdprintf_chk, +GOM(vdprintf, iFEipA) +GOM(__vdprintf_chk, iFEiipA) //GO(verr, vFipA) //GO(verrx, vFipA) GOW(versionsort, iFpp) |