Skip to content

Commit

Permalink
[BOX32] Minor changes to 32bits freetype wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Sep 26, 2024
1 parent 933dc0f commit b80e4c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/emu/x86int3.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ void x86Int3(x64emu_t* emu, uintptr_t* addr)
snprintf(buff, 255, "%04d|%p: Calling %s(%p, \"%s\")", tid, from_ptrv(*(ptr_t*)from_ptr(R_ESP)), s, from_ptrv(*(ptr_t*)from_ptr(R_ESP+4)), from_ptrv(*(ptr_t*)from_ptr(R_ESP+8)));
} else if(strstr(s, "glXGetProcAddress")==s) {
snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\")", tid, from_ptrv(*(ptr_t*)from_ptr(R_ESP)), s, from_ptrv(*(ptr_t*)from_ptr(R_ESP+4)));
} else if (!strcmp(s, "glTexImage2D")) {
snprintf(buff, 256, "%04d|%p: Calling %s(0x%x, %d, 0x%x, %d, %d, %d, 0x%x, 0x%x, %p)", tid, from_ptrv(*(ptr_t*)from_ptrv(R_ESP)), s, *(uint32_t*)from_ptrv(R_ESP+4), *(int*)from_ptrv(R_ESP+8), *(int*)from_ptrv(R_ESP+12), *(int*)from_ptrv(R_ESP+16), *(int*)from_ptrv(R_ESP+20), *(int*)from_ptrv(R_ESP+24), *(uint32_t*)from_ptrv(R_ESP+28), *(uint32_t*)from_ptrv(R_ESP+32), from_ptrv(*(ptr_t*)from_ptrv(R_ESP+36)));
} else if(strstr(s, "sscanf")==s) {
snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\", \"%s\", ...)", tid, from_ptrv(*(ptr_t*)from_ptr(R_ESP)), s, from_ptrv(*(ptr_t*)from_ptr(R_ESP+4)), from_ptrv(*(ptr_t*)from_ptr(R_ESP+8)));
} else if(!strcmp(s, "vsscanf")) {
Expand Down Expand Up @@ -340,6 +342,10 @@ void x86Int3(x64emu_t* emu, uintptr_t* addr)
snprintf(buff, 255, "%04d|%p: Calling %s(%p)", tid, from_ptrv(*(ptr_t*)from_ptr(R_ESP)), s, from_ptrv(*(ptr_t*)from_ptr(R_ESP+4)));
} else if(strstr(s, "___tls_get_addr")) {
snprintf(buff, 255, "%04d|%p: Calling %s(%p[%d, %d])", tid, from_ptrv(*(ptr_t*)from_ptr(R_ESP)), s, from_ptrv(R_EAX), ((int*)from_ptrv(R_EAX))[0], ((int*)from_ptrv(R_EAX))[1]);
} else if (!strcmp(s, "FT_Outline_Get_CBox")) {
pu32 = *(uint32_t**)from_ptrv(R_ESP+8);
snprintf(buff, 256, "%04d|%p: Calling %s(%p, %p)", tid, from_ptrv(*(ptr_t*)from_ptr(R_ESP)), s, from_ptrv(*(ptr_t*)from_ptr(R_ESP+4)), from_ptrv(*(ptr_t*)from_ptr(R_ESP+8)));
post = 11;
} else if(strstr(s, "udev_monitor_new_from_netlink")==s) {
post = 5;
snprintf(buff, 255, "%04d|%p: Calling %s(%p, \"%s\")", tid, from_ptrv(*(ptr_t*)from_ptr(R_ESP)), s, from_ptrv(*(ptr_t*)from_ptr(R_ESP+4)), from_ptrv(*(ptr_t*)from_ptr(R_ESP+8)));
Expand Down Expand Up @@ -388,6 +394,8 @@ void x86Int3(x64emu_t* emu, uintptr_t* addr)
snprintf(buff2, 63, " [type=%hhd]", *pu8);
}
break;
case 11: snprintf(buff2, 63, " [%d / %d / %d /%d]", pu32[0], pu32[1], pu32[2], pu32[3]);
break;

}
if(perr==1 && ((int)R_EAX)<0)
Expand Down
4 changes: 2 additions & 2 deletions src/wrapped32/wrappedfreetype.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,8 @@ void inplace_FT_GlyphSlot_enlarge(void* a)
dst->outline.points = from_ptrv(src->outline.points);
dst->outline.n_points = src->outline.n_points;
for(int i=dst->outline.n_points-1; i>=0; --i) {
dst->outline.points[i].y = from_long(((FT_Vector_32_t*)from_ptrv(src->outline.points))[i].y);
dst->outline.points[i].x = from_long(((FT_Vector_32_t*)from_ptrv(src->outline.points))[i].x);
dst->outline.points[i].y = from_long(((FT_Vector_32_t*)dst->outline.points)[i].y);
dst->outline.points[i].x = from_long(((FT_Vector_32_t*)dst->outline.points)[i].x);
}
dst->outline.n_contours = src->outline.n_contours;
dst->bitmap_top = src->bitmap_top;
Expand Down

0 comments on commit b80e4c5

Please sign in to comment.