about summary refs log tree commit diff stats
path: root/src/emu
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-13 13:11:06 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-13 13:11:06 +0100
commitae4f43fdb99f4381525596c2790ed89fec9ab6da (patch)
tree44da102242e5ed278f3294fddf0422627140949b /src/emu
parent4ce40ad239b2d172f18f2c016db8251b9adc6223 (diff)
downloadbox64-ae4f43fdb99f4381525596c2790ed89fec9ab6da.tar.gz
box64-ae4f43fdb99f4381525596c2790ed89fec9ab6da.zip
Added many wrapped function, and fixed a few one too
Diffstat (limited to 'src/emu')
-rwxr-xr-xsrc/emu/x64int3.c5
-rwxr-xr-xsrc/emu/x64syscall.c1
2 files changed, 5 insertions, 1 deletions
diff --git a/src/emu/x64int3.c b/src/emu/x64int3.c
index a138ef0e..645d551e 100755
--- a/src/emu/x64int3.c
+++ b/src/emu/x64int3.c
@@ -103,8 +103,11 @@ void x64Int3(x64emu_t* emu)
                 } else  if(strstr(s, "my___printf_chk")) {
                     tmp = (char*)(R_RSI);
                     snprintf(buff, 255, "%04d|%p: Calling %s(%d, \"%s\" (,%p))", tid, *(void**)(R_RSP), s, R_EDI, (tmp)?tmp:"(nil)", (void*)(R_RDX));
+                } else  if(!strcmp(s, "sscanf")) {
+                    tmp = (char*)(R_RSI);
+                    snprintf(buff, 255, "%04d|%p: Calling %s(%p, \"%s\" (,%p))", tid, *(void**)(R_RSP), s, (void*)R_RDI, (tmp)?tmp:"(nil)", (void*)(R_RDX));
                 } else {
-                    snprintf(buff, 255, "%04d|%p: Calling %s (0x%lX, 0x%lX, 0x%lX, ...)", tid, *(void**)(R_RSP), s, R_RDI, R_RSI, R_RDX);
+                    snprintf(buff, 255, "%04d|%p: Calling %s(0x%lX, 0x%lX, 0x%lX, ...)", tid, *(void**)(R_RSP), s, R_RDI, R_RSI, R_RDX);
                 }
                 printf_log(LOG_NONE, "%s =>", buff);
                 pthread_mutex_unlock(&emu->context->mutex_trace);
diff --git a/src/emu/x64syscall.c b/src/emu/x64syscall.c
index 2b26e17f..bec0562b 100755
--- a/src/emu/x64syscall.c
+++ b/src/emu/x64syscall.c
@@ -68,6 +68,7 @@ scwrap_t syscallwrap[] = {
     //{ 3, __NR_close, 1 },   // wrapped so SA_RESTART can be handled by libc
 
     { 5, __NR_fstat, 2},
+    { 186, __NR_gettid, 0 },
 };
 
 struct mmap_arg_struct {