From b02b9174e089904ff3d2ba8d7c7d907318457032 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Thu, 24 Jul 2025 14:17:52 +0200 Subject: [TRACE] Some mor eimprovment to LOG=2 traces --- src/emu/x64int3.c | 8 ++++++++ src/emu/x86int3.c | 5 +++++ 2 files changed, 13 insertions(+) (limited to 'src') diff --git a/src/emu/x64int3.c b/src/emu/x64int3.c index f79a451d..5f32267f 100644 --- a/src/emu/x64int3.c +++ b/src/emu/x64int3.c @@ -215,6 +215,9 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) } else if (!strcmp(s, "fgetxattr")) { snprintf(buff, 256, "%04d|%p: Calling %s(%d, \"%s\", %p, 0x%zx)", tid, *(void**)(R_RSP), s, R_EDI, (char*)R_RSI, (void*)R_RDX, R_RCX); perr = 1; + } else if (!strcmp(s, "connect")) { + snprintf(buff, 256, "%04d|%p: Calling %s(%d, %p, %d)", tid, *(void**)(R_RSP), s, R_EDI, (void*)R_RSI, R_EDX); + perr = 1; } else if (strstr(s, "puts")==s) { tmp = (char*)(R_RDI); snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\")", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)"); @@ -323,6 +326,9 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) pu32 = (uint32_t*)(R_RDI); post = 7; snprintf(buff, 256, "%04d|%p: Calling %s(%p, 0x%X)", tid, *(void**)(R_RSP), s, (void*)R_RDI, R_ESI); + } else if(!strcmp(s, "__errno_location")) { + snprintf(buff, 255, "%04d|%p: Calling %s()", tid, *(void**)(R_RSP), s); + perr = 4; } else { x64Print(emu, buff, 256, s, tid, w); } @@ -377,6 +383,8 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr) snprintf(buff3, 64, " (errno=%d:\"%s\")", errno, strerror(errno)); else if(perr==3 && (S_RAX)==-1) snprintf(buff3, 64, " (errno=%d:\"%s\")", errno, strerror(errno)); + else if(perr==4) + snprintf(buff3, 64, " (errno=%d:\"%s\")", errno, strerror(errno)); if(BOX64ENV(rolling_log)) snprintf(buffret, 127, "0x%lX%s%s", R_RAX, buff2, buff3); diff --git a/src/emu/x86int3.c b/src/emu/x86int3.c index 15f5edc0..9bcfd328 100755 --- a/src/emu/x86int3.c +++ b/src/emu/x86int3.c @@ -400,6 +400,9 @@ void x86Int3(x64emu_t* emu, uintptr_t* addr) post = 2; } else if(!strcmp(s, "getaddrinfo")) { snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\", \"%s\", %p, %p)", tid, from_ptriv(R_ESP), (char *)s, (char *)from_ptriv(R_ESP+4), (char *)from_ptriv(R_ESP+8), from_ptriv(R_ESP+12), from_ptriv(R_ESP+16)); + } else if(!strcmp(s, "__errno_location")) { + snprintf(buff, 255, "%04d|%p: Calling %s()", tid, from_ptriv(R_ESP), (char *)s); + perr = 4; } else { snprintf(buff, 255, "%04d|%p: Calling %s (%08X, %08X, %08X...)", tid, from_ptriv(R_ESP), (char *)s, from_ptri(uint32_t, R_ESP+4), from_ptri(uint32_t, R_ESP+8), from_ptri(uint32_t, R_ESP+12)); } @@ -466,6 +469,8 @@ void x86Int3(x64emu_t* emu, uintptr_t* addr) snprintf(buff3, 63, " (errno=%d:\"%s\")", errno, strerror(errno)); else if(perr==3 && (S_EAX)==-1) snprintf(buff3, 63, " (errno=%d:\"%s\")", errno, strerror(errno)); + else if(perr==4) + snprintf(buff3, 63, " (errno=%d:\"%s\")", errno, strerror(errno)); if(BOX64ENV(rolling_log)) { if(ret_fmt==1) snprintf(buffret, 127, "%d%s%s", S_EAX, buff2, buff3); -- cgit 1.4.1