Skip to content

Commit

Permalink
[TRACE] Better for 32bits wait wrapped function
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Nov 6, 2024
1 parent cd55c12 commit 2dea11a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/emu/x86int3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 2dea11a

Please sign in to comment.