diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-03-10 10:14:34 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-03-10 10:14:34 +0100 |
| commit | 0a7963588e2f4e088d089cbde90ee9ebad63ed85 (patch) | |
| tree | d9a594e5252edeee408603e6c53ced9217f6e7bc /src/wrapped/wrappedlibc.c | |
| parent | 42d281bfe3fce26f8ef8735eb7b084adc25b9435 (diff) | |
| download | box64-0a7963588e2f4e088d089cbde90ee9ebad63ed85.tar.gz box64-0a7963588e2f4e088d089cbde90ee9ebad63ed85.zip | |
Fixed the already wrapped non-valist __Xprintf_chk functions
Diffstat (limited to 'src/wrapped/wrappedlibc.c')
| -rwxr-xr-x | src/wrapped/wrappedlibc.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index d9c675cf..bba0a0ad 100755 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -583,7 +583,12 @@ EXPORT int my_printf(x64emu_t *emu, void* fmt, void* b) { PREPARE_VALIST; return vprintf((const char*)fmt, VARARGS); } -EXPORT int my___printf_chk(x64emu_t *emu, void* fmt, void* b) __attribute__((alias("my_printf"))); +EXPORT int my___printf_chk(x64emu_t *emu, int chk, void* fmt, void* b) +{ + myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 2); + PREPARE_VALIST; + return vprintf((const char*)fmt, VARARGS); +} EXPORT int my_vprintf(x64emu_t *emu, void* fmt, x64_va_list_t b) { CONVERT_VALIST(b); @@ -689,11 +694,15 @@ EXPORT int my___snprintf_chk(x64emu_t* emu, void* buff, uint32_t s, void * fmt, EXPORT int my___snprintf(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void * b, va_list V) __attribute__((alias("my_snprintf"))); #endif EXPORT int my_sprintf(x64emu_t* emu, void* buff, void * fmt, void * b) { - myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 1); + myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 2); + PREPARE_VALIST; + return vsprintf(buff, (const char*)fmt, VARARGS); +} +EXPORT int my___sprintf_chk(x64emu_t* emu, void* buff, int flag, size_t l, void * fmt, void * b) { + myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 4); PREPARE_VALIST; return vsprintf(buff, (const char*)fmt, VARARGS); } -EXPORT int my___sprintf_chk(x64emu_t* emu, void* buff, void * fmt, void * b) __attribute__((alias("my_sprintf"))); #if 0 EXPORT int my_asprintf(x64emu_t* emu, void** buff, void * fmt, void * b, va_list V) { #ifndef NOALIGN |