From 2dea11a9e3fed043e368d2e99067d69151c2e694 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Wed, 6 Nov 2024 19:13:08 +0100 Subject: [PATCH] [TRACE] Better for 32bits wait wrapped function --- src/emu/x86int3.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/emu/x86int3.c b/src/emu/x86int3.c index 0d7b5de35..cd5b9e85a 100755 --- a/src/emu/x86int3.c +++ b/src/emu/x86int3.c @@ -202,6 +202,11 @@ void x86Int3(x64emu_t* emu, uintptr_t* addr) } else if(strstr(s, "waitpid")==s) { snprintf(buff, 255, "%04d|%p: Calling %s(%d, %p, 0x%x)", tid, from_ptrv(*(ptr_t*)from_ptr(R_ESP)), (char *)s, *(int32_t*)from_ptr(R_ESP+4), from_ptrv(*(ptr_t*)from_ptr(R_ESP+8)), *(uint32_t*)from_ptr(R_ESP+12)); perr = 1; + } else if(!strcmp(s, "wait")) { + snprintf(buff, 255, "%04d|%p: Calling %s(%p)", tid, from_ptrv(*(ptr_t*)from_ptr(R_ESP)), (char *)s, from_ptrv(*(ptr_t*)from_ptr(R_ESP+4))); + pu32 = from_ptrv(*(ptr_t*)from_ptr(R_ESP+4)); + perr = 1; + if(pu32) post = 14; } else if(strstr(s, "clock_gettime")==s || strstr(s, "__clock_gettime")==s) { snprintf(buff, 255, "%04d|%p: Calling %s(%d, %p)", tid, from_ptrv(*(ptr_t*)from_ptr(R_ESP)), (char *)s, *(uint32_t*)from_ptr(R_ESP+4), from_ptrv(*(ptr_t*)from_ptr(R_ESP+8))); post = 1; @@ -431,6 +436,8 @@ void x86Int3(x64emu_t* emu, uintptr_t* addr) case 13: if(R_EAX==0x25E) snprintf(buff2, 63, "%s", "here"); break; + case 14: snprintf(buff2, 63, " [%d]", *(int*)pu32); + break; } if(perr==1 && (S_EAX)<0) snprintf(buff3, 63, " (errno=%d:\"%s\")", errno, strerror(errno));