diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-03-25 12:32:46 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-03-25 12:32:46 +0100 |
| commit | 683b77c9bd137e062218be4e6fcd9eeeb9a9176f (patch) | |
| tree | 4aefd3b234a42ae6341469d82c82d23fa4a1102b /src | |
| parent | 7809f23d4b500e13e197fe87ae46d9def1fa3c0b (diff) | |
| download | box64-683b77c9bd137e062218be4e6fcd9eeeb9a9176f.tar.gz box64-683b77c9bd137e062218be4e6fcd9eeeb9a9176f.zip | |
Added some more libc wrapped function (and now SuperHexagon works fine)
Diffstat (limited to 'src')
| -rw-r--r-- | src/wrapped/generated/functions_list.txt | 13 | ||||
| -rw-r--r-- | src/wrapped/generated/wrapper.c | 26 | ||||
| -rw-r--r-- | src/wrapped/generated/wrapper.h | 13 | ||||
| -rwxr-xr-x | src/wrapped/wrappedlibc.c | 2 | ||||
| -rwxr-xr-x | src/wrapped/wrappedlibc_private.h | 51 |
5 files changed, 74 insertions, 31 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt index 269d493f..3fca489f 100644 --- a/src/wrapped/generated/functions_list.txt +++ b/src/wrapped/generated/functions_list.txt @@ -20,6 +20,7 @@ #() iFd #() iFL #() iFp +#() iFO #() iFS #() IFf #() IFd @@ -393,9 +394,11 @@ #() iFEpOu #() iFiiii #() iFiiiu +#() iFiiip #() iFiipp #() iFiuii #() iFipii +#() iFipui #() iFippi #() iFippu #() iFippp @@ -444,7 +447,10 @@ #() uFpppi #() UFpipp #() dFppiL +#() lFEppL +#() lFiipL #() lFipiI +#() lFipLi #() lFipLI #() lFipLl #() LFpuuu @@ -458,7 +464,6 @@ #() pFEpii #() pFEpip #() pFEppi -#() pFEppL #() pFEppp #() pFiiiu #() pFiiup @@ -565,8 +570,11 @@ #() iFEppiV #() iFEpppp #() iFEpppV +#() iFiiipu +#() iFiiipp #() iFiiupp #() iFipiii +#() iFipuip #() iFipppi #() iFipppp #() iFpiiii @@ -586,6 +594,7 @@ #() iFppipi #() iFppipp #() iFppupi +#() iFppLpi #() iFpppii #() iFpppiL #() iFpppip @@ -717,6 +726,8 @@ #() iFpppppp #() uFpippup #() UFpippup +#() lFipLipu +#() lFipLipp #() LFSpLiip #() pFEpippp #() pFEpuipp diff --git a/src/wrapped/generated/wrapper.c b/src/wrapped/generated/wrapper.c index 19447ed2..838512f4 100644 --- a/src/wrapped/generated/wrapper.c +++ b/src/wrapped/generated/wrapper.c @@ -53,6 +53,7 @@ typedef int32_t (*iFf_t)(float); typedef int32_t (*iFd_t)(double); typedef int32_t (*iFL_t)(uintptr_t); typedef int32_t (*iFp_t)(void*); +typedef int32_t (*iFO_t)(int32_t); typedef int32_t (*iFS_t)(void*); typedef int64_t (*IFf_t)(float); typedef int64_t (*IFd_t)(double); @@ -426,9 +427,11 @@ typedef int32_t (*iFEppV_t)(x64emu_t*, void*, void*, void*); typedef int32_t (*iFEpOu_t)(x64emu_t*, void*, int32_t, uint32_t); typedef int32_t (*iFiiii_t)(int32_t, int32_t, int32_t, int32_t); typedef int32_t (*iFiiiu_t)(int32_t, int32_t, int32_t, uint32_t); +typedef int32_t (*iFiiip_t)(int32_t, int32_t, int32_t, void*); typedef int32_t (*iFiipp_t)(int32_t, int32_t, void*, void*); typedef int32_t (*iFiuii_t)(int32_t, uint32_t, int32_t, int32_t); typedef int32_t (*iFipii_t)(int32_t, void*, int32_t, int32_t); +typedef int32_t (*iFipui_t)(int32_t, void*, uint32_t, int32_t); typedef int32_t (*iFippi_t)(int32_t, void*, void*, int32_t); typedef int32_t (*iFippu_t)(int32_t, void*, void*, uint32_t); typedef int32_t (*iFippp_t)(int32_t, void*, void*, void*); @@ -477,7 +480,10 @@ typedef uint32_t (*uFpuuu_t)(void*, uint32_t, uint32_t, uint32_t); typedef uint32_t (*uFpppi_t)(void*, void*, void*, int32_t); typedef uint64_t (*UFpipp_t)(void*, int32_t, void*, void*); typedef double (*dFppiL_t)(void*, void*, int32_t, uintptr_t); +typedef intptr_t (*lFEppL_t)(x64emu_t*, void*, void*, uintptr_t); +typedef intptr_t (*lFiipL_t)(int32_t, int32_t, void*, uintptr_t); typedef intptr_t (*lFipiI_t)(int32_t, void*, int32_t, int64_t); +typedef intptr_t (*lFipLi_t)(int32_t, void*, uintptr_t, int32_t); typedef intptr_t (*lFipLI_t)(int32_t, void*, uintptr_t, int64_t); typedef intptr_t (*lFipLl_t)(int32_t, void*, uintptr_t, intptr_t); typedef uintptr_t (*LFpuuu_t)(void*, uint32_t, uint32_t, uint32_t); @@ -491,7 +497,6 @@ typedef void* (*pFEupp_t)(x64emu_t*, uint32_t, void*, void*); typedef void* (*pFEpii_t)(x64emu_t*, void*, int32_t, int32_t); 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*); @@ -598,8 +603,11 @@ typedef int32_t (*iFEppip_t)(x64emu_t*, void*, void*, int32_t, void*); typedef int32_t (*iFEppiV_t)(x64emu_t*, void*, void*, int32_t, void*); typedef int32_t (*iFEpppp_t)(x64emu_t*, void*, void*, void*, void*); typedef int32_t (*iFEpppV_t)(x64emu_t*, void*, void*, void*, void*); +typedef int32_t (*iFiiipu_t)(int32_t, int32_t, int32_t, void*, uint32_t); +typedef int32_t (*iFiiipp_t)(int32_t, int32_t, int32_t, void*, void*); typedef int32_t (*iFiiupp_t)(int32_t, int32_t, uint32_t, void*, void*); typedef int32_t (*iFipiii_t)(int32_t, void*, int32_t, int32_t, int32_t); +typedef int32_t (*iFipuip_t)(int32_t, void*, uint32_t, int32_t, void*); typedef int32_t (*iFipppi_t)(int32_t, void*, void*, void*, int32_t); typedef int32_t (*iFipppp_t)(int32_t, void*, void*, void*, void*); typedef int32_t (*iFpiiii_t)(void*, int32_t, int32_t, int32_t, int32_t); @@ -619,6 +627,7 @@ typedef int32_t (*iFppiup_t)(void*, void*, int32_t, uint32_t, void*); typedef int32_t (*iFppipi_t)(void*, void*, int32_t, void*, int32_t); typedef int32_t (*iFppipp_t)(void*, void*, int32_t, void*, void*); typedef int32_t (*iFppupi_t)(void*, void*, uint32_t, void*, int32_t); +typedef int32_t (*iFppLpi_t)(void*, void*, uintptr_t, void*, int32_t); typedef int32_t (*iFpppii_t)(void*, void*, void*, int32_t, int32_t); typedef int32_t (*iFpppiL_t)(void*, void*, void*, int32_t, uintptr_t); typedef int32_t (*iFpppip_t)(void*, void*, void*, int32_t, void*); @@ -750,6 +759,8 @@ typedef int32_t (*iFpppppL_t)(void*, void*, void*, void*, void*, uintptr_t); typedef int32_t (*iFpppppp_t)(void*, void*, void*, void*, void*, void*); typedef uint32_t (*uFpippup_t)(void*, int32_t, void*, void*, uint32_t, void*); typedef uint64_t (*UFpippup_t)(void*, int32_t, void*, void*, uint32_t, void*); +typedef intptr_t (*lFipLipu_t)(int32_t, void*, uintptr_t, int32_t, void*, uint32_t); +typedef intptr_t (*lFipLipp_t)(int32_t, void*, uintptr_t, int32_t, void*, void*); typedef uintptr_t (*LFSpLiip_t)(void*, void*, uintptr_t, int32_t, int32_t, void*); typedef void* (*pFEpippp_t)(x64emu_t*, void*, int32_t, void*, void*, void*); typedef void* (*pFEpuipp_t)(x64emu_t*, void*, uint32_t, int32_t, void*, void*); @@ -1027,6 +1038,7 @@ void iFf(x64emu_t *emu, uintptr_t fcn) { iFf_t fn = (iFf_t)fcn; R_RAX=fn(emu->xm void iFd(x64emu_t *emu, uintptr_t fcn) { iFd_t fn = (iFd_t)fcn; R_RAX=fn(emu->xmm[0].d[0]); } void iFL(x64emu_t *emu, uintptr_t fcn) { iFL_t fn = (iFL_t)fcn; R_RAX=fn((uintptr_t)R_RDI); } void iFp(x64emu_t *emu, uintptr_t fcn) { iFp_t fn = (iFp_t)fcn; R_RAX=fn((void*)R_RDI); } +void iFO(x64emu_t *emu, uintptr_t fcn) { iFO_t fn = (iFO_t)fcn; R_RAX=fn(of_convert((int32_t)R_RDI)); } void iFS(x64emu_t *emu, uintptr_t fcn) { iFS_t fn = (iFS_t)fcn; R_RAX=fn(io_convert((void*)R_RDI)); } void IFf(x64emu_t *emu, uintptr_t fcn) { IFf_t fn = (IFf_t)fcn; R_RAX=(uint64_t)fn(emu->xmm[0].f[0]); } void IFd(x64emu_t *emu, uintptr_t fcn) { IFd_t fn = (IFd_t)fcn; R_RAX=(uint64_t)fn(emu->xmm[0].d[0]); } @@ -1400,9 +1412,11 @@ void iFEppV(x64emu_t *emu, uintptr_t fcn) { iFEppV_t fn = (iFEppV_t)fcn; R_RAX=f void iFEpOu(x64emu_t *emu, uintptr_t fcn) { iFEpOu_t fn = (iFEpOu_t)fcn; R_RAX=fn(emu, (void*)R_RDI, of_convert((int32_t)R_RSI), (uint32_t)R_RDX); } void iFiiii(x64emu_t *emu, uintptr_t fcn) { iFiiii_t fn = (iFiiii_t)fcn; R_RAX=fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } void iFiiiu(x64emu_t *emu, uintptr_t fcn) { iFiiiu_t fn = (iFiiiu_t)fcn; R_RAX=fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); } +void iFiiip(x64emu_t *emu, uintptr_t fcn) { iFiiip_t fn = (iFiiip_t)fcn; R_RAX=fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } void iFiipp(x64emu_t *emu, uintptr_t fcn) { iFiipp_t fn = (iFiipp_t)fcn; R_RAX=fn((int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } void iFiuii(x64emu_t *emu, uintptr_t fcn) { iFiuii_t fn = (iFiuii_t)fcn; R_RAX=fn((int32_t)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } void iFipii(x64emu_t *emu, uintptr_t fcn) { iFipii_t fn = (iFipii_t)fcn; R_RAX=fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } +void iFipui(x64emu_t *emu, uintptr_t fcn) { iFipui_t fn = (iFipui_t)fcn; R_RAX=fn((int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX); } void iFippi(x64emu_t *emu, uintptr_t fcn) { iFippi_t fn = (iFippi_t)fcn; R_RAX=fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } void iFippu(x64emu_t *emu, uintptr_t fcn) { iFippu_t fn = (iFippu_t)fcn; R_RAX=fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (uint32_t)R_RCX); } void iFippp(x64emu_t *emu, uintptr_t fcn) { iFippp_t fn = (iFippp_t)fcn; R_RAX=fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } @@ -1451,7 +1465,10 @@ void uFpuuu(x64emu_t *emu, uintptr_t fcn) { uFpuuu_t fn = (uFpuuu_t)fcn; R_RAX=( void uFpppi(x64emu_t *emu, uintptr_t fcn) { uFpppi_t fn = (uFpppi_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX); } void UFpipp(x64emu_t *emu, uintptr_t fcn) { UFpipp_t fn = (UFpipp_t)fcn; R_RAX=fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } void dFppiL(x64emu_t *emu, uintptr_t fcn) { dFppiL_t fn = (dFppiL_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX); } +void lFEppL(x64emu_t *emu, uintptr_t fcn) { lFEppL_t fn = (lFEppL_t)fcn; R_RAX=(intptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } +void lFiipL(x64emu_t *emu, uintptr_t fcn) { lFiipL_t fn = (lFiipL_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uintptr_t)R_RCX); } void lFipiI(x64emu_t *emu, uintptr_t fcn) { lFipiI_t fn = (lFipiI_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int64_t)R_RCX); } +void lFipLi(x64emu_t *emu, uintptr_t fcn) { lFipLi_t fn = (lFipLi_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX); } void lFipLI(x64emu_t *emu, uintptr_t fcn) { lFipLI_t fn = (lFipLI_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (int64_t)R_RCX); } void lFipLl(x64emu_t *emu, uintptr_t fcn) { lFipLl_t fn = (lFipLl_t)fcn; R_RAX=(intptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (intptr_t)R_RCX); } void LFpuuu(x64emu_t *emu, uintptr_t fcn) { LFpuuu_t fn = (LFpuuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX); } @@ -1465,7 +1482,6 @@ void pFEupp(x64emu_t *emu, uintptr_t fcn) { pFEupp_t fn = (pFEupp_t)fcn; R_RAX=( void pFEpii(x64emu_t *emu, uintptr_t fcn) { pFEpii_t fn = (pFEpii_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (int32_t)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); } @@ -1572,8 +1588,11 @@ void iFEppip(x64emu_t *emu, uintptr_t fcn) { iFEppip_t fn = (iFEppip_t)fcn; R_RA void iFEppiV(x64emu_t *emu, uintptr_t fcn) { iFEppiV_t fn = (iFEppiV_t)fcn; R_RAX=fn(emu, (void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)(R_RSP + 8)); } void iFEpppp(x64emu_t *emu, uintptr_t fcn) { iFEpppp_t fn = (iFEpppp_t)fcn; R_RAX=fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX); } void iFEpppV(x64emu_t *emu, uintptr_t fcn) { iFEpppV_t fn = (iFEpppV_t)fcn; R_RAX=fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)(R_RSP + 8)); } +void iFiiipu(x64emu_t *emu, uintptr_t fcn) { iFiiipu_t fn = (iFiiipu_t)fcn; R_RAX=fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (uint32_t)R_R8); } +void iFiiipp(x64emu_t *emu, uintptr_t fcn) { iFiiipp_t fn = (iFiiipp_t)fcn; R_RAX=fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } void iFiiupp(x64emu_t *emu, uintptr_t fcn) { iFiiupp_t fn = (iFiiupp_t)fcn; R_RAX=fn((int32_t)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } void iFipiii(x64emu_t *emu, uintptr_t fcn) { iFipiii_t fn = (iFipiii_t)fcn; R_RAX=fn((int32_t)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } +void iFipuip(x64emu_t *emu, uintptr_t fcn) { iFipuip_t fn = (iFipuip_t)fcn; R_RAX=fn((int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); } void iFipppi(x64emu_t *emu, uintptr_t fcn) { iFipppi_t fn = (iFipppi_t)fcn; R_RAX=fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); } void iFipppp(x64emu_t *emu, uintptr_t fcn) { iFipppp_t fn = (iFipppp_t)fcn; R_RAX=fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } void iFpiiii(x64emu_t *emu, uintptr_t fcn) { iFpiiii_t fn = (iFpiiii_t)fcn; R_RAX=fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } @@ -1593,6 +1612,7 @@ void iFppiup(x64emu_t *emu, uintptr_t fcn) { iFppiup_t fn = (iFppiup_t)fcn; R_RA void iFppipi(x64emu_t *emu, uintptr_t fcn) { iFppipi_t fn = (iFppipi_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } void iFppipp(x64emu_t *emu, uintptr_t fcn) { iFppipp_t fn = (iFppipp_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } void iFppupi(x64emu_t *emu, uintptr_t fcn) { iFppupi_t fn = (iFppupi_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } +void iFppLpi(x64emu_t *emu, uintptr_t fcn) { iFppLpi_t fn = (iFppLpi_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (int32_t)R_R8); } void iFpppii(x64emu_t *emu, uintptr_t fcn) { iFpppii_t fn = (iFpppii_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8); } void iFpppiL(x64emu_t *emu, uintptr_t fcn) { iFpppiL_t fn = (iFpppiL_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (uintptr_t)R_R8); } void iFpppip(x64emu_t *emu, uintptr_t fcn) { iFpppip_t fn = (iFpppip_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (void*)R_R8); } @@ -1724,6 +1744,8 @@ void iFpppppL(x64emu_t *emu, uintptr_t fcn) { iFpppppL_t fn = (iFpppppL_t)fcn; R void iFpppppp(x64emu_t *emu, uintptr_t fcn) { iFpppppp_t fn = (iFpppppp_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } void uFpippup(x64emu_t *emu, uintptr_t fcn) { uFpippup_t fn = (uFpippup_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)R_R9); } void UFpippup(x64emu_t *emu, uintptr_t fcn) { UFpippup_t fn = (UFpippup_t)fcn; R_RAX=fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (uint32_t)R_R8, (void*)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); } +void lFipLipp(x64emu_t *emu, uintptr_t fcn) { lFipLipp_t fn = (lFipLipp_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, (void*)R_R9); } void LFSpLiip(x64emu_t *emu, uintptr_t fcn) { LFSpLiip_t fn = (LFSpLiip_t)fcn; R_RAX=(uintptr_t)fn(io_convert((void*)R_RDI), (void*)R_RSI, (uintptr_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); } void pFEpippp(x64emu_t *emu, uintptr_t fcn) { pFEpippp_t fn = (pFEpippp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); } void pFEpuipp(x64emu_t *emu, uintptr_t fcn) { pFEpuipp_t fn = (pFEpuipp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX, (void*)R_R8); } diff --git a/src/wrapped/generated/wrapper.h b/src/wrapped/generated/wrapper.h index 8194011f..a33f0590 100644 --- a/src/wrapped/generated/wrapper.h +++ b/src/wrapped/generated/wrapper.h @@ -50,6 +50,7 @@ void iFf(x64emu_t *emu, uintptr_t fnc); void iFd(x64emu_t *emu, uintptr_t fnc); void iFL(x64emu_t *emu, uintptr_t fnc); void iFp(x64emu_t *emu, uintptr_t fnc); +void iFO(x64emu_t *emu, uintptr_t fnc); void iFS(x64emu_t *emu, uintptr_t fnc); void IFf(x64emu_t *emu, uintptr_t fnc); void IFd(x64emu_t *emu, uintptr_t fnc); @@ -423,9 +424,11 @@ void iFEppV(x64emu_t *emu, uintptr_t fnc); void iFEpOu(x64emu_t *emu, uintptr_t fnc); void iFiiii(x64emu_t *emu, uintptr_t fnc); void iFiiiu(x64emu_t *emu, uintptr_t fnc); +void iFiiip(x64emu_t *emu, uintptr_t fnc); void iFiipp(x64emu_t *emu, uintptr_t fnc); void iFiuii(x64emu_t *emu, uintptr_t fnc); void iFipii(x64emu_t *emu, uintptr_t fnc); +void iFipui(x64emu_t *emu, uintptr_t fnc); void iFippi(x64emu_t *emu, uintptr_t fnc); void iFippu(x64emu_t *emu, uintptr_t fnc); void iFippp(x64emu_t *emu, uintptr_t fnc); @@ -474,7 +477,10 @@ void uFpuuu(x64emu_t *emu, uintptr_t fnc); void uFpppi(x64emu_t *emu, uintptr_t fnc); void UFpipp(x64emu_t *emu, uintptr_t fnc); void dFppiL(x64emu_t *emu, uintptr_t fnc); +void lFEppL(x64emu_t *emu, uintptr_t fnc); +void lFiipL(x64emu_t *emu, uintptr_t fnc); void lFipiI(x64emu_t *emu, uintptr_t fnc); +void lFipLi(x64emu_t *emu, uintptr_t fnc); void lFipLI(x64emu_t *emu, uintptr_t fnc); void lFipLl(x64emu_t *emu, uintptr_t fnc); void LFpuuu(x64emu_t *emu, uintptr_t fnc); @@ -488,7 +494,6 @@ void pFEupp(x64emu_t *emu, uintptr_t fnc); void pFEpii(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); @@ -595,8 +600,11 @@ void iFEppip(x64emu_t *emu, uintptr_t fnc); void iFEppiV(x64emu_t *emu, uintptr_t fnc); void iFEpppp(x64emu_t *emu, uintptr_t fnc); void iFEpppV(x64emu_t *emu, uintptr_t fnc); +void iFiiipu(x64emu_t *emu, uintptr_t fnc); +void iFiiipp(x64emu_t *emu, uintptr_t fnc); void iFiiupp(x64emu_t *emu, uintptr_t fnc); void iFipiii(x64emu_t *emu, uintptr_t fnc); +void iFipuip(x64emu_t *emu, uintptr_t fnc); void iFipppi(x64emu_t *emu, uintptr_t fnc); void iFipppp(x64emu_t *emu, uintptr_t fnc); void iFpiiii(x64emu_t *emu, uintptr_t fnc); @@ -616,6 +624,7 @@ void iFppiup(x64emu_t *emu, uintptr_t fnc); void iFppipi(x64emu_t *emu, uintptr_t fnc); void iFppipp(x64emu_t *emu, uintptr_t fnc); void iFppupi(x64emu_t *emu, uintptr_t fnc); +void iFppLpi(x64emu_t *emu, uintptr_t fnc); void iFpppii(x64emu_t *emu, uintptr_t fnc); void iFpppiL(x64emu_t *emu, uintptr_t fnc); void iFpppip(x64emu_t *emu, uintptr_t fnc); @@ -747,6 +756,8 @@ void iFpppppL(x64emu_t *emu, uintptr_t fnc); void iFpppppp(x64emu_t *emu, uintptr_t fnc); void uFpippup(x64emu_t *emu, uintptr_t fnc); void UFpippup(x64emu_t *emu, uintptr_t fnc); +void lFipLipu(x64emu_t *emu, uintptr_t fnc); +void lFipLipp(x64emu_t *emu, uintptr_t fnc); void LFSpLiip(x64emu_t *emu, uintptr_t fnc); void pFEpippp(x64emu_t *emu, uintptr_t fnc); void pFEpuipp(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 812c1d2d..cb99170a 100755 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -1137,7 +1137,7 @@ static int isProcSelf(const char *path, const char* w) return 0; } -EXPORT int32_t my_readlink(x64emu_t* emu, void* path, void* buf, uint32_t sz) +EXPORT ssize_t my_readlink(x64emu_t* emu, void* path, void* buf, size_t sz) { if(isProcSelf((const char*)path, "exe")) { // special case for self... diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h index 7d9375e2..1ecabe4c 100755 --- a/src/wrapped/wrappedlibc_private.h +++ b/src/wrapped/wrappedlibc_private.h @@ -151,8 +151,8 @@ GO(closelog, vFv) //GO(__cmsg_nxthdr, //GO(confstr, //GO(__confstr_chk, -//GOW(__connect, -//GOW(connect, +GOW(__connect, iFipu) +GOW(connect, iFipu) //GO(copy_file_range, //GO(__copy_grp, //GOW(copysign, @@ -250,11 +250,11 @@ GOW(duplocale, pFp) //GO(envz_merge, //GO(envz_remove, //GO(envz_strip, -//GO(epoll_create, -//GO(epoll_create1, -//GO(epoll_ctl, +GO(epoll_create, iFi) +GO(epoll_create1, iFO) +GO(epoll_ctl, iFiiip) // need to check about alignment //GO(epoll_pwait, -//GO(epoll_wait, +GO(epoll_wait, iFipii) //GO(erand48, //GOW(erand48_r, //GO(err, @@ -602,7 +602,7 @@ GOW(getrlimit64, iFip) //GO(getsgnam_r, //GO(getsid, //GOW(getsockname, -//GOW(getsockopt, +GOW(getsockopt, iFiiipp) //GO(getsourcefilter, //GO(getspent, //GO(getspent_r, @@ -1459,7 +1459,7 @@ 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) +GOM(readlink, lFEppL) //weak GO(readlinkat, pFippL) //GO(__readlinkat_chk, //GO(__readlink_chk, @@ -1474,18 +1474,17 @@ GO2(__realpath_chk, pFppv, my_realpath) //GOW(re_comp, //GOW(re_compile_fastmap, //GOW(re_compile_pattern, -//GOW(__recv, -//GOW(recv, +GOW(__recv, lFipLi) +GOW(recv, lFipLi) //GO(__recv_chk, -//GOW(recvfrom, +GOW(recvfrom, lFipLipp) //GO(__recvfrom_chk, -//GO(recvmmsg, -//GOW(recvmsg, +GO(recvmmsg, iFipuip) +GOW(recvmsg, lFipi) //GOW(re_exec, //GOW(regcomp, //GOW(regerror, -//GO(regexec, -//GO(regexec, +GO(regexec, iFppLpi) //GOW(regfree, //GO(__register_atfork, //GOW(register_printf_function, @@ -1585,14 +1584,14 @@ GOW(select, iFipppp) //GO(semget, //GO(semop, //GO(semtimedop, -//GO(__send, -//GOW(send, -//GO(sendfile, -//GOW(sendfile64, -//GO(__sendmmsg, -//GOW(sendmmsg, -//GOW(sendmsg, -//GOW(sendto, +GO(__send, lFipLi) +GOW(send, lFipLi) +GO(sendfile, lFiipL) +GOW(sendfile64, lFiipL) +GO(__sendmmsg, iFipui) +GOW(sendmmsg, iFipui) +GOW(sendmsg, lFipi) +GOW(sendto, lFipLipu) //GO(setaliasent, GO(setbuf, vFpp) GOW(setbuffer, vFppL) @@ -1640,7 +1639,7 @@ GOW(setpriority, iFiii) //GO(setservent, //GO(setsgent, //GOW(setsid, -//GOW(setsockopt, +GOW(setsockopt, iFiiipu) //GO(setsourcefilter, //GO(setspent, //GOW(setstate, @@ -1710,8 +1709,8 @@ GOM(__snprintf, iFEpLpV) GOM(snprintf, iFEpLpV) //Weak GOM(__snprintf_chk, iFEpLiLpV) //Weak //GO(sockatmark, -//GO(__socket, -//GOW(socket, +GO(__socket, iFiii) +GOW(socket, iFiii) //GOW(socketpair, //GO(splice, GOM(sprintf, iFEppV) |