diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2024-09-14 17:36:45 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2024-09-14 17:36:45 +0200 |
| commit | 9fa43f2386b6ee9370e69eda7f8023cf857f0bb9 (patch) | |
| tree | dbb81791df55192dea635e4e7b26b37c1949c8ba /src/wrapped | |
| parent | f2397256e2942500f6a7577c103bdb6fb3a98ac7 (diff) | |
| download | box64-9fa43f2386b6ee9370e69eda7f8023cf857f0bb9.tar.gz box64-9fa43f2386b6ee9370e69eda7f8023cf857f0bb9.zip | |
Added a hack so program that wprintf to the console actualy work if box64 already printed something
Diffstat (limited to 'src/wrapped')
| -rw-r--r-- | src/wrapped/wrappedlibc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 72de9c7d..cd95351f 100644 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -695,9 +695,16 @@ EXPORT int my___printf_chk(x64emu_t *emu, int chk, void* fmt, void* b) PREPARE_VALIST; return vprintf((const char*)fmt, VARARGS); } +extern int box64_stdout_no_w; EXPORT int my_wprintf(x64emu_t *emu, void* fmt, void* b) { myStackAlignW(emu, (const char*)fmt, b, emu->scratch, R_EAX, 1); PREPARE_VALIST; + if(box64_stdout_no_w) { + wchar_t buff[2048]; + int ret = vswprintf(buff, 2047, fmt, VARARGS); + printf("%S", buff); + return ret; + } return vwprintf((const wchar_t*)fmt, VARARGS); } EXPORT int my___wprintf_chk(x64emu_t *emu, int chk, void* fmt, void* b) |