Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/emu/x64printer.c
Original file line number Diff line number Diff line change
Expand Up @@ -4795,6 +4795,8 @@ void x64Print(x64emu_t* emu, char* buff, size_t buffsz, const char* func, int ti
snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9);
} else if (w == dFpppppL) {
snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIp ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9);
} else if (w == lFEippLL) {
snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIu64 ", %" PRIu64 ")", tid, *(void**)(R_RSP), func, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8);
} else if (w == lFEpippp) {
snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8);
} else if (w == lFipipLu) {
Expand Down
4 changes: 4 additions & 0 deletions src/wrapped/generated/functions_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,7 @@
#() pFplpp
#() pFpLii
#() pFpLip
#() pFpLiS
#() pFpLuu
#() pFpLup
#() pFpLLp
Expand Down Expand Up @@ -2616,6 +2617,7 @@
#() fFlfplpl
#() fFpppppL
#() dFpppppL
#() lFEippLL
#() lFEpippp
#() lFipipLu
#() lFipLipu
Expand Down Expand Up @@ -5343,6 +5345,8 @@ wrappedlibc:
- __sprintf_chk
- iFpuppp:
- __vswprintf_chk
- lFippLL:
- __readlinkat_chk
- pFpLLiN:
- mremap
- pFppLLp:
Expand Down
2 changes: 2 additions & 0 deletions src/wrapped/generated/wrappedlibctypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ typedef int32_t (*iFipppp_t)(int32_t, void*, void*, void*, void*);
typedef int32_t (*iFpiipp_t)(void*, int32_t, int32_t, void*, void*);
typedef int32_t (*iFpilpV_t)(void*, int32_t, intptr_t, void*, ...);
typedef int32_t (*iFpuppp_t)(void*, uint32_t, void*, void*, void*);
typedef intptr_t (*lFippLL_t)(int32_t, void*, void*, uintptr_t, uintptr_t);
typedef void* (*pFpLLiN_t)(void*, uintptr_t, uintptr_t, int32_t, ...);
typedef void* (*pFppLLp_t)(void*, void*, uintptr_t, uintptr_t, void*);
typedef void* (*pFpppLp_t)(void*, void*, void*, uintptr_t, void*);
Expand Down Expand Up @@ -338,6 +339,7 @@ typedef int32_t (*iFppipppp_t)(void*, void*, int32_t, void*, void*, void*, void*
GO(_obstack_begin, iFpiipp_t) \
GO(__sprintf_chk, iFpilpV_t) \
GO(__vswprintf_chk, iFpuppp_t) \
GO(__readlinkat_chk, lFippLL_t) \
GO(mremap, pFpLLiN_t) \
GO(bsearch, pFppLLp_t) \
GO(lfind, pFpppLp_t) \
Expand Down
4 changes: 4 additions & 0 deletions src/wrapped/generated/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,7 @@ typedef void* (*pFplpl_t)(void*, intptr_t, void*, intptr_t);
typedef void* (*pFplpp_t)(void*, intptr_t, void*, void*);
typedef void* (*pFpLii_t)(void*, uintptr_t, int32_t, int32_t);
typedef void* (*pFpLip_t)(void*, uintptr_t, int32_t, void*);
typedef void* (*pFpLiS_t)(void*, uintptr_t, int32_t, void*);
typedef void* (*pFpLuu_t)(void*, uintptr_t, uint32_t, uint32_t);
typedef void* (*pFpLup_t)(void*, uintptr_t, uint32_t, void*);
typedef void* (*pFpLLp_t)(void*, uintptr_t, uintptr_t, void*);
Expand Down Expand Up @@ -2643,6 +2644,7 @@ typedef uint64_t (*UFbuuuuu_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, ui
typedef float (*fFlfplpl_t)(intptr_t, float, void*, intptr_t, void*, intptr_t);
typedef float (*fFpppppL_t)(void*, void*, void*, void*, void*, uintptr_t);
typedef double (*dFpppppL_t)(void*, void*, void*, void*, void*, uintptr_t);
typedef intptr_t (*lFEippLL_t)(x64emu_t*, int32_t, void*, void*, uintptr_t, uintptr_t);
typedef intptr_t (*lFEpippp_t)(x64emu_t*, void*, int32_t, void*, void*, void*);
typedef intptr_t (*lFipipLu_t)(int32_t, void*, int32_t, void*, uintptr_t, uint32_t);
typedef intptr_t (*lFipLipu_t)(int32_t, void*, uintptr_t, int32_t, void*, uint32_t);
Expand Down Expand Up @@ -5487,6 +5489,7 @@ void pFplpl(x64emu_t *emu, uintptr_t fcn) { pFplpl_t fn = (pFplpl_t)fcn; R_RAX=(
void pFplpp(x64emu_t *emu, uintptr_t fcn) { pFplpp_t fn = (pFplpp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX); }
void pFpLii(x64emu_t *emu, uintptr_t fcn) { pFpLii_t fn = (pFpLii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); }
void pFpLip(x64emu_t *emu, uintptr_t fcn) { pFpLip_t fn = (pFpLip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); }
void pFpLiS(x64emu_t *emu, uintptr_t fcn) { pFpLiS_t fn = (pFpLiS_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, io_convert((void*)R_RCX)); }
void pFpLuu(x64emu_t *emu, uintptr_t fcn) { pFpLuu_t fn = (pFpLuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); }
void pFpLup(x64emu_t *emu, uintptr_t fcn) { pFpLup_t fn = (pFpLup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); }
void pFpLLp(x64emu_t *emu, uintptr_t fcn) { pFpLLp_t fn = (pFpLLp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX); }
Expand Down Expand Up @@ -6568,6 +6571,7 @@ void UFbuuuuu(x64emu_t *emu, uintptr_t fcn) { UFbuuuuu_t fn = (UFbuuuuu_t)fcn; v
void fFlfplpl(x64emu_t *emu, uintptr_t fcn) { fFlfplpl_t fn = (fFlfplpl_t)fcn; emu->xmm[0].f[0]=fn((intptr_t)R_RDI, emu->xmm[0].f[0], (void*)R_RSI, (intptr_t)R_RDX, (void*)R_RCX, (intptr_t)R_R8); }
void fFpppppL(x64emu_t *emu, uintptr_t fcn) { fFpppppL_t fn = (fFpppppL_t)fcn; emu->xmm[0].f[0]=fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); }
void dFpppppL(x64emu_t *emu, uintptr_t fcn) { dFpppppL_t fn = (dFpppppL_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); }
void lFEippLL(x64emu_t *emu, uintptr_t fcn) { lFEippLL_t fn = (lFEippLL_t)fcn; R_RAX=(intptr_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX, (uintptr_t)R_R8); }
void lFEpippp(x64emu_t *emu, uintptr_t fcn) { lFEpippp_t fn = (lFEpippp_t)fcn; R_RAX=(intptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); }
void lFipipLu(x64emu_t *emu, uintptr_t fcn) { lFipipLu_t fn = (lFipipLu_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uintptr_t)R_R8, (uint32_t)R_R9); }
void lFipLipu(x64emu_t *emu, uintptr_t fcn) { lFipLipu_t fn = (lFipLipu_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); }
Expand Down
2 changes: 2 additions & 0 deletions src/wrapped/generated/wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -1571,6 +1571,7 @@ void pFplpl(x64emu_t *emu, uintptr_t fnc);
void pFplpp(x64emu_t *emu, uintptr_t fnc);
void pFpLii(x64emu_t *emu, uintptr_t fnc);
void pFpLip(x64emu_t *emu, uintptr_t fnc);
void pFpLiS(x64emu_t *emu, uintptr_t fnc);
void pFpLuu(x64emu_t *emu, uintptr_t fnc);
void pFpLup(x64emu_t *emu, uintptr_t fnc);
void pFpLLp(x64emu_t *emu, uintptr_t fnc);
Expand Down Expand Up @@ -2653,6 +2654,7 @@ void UFbuuuuu(x64emu_t *emu, uintptr_t fnc);
void fFlfplpl(x64emu_t *emu, uintptr_t fnc);
void fFpppppL(x64emu_t *emu, uintptr_t fnc);
void dFpppppL(x64emu_t *emu, uintptr_t fnc);
void lFEippLL(x64emu_t *emu, uintptr_t fnc);
void lFEpippp(x64emu_t *emu, uintptr_t fnc);
void lFipipLu(x64emu_t *emu, uintptr_t fnc);
void lFipLipu(x64emu_t *emu, uintptr_t fnc);
Expand Down
6 changes: 6 additions & 0 deletions src/wrapped/wrappedlibc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3006,6 +3006,12 @@ EXPORT int my_readlinkat(x64emu_t* emu, int fd, void* path, void* buf, size_t bu
}
return readlinkat(fd, path, buf, bufsize);
}

EXPORT ssize_t my___readlinkat_chk(x64emu_t* emu, int dirfd, void* path, void* buf, size_t sz, size_t buflen)
{
return my_readlinkat(emu, dirfd, path, buf, sz);
}

extern int have48bits;
void* last_mmap_addr[2] = {0};
size_t last_mmap_len[2] = {0};
Expand Down
14 changes: 11 additions & 3 deletions src/wrapped/wrappedlibc_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,11 @@ GOW(fgetsgent_r, iFSppLp)
GO(fgetspent, pFS)
GOW(fgetspent_r, iFSppLp)
GOW(fgets_unlocked, pFpiS)
//GO(__fgets_unlocked_chk,
#ifdef STATICBUILD
//GO(__fgets_unlocked_chk,
#else
GO(__fgets_unlocked_chk, pFpLiS)
#endif
GOW(fgetwc, uFS)
GOW(fgetwc_unlocked, uFS)
GO(fgetws, pFpiS)
Expand Down Expand Up @@ -1625,7 +1629,7 @@ GOW(readdir64_r, iFppp)
GOW(readdir_r, iFppp)
GOWM(readlink, lFEppL)
GOM(readlinkat, lFEippL)
//GO(__readlinkat_chk,
GOM(__readlinkat_chk, lFEippLL)
GOM(__readlink_chk, lFEppLL)
//GO(__read_nocancel,
GOW(readv, lFipi)
Expand Down Expand Up @@ -2391,7 +2395,11 @@ GOW(wcsncpy, pFppL)
GO(__wcsncpy_chk, pFppLL)
GO(wcsnlen, LFpL)
GO(wcsnrtombs, LFppLLp)
//GO(__wcsnrtombs_chk,
#ifdef STATICBUILD
//GO(__wcsnrtombs_chk,
#else
GO(__wcsnrtombs_chk, LFppLLpL)
#endif
GO(wcspbrk, pFpp)
GO(wcsrchr, pFpi)
GO(wcsrtombs, LFppLp)
Expand Down
Loading