diff options
| author | Yang Liu <liuyang22@iscas.ac.cn> | 2023-05-22 22:22:23 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-22 16:22:23 +0200 |
| commit | 1d98aa54d5e462e2d13a2bd6795d587e4c523caf (patch) | |
| tree | 4143206c17c583865d95cb562a2a43600fe9fc2b /src/wrapped/wrappedlibc.c | |
| parent | f56181bdabdb17f46e9da8c5ff1d5d39093b9b02 (diff) | |
| download | box64-1d98aa54d5e462e2d13a2bd6795d587e4c523caf.tar.gz box64-1d98aa54d5e462e2d13a2bd6795d587e4c523caf.zip | |
[WRAPPER] Added 4 more libc dprintf wrappers (#798)
Diffstat (limited to 'src/wrapped/wrappedlibc.c')
| -rwxr-xr-x | src/wrapped/wrappedlibc.c | 35 |
1 files changed, 35 insertions, 0 deletions
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); |