From 66fee75fc2fa84bc6b6257829ae9e2b5803ccf38 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 9 Mar 2021 15:02:25 +0100 Subject: Added some more libc wrapped functions --- src/wrapped/generated/functions_list.txt | 3 +++ src/wrapped/generated/wrapper.c | 6 ++++++ src/wrapped/generated/wrapper.h | 3 +++ src/wrapped/wrappedlibc_private.h | 14 +++++++------- 4 files changed, 19 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt index a185f24f..54b1c178 100644 --- a/src/wrapped/generated/functions_list.txt +++ b/src/wrapped/generated/functions_list.txt @@ -234,6 +234,7 @@ #() dFddp #() dFppi #() dFppp +#() lFipi #() lFipL #() LFpii #() pFEip @@ -375,9 +376,11 @@ #() pFEupp #() pFEpip #() pFEppi +#() pFEppL #() pFEppp #() pFiiiu #() pFiiup +#() pFippL #() pFuiii #() pFpiii #() pFpiip diff --git a/src/wrapped/generated/wrapper.c b/src/wrapped/generated/wrapper.c index dd34a698..1afd1495 100644 --- a/src/wrapped/generated/wrapper.c +++ b/src/wrapped/generated/wrapper.c @@ -267,6 +267,7 @@ typedef double (*dFddd_t)(double, double, double); typedef double (*dFddp_t)(double, double, void*); typedef double (*dFppi_t)(void*, void*, int32_t); typedef double (*dFppp_t)(void*, void*, void*); +typedef intptr_t (*lFipi_t)(int32_t, void*, int32_t); typedef intptr_t (*lFipL_t)(int32_t, void*, uintptr_t); typedef uintptr_t (*LFpii_t)(void*, int32_t, int32_t); typedef void* (*pFEip_t)(x64emu_t*, int32_t, void*); @@ -408,9 +409,11 @@ typedef uintptr_t (*LFpLLp_t)(void*, uintptr_t, uintptr_t, void*); typedef void* (*pFEupp_t)(x64emu_t*, uint32_t, void*, void*); typedef void* (*pFEpip_t)(x64emu_t*, void*, int32_t, void*); typedef void* (*pFEppi_t)(x64emu_t*, void*, void*, int32_t); +typedef void* (*pFEppL_t)(x64emu_t*, void*, void*, uintptr_t); typedef void* (*pFEppp_t)(x64emu_t*, void*, void*, void*); typedef void* (*pFiiiu_t)(int32_t, int32_t, int32_t, uint32_t); typedef void* (*pFiiup_t)(int32_t, int32_t, uint32_t, void*); +typedef void* (*pFippL_t)(int32_t, void*, void*, uintptr_t); typedef void* (*pFuiii_t)(uint32_t, int32_t, int32_t, int32_t); typedef void* (*pFpiii_t)(void*, int32_t, int32_t, int32_t); typedef void* (*pFpiip_t)(void*, int32_t, int32_t, void*); @@ -1103,6 +1106,7 @@ void dFddd(x64emu_t *emu, uintptr_t fcn) { dFddd_t fn = (dFddd_t)fcn; emu->xmm[0 void dFddp(x64emu_t *emu, uintptr_t fcn) { dFddp_t fn = (dFddp_t)fcn; emu->xmm[0].d[0]=fn(emu->xmm[0].d[0], emu->xmm[1].d[0], (void*)R_RDI); } void dFppi(x64emu_t *emu, uintptr_t fcn) { dFppi_t fn = (dFppi_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } void dFppp(x64emu_t *emu, uintptr_t fcn) { dFppp_t fn = (dFppp_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } +void lFipi(x64emu_t *emu, uintptr_t fcn) { lFipi_t fn = (lFipi_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } void lFipL(x64emu_t *emu, uintptr_t fcn) { lFipL_t fn = (lFipL_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } void LFpii(x64emu_t *emu, uintptr_t fcn) { LFpii_t fn = (LFpii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX); } void pFEip(x64emu_t *emu, uintptr_t fcn) { pFEip_t fn = (pFEip_t)fcn; R_RAX=(uintptr_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI); } @@ -1244,9 +1248,11 @@ void LFpLLp(x64emu_t *emu, uintptr_t fcn) { LFpLLp_t fn = (LFpLLp_t)fcn; R_RAX=( void pFEupp(x64emu_t *emu, uintptr_t fcn) { pFEupp_t fn = (pFEupp_t)fcn; R_RAX=(uintptr_t)fn(emu, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } void pFEpip(x64emu_t *emu, uintptr_t fcn) { pFEpip_t fn = (pFEpip_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); } void pFEppi(x64emu_t *emu, uintptr_t fcn) { pFEppi_t fn = (pFEppi_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } +void pFEppL(x64emu_t *emu, uintptr_t fcn) { pFEppL_t fn = (pFEppL_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } void pFEppp(x64emu_t *emu, uintptr_t fcn) { pFEppp_t fn = (pFEppp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } void pFiiiu(x64emu_t *emu, uintptr_t fcn) { pFiiiu_t fn = (pFiiiu_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); } void pFiiup(x64emu_t *emu, uintptr_t fcn) { pFiiup_t fn = (pFiiup_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); } +void pFippL(x64emu_t *emu, uintptr_t fcn) { pFippL_t fn = (pFippL_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } void pFuiii(x64emu_t *emu, uintptr_t fcn) { pFuiii_t fn = (pFuiii_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } void pFpiii(x64emu_t *emu, uintptr_t fcn) { pFpiii_t fn = (pFpiii_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } void pFpiip(x64emu_t *emu, uintptr_t fcn) { pFpiip_t fn = (pFpiip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } diff --git a/src/wrapped/generated/wrapper.h b/src/wrapped/generated/wrapper.h index 313827d5..24f09b03 100644 --- a/src/wrapped/generated/wrapper.h +++ b/src/wrapped/generated/wrapper.h @@ -264,6 +264,7 @@ void dFddd(x64emu_t *emu, uintptr_t fnc); void dFddp(x64emu_t *emu, uintptr_t fnc); void dFppi(x64emu_t *emu, uintptr_t fnc); void dFppp(x64emu_t *emu, uintptr_t fnc); +void lFipi(x64emu_t *emu, uintptr_t fnc); void lFipL(x64emu_t *emu, uintptr_t fnc); void LFpii(x64emu_t *emu, uintptr_t fnc); void pFEip(x64emu_t *emu, uintptr_t fnc); @@ -405,9 +406,11 @@ void LFpLLp(x64emu_t *emu, uintptr_t fnc); void pFEupp(x64emu_t *emu, uintptr_t fnc); void pFEpip(x64emu_t *emu, uintptr_t fnc); void pFEppi(x64emu_t *emu, uintptr_t fnc); +void pFEppL(x64emu_t *emu, uintptr_t fnc); void pFEppp(x64emu_t *emu, uintptr_t fnc); void pFiiiu(x64emu_t *emu, uintptr_t fnc); void pFiiup(x64emu_t *emu, uintptr_t fnc); +void pFippL(x64emu_t *emu, uintptr_t fnc); void pFuiii(x64emu_t *emu, uintptr_t fnc); void pFpiii(x64emu_t *emu, uintptr_t fnc); void pFpiip(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h index 93d7e18e..b0af879f 100755 --- a/src/wrapped/wrappedlibc_private.h +++ b/src/wrapped/wrappedlibc_private.h @@ -1455,16 +1455,16 @@ GOW(__read, lFipL) GO(read, lFipL) //GOW(readahead, //GO(__read_chk, -//GOW(readdir, -//GOW(readdir64, -//GOW(readdir64_r, -//GOW(readdir_r, -//GOW(readlink, -//GO(readlinkat, +GOW(readdir, pFp) // struct direct is 280 byts on x86_64 and ARM64 +GOW(readdir64, pFp) +GOW(readdir64_r, iFppp) +GOW(readdir_r, iFppp) +GOW(readlink, pFEppL) +GO(readlinkat, pFippL) //GO(__readlinkat_chk, //GO(__readlink_chk, //GO(__read_nocancel, -//GOW(readv, +GOW(readv, lFipi) GO(realloc, pFpL) //GOW(reallocarray, GOM(realpath, pFEpp) -- cgit 1.4.1