about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-04-26 10:14:16 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-04-26 10:14:16 +0200
commite505e5e466be8e7d5e9e102b4b9395d3ce94d5f0 (patch)
tree4928e15bb27b92347442859b587fff83fc444020 /src
parent4cdc3c62b25c1b36cf7584fed13f2f15e00937fb (diff)
downloadbox64-e505e5e466be8e7d5e9e102b4b9395d3ce94d5f0.tar.gz
box64-e505e5e466be8e7d5e9e102b4b9395d3ce94d5f0.zip
Morte improved functions traces
Diffstat (limited to 'src')
-rwxr-xr-xsrc/emu/x64int3.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/emu/x64int3.c b/src/emu/x64int3.c
index 4b8695ee..e000da82 100755
--- a/src/emu/x64int3.c
+++ b/src/emu/x64int3.c
@@ -109,6 +109,19 @@ void x64Int3(x64emu_t* emu)
                     tmp = (char*)(R_RDI);
                     snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\")", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)");
                     perr = 2;
+                } else  if(!strcmp(s, "read")) {
+                    snprintf(buff, 255, "%04d|%p: Calling %s(%d, %p, %zu)", tid, *(void**)(R_RSP), s, R_EDI, (void*)R_RSI, R_RDX);
+                    perr = 1;
+                } else  if(!strcmp(s, "write")) {
+                    snprintf(buff, 255, "%04d|%p: Calling %s(%d, %p, %zu)", tid, *(void**)(R_RSP), s, R_EDI, (void*)R_RSI, R_RDX);
+                    perr = 1;
+                } else  if(strstr(s, "access")==s) {
+                    tmp = (char*)(R_RDI);
+                    snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\", 0x%x)", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)", R_ESI);
+                    perr = 1;
+                } else  if(strstr(s, "puts")==s) {
+                    tmp = (char*)(R_RDI);
+                    snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\")", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)");
                 } else  if(strstr(s, "strlen")==s) {
                     tmp = (char*)(R_RDI);
                     snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\")", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)");
@@ -121,9 +134,19 @@ void x64Int3(x64emu_t* emu)
                 } else  if(!strcmp(s, "poll")) {
                     struct pollfd* pfd = (struct pollfd*)(R_RDI);
                     snprintf(buff, 255, "%04d|%p: Calling %s(%p[%d/%d/%d, ...], %d, %d)", tid, *(void**)(R_RSP), s, pfd, pfd->fd, pfd->events, pfd->revents, R_ESI, R_EDX);
-                } else  if(strstr(s, "my___printf_chk")) {
+                } else  if(strstr(s, "my___printf_chk") || !strcmp(s, "__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(strstr(s, "my___snprintf_chk") || !strcmp(s, "__snprintf_chk")) {
+                    tmp = (char*)(R_R8);
+                    pu64 = (uint64_t*)R_RDI;
+                    post = 3;
+                    snprintf(buff, 255, "%04d|%p: Calling %s(%p, %zu, %d, %zu, \"%s\" (,%p))", tid, *(void**)(R_RSP), s, (void*)R_RDI, R_RSI, R_EDX, R_RCX, (tmp)?tmp:"(nil)", (void*)(R_R9));
+                } else  if(strstr(s, "my_snprintf") || !strcmp(s, "snprintf")) {
+                    tmp = (char*)(R_RDX);
+                    pu64 = (uint64_t*)R_RDI;
+                    post = 3;
+                    snprintf(buff, 255, "%04d|%p: Calling %s(%p, %zu, \"%s\" (,%p))", tid, *(void**)(R_RSP), s, (void*)R_RDI, R_RSI, (tmp)?tmp:"(nil)", (void*)(R_RCX));
                 } else  if(!strcmp(s, "glXGetProcAddress") || !strcmp(s, "SDL_GL_GetProcAddress")) {
                     tmp = (char*)(R_RDI);
                     snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\")", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)");