about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-06 14:22:26 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-06 14:22:26 +0100
commit6c32def5f7888e928cc858a07f99aeaa451b2274 (patch)
tree48884066dc2d23df40e28a4b6b233ccff6ef0f54 /src
parent57d6539292327fef86cb7e765c95cbedebec5f29 (diff)
downloadbox64-6c32def5f7888e928cc858a07f99aeaa451b2274.tar.gz
box64-6c32def5f7888e928cc858a07f99aeaa451b2274.zip
Added some memcpy and friends wrapped functions
Diffstat (limited to 'src')
-rw-r--r--src/wrapped/generated/functions_list.txt6
-rw-r--r--src/wrapped/generated/wrapper.c12
-rw-r--r--src/wrapped/generated/wrapper.h6
-rwxr-xr-xsrc/wrapped/wrappedlibc_private.h29
4 files changed, 38 insertions, 15 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt
index e5cf9d17..c2a55a37 100644
--- a/src/wrapped/generated/functions_list.txt
+++ b/src/wrapped/generated/functions_list.txt
@@ -18,6 +18,7 @@
 #() dFp
 #() lFp
 #() LFv
+#() LFp
 #() pFE
 #() pFu
 #() pFL
@@ -51,6 +52,7 @@
 #() iFEpV
 #() iFpiu
 #() iFpuL
+#() iFppL
 #() fFfff
 #() fFffp
 #() dFddd
@@ -58,6 +60,8 @@
 #() pFEpi
 #() pFEpp
 #() pFipp
+#() pFpiL
+#() pFppL
 #() vFEpup
 #() iFEupp
 #() iFEpip
@@ -65,6 +69,8 @@
 #() iFuipp
 #() pFEppi
 #() pFEppp
+#() pFppiL
+#() pFppuL
 #() iFEpppp
 #() iFipppi
 #() iFEpippppp
diff --git a/src/wrapped/generated/wrapper.c b/src/wrapped/generated/wrapper.c
index a6ce1ee7..82907502 100644
--- a/src/wrapped/generated/wrapper.c
+++ b/src/wrapped/generated/wrapper.c
@@ -89,6 +89,7 @@ typedef double (*dFd_t)(double);
 typedef double (*dFp_t)(void*);
 typedef intptr_t (*lFp_t)(void*);
 typedef uintptr_t (*LFv_t)(void);
+typedef uintptr_t (*LFp_t)(void*);
 typedef void* (*pFE_t)(x64emu_t*);
 typedef void* (*pFu_t)(uint32_t);
 typedef void* (*pFL_t)(uintptr_t);
@@ -122,6 +123,7 @@ typedef int32_t (*iFEpp_t)(x64emu_t*, void*, void*);
 typedef int32_t (*iFEpV_t)(x64emu_t*, void*, void*);
 typedef int32_t (*iFpiu_t)(void*, int32_t, uint32_t);
 typedef int32_t (*iFpuL_t)(void*, uint32_t, uintptr_t);
+typedef int32_t (*iFppL_t)(void*, void*, uintptr_t);
 typedef float (*fFfff_t)(float, float, float);
 typedef float (*fFffp_t)(float, float, void*);
 typedef double (*dFddd_t)(double, double, double);
@@ -129,6 +131,8 @@ typedef double (*dFddp_t)(double, double, void*);
 typedef void* (*pFEpi_t)(x64emu_t*, void*, int32_t);
 typedef void* (*pFEpp_t)(x64emu_t*, void*, void*);
 typedef void* (*pFipp_t)(int32_t, void*, void*);
+typedef void* (*pFpiL_t)(void*, int32_t, uintptr_t);
+typedef void* (*pFppL_t)(void*, void*, uintptr_t);
 typedef void (*vFEpup_t)(x64emu_t*, void*, uint32_t, void*);
 typedef int32_t (*iFEupp_t)(x64emu_t*, uint32_t, void*, void*);
 typedef int32_t (*iFEpip_t)(x64emu_t*, void*, int32_t, void*);
@@ -136,6 +140,8 @@ typedef int32_t (*iFEppp_t)(x64emu_t*, void*, void*, void*);
 typedef int32_t (*iFuipp_t)(uint32_t, int32_t, void*, void*);
 typedef void* (*pFEppi_t)(x64emu_t*, void*, void*, int32_t);
 typedef void* (*pFEppp_t)(x64emu_t*, void*, void*, void*);
+typedef void* (*pFppiL_t)(void*, void*, int32_t, uintptr_t);
+typedef void* (*pFppuL_t)(void*, void*, uint32_t, uintptr_t);
 typedef int32_t (*iFEpppp_t)(x64emu_t*, void*, void*, void*, void*);
 typedef int32_t (*iFipppi_t)(int32_t, void*, void*, void*, int32_t);
 typedef int32_t (*iFEpippppp_t)(x64emu_t*, void*, int32_t, void*, void*, void*, void*, void*);
@@ -172,6 +178,7 @@ void dFd(x64emu_t *emu, uintptr_t fcn) { dFd_t fn = (dFd_t)fcn; emu->xmm[0].d[0]
 void dFp(x64emu_t *emu, uintptr_t fcn) { dFp_t fn = (dFp_t)fcn; emu->xmm[0].d[0]=fn((void*)R_RDI); }
 void lFp(x64emu_t *emu, uintptr_t fcn) { lFp_t fn = (lFp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI); }
 void LFv(x64emu_t *emu, uintptr_t fcn) { LFv_t fn = (LFv_t)fcn; R_RAX=(uintptr_t)fn(); }
+void LFp(x64emu_t *emu, uintptr_t fcn) { LFp_t fn = (LFp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI); }
 void pFE(x64emu_t *emu, uintptr_t fcn) { pFE_t fn = (pFE_t)fcn; R_RAX=(uintptr_t)fn(emu); }
 void pFu(x64emu_t *emu, uintptr_t fcn) { pFu_t fn = (pFu_t)fcn; R_RAX=(uintptr_t)fn((uint32_t)R_RDI); }
 void pFL(x64emu_t *emu, uintptr_t fcn) { pFL_t fn = (pFL_t)fcn; R_RAX=(uintptr_t)fn((uintptr_t)R_RDI); }
@@ -205,6 +212,7 @@ void iFEpp(x64emu_t *emu, uintptr_t fcn) { iFEpp_t fn = (iFEpp_t)fcn; R_RAX=fn(e
 void iFEpV(x64emu_t *emu, uintptr_t fcn) { iFEpV_t fn = (iFEpV_t)fcn; R_RAX=fn(emu, (void*)R_RDI, (void*)(R_RSP + 8)); }
 void iFpiu(x64emu_t *emu, uintptr_t fcn) { iFpiu_t fn = (iFpiu_t)fcn; R_RAX=fn((void*)R_RDI, (int32_t)R_RSI, (uint32_t)R_RDX); }
 void iFpuL(x64emu_t *emu, uintptr_t fcn) { iFpuL_t fn = (iFpuL_t)fcn; R_RAX=fn((void*)R_RDI, (uint32_t)R_RSI, (uintptr_t)R_RDX); }
+void iFppL(x64emu_t *emu, uintptr_t fcn) { iFppL_t fn = (iFppL_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); }
 void fFfff(x64emu_t *emu, uintptr_t fcn) { fFfff_t fn = (fFfff_t)fcn; emu->xmm[0].f[0]=fn(emu->xmm[0].f[0], emu->xmm[1].f[0], emu->xmm[2].f[0]); }
 void fFffp(x64emu_t *emu, uintptr_t fcn) { fFffp_t fn = (fFffp_t)fcn; emu->xmm[0].f[0]=fn(emu->xmm[0].f[0], emu->xmm[1].f[0], (void*)R_RDI); }
 void dFddd(x64emu_t *emu, uintptr_t fcn) { dFddd_t fn = (dFddd_t)fcn; emu->xmm[0].d[0]=fn(emu->xmm[0].d[0], emu->xmm[1].d[0], emu->xmm[2].d[0]); }
@@ -212,6 +220,8 @@ void dFddp(x64emu_t *emu, uintptr_t fcn) { dFddp_t fn = (dFddp_t)fcn; emu->xmm[0
 void pFEpi(x64emu_t *emu, uintptr_t fcn) { pFEpi_t fn = (pFEpi_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (int32_t)R_RSI); }
 void pFEpp(x64emu_t *emu, uintptr_t fcn) { pFEpp_t fn = (pFEpp_t)fcn; R_RAX=(uintptr_t)fn(emu, (void*)R_RDI, (void*)R_RSI); }
 void pFipp(x64emu_t *emu, uintptr_t fcn) { pFipp_t fn = (pFipp_t)fcn; R_RAX=(uintptr_t)fn((int32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); }
+void pFpiL(x64emu_t *emu, uintptr_t fcn) { pFpiL_t fn = (pFpiL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX); }
+void pFppL(x64emu_t *emu, uintptr_t fcn) { pFppL_t fn = (pFppL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); }
 void vFEpup(x64emu_t *emu, uintptr_t fcn) { vFEpup_t fn = (vFEpup_t)fcn; fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX); }
 void iFEupp(x64emu_t *emu, uintptr_t fcn) { iFEupp_t fn = (iFEupp_t)fcn; R_RAX=fn(emu, (uint32_t)R_RDI, (void*)R_RSI, (void*)R_RDX); }
 void iFEpip(x64emu_t *emu, uintptr_t fcn) { iFEpip_t fn = (iFEpip_t)fcn; R_RAX=fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX); }
@@ -219,6 +229,8 @@ void iFEppp(x64emu_t *emu, uintptr_t fcn) { iFEppp_t fn = (iFEppp_t)fcn; R_RAX=f
 void iFuipp(x64emu_t *emu, uintptr_t fcn) { iFuipp_t fn = (iFuipp_t)fcn; R_RAX=fn((uint32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX); }
 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 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 pFppiL(x64emu_t *emu, uintptr_t fcn) { pFppiL_t fn = (pFppiL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX); }
+void pFppuL(x64emu_t *emu, uintptr_t fcn) { pFppuL_t fn = (pFppuL_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX); }
 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 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 iFEpippppp(x64emu_t *emu, uintptr_t fcn) { iFEpippppp_t fn = (iFEpippppp_t)fcn; R_RAX=fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); }
diff --git a/src/wrapped/generated/wrapper.h b/src/wrapped/generated/wrapper.h
index acac04a4..d8151547 100644
--- a/src/wrapped/generated/wrapper.h
+++ b/src/wrapped/generated/wrapper.h
@@ -50,6 +50,7 @@ void dFd(x64emu_t *emu, uintptr_t fnc);
 void dFp(x64emu_t *emu, uintptr_t fnc);
 void lFp(x64emu_t *emu, uintptr_t fnc);
 void LFv(x64emu_t *emu, uintptr_t fnc);
+void LFp(x64emu_t *emu, uintptr_t fnc);
 void pFE(x64emu_t *emu, uintptr_t fnc);
 void pFu(x64emu_t *emu, uintptr_t fnc);
 void pFL(x64emu_t *emu, uintptr_t fnc);
@@ -83,6 +84,7 @@ void iFEpp(x64emu_t *emu, uintptr_t fnc);
 void iFEpV(x64emu_t *emu, uintptr_t fnc);
 void iFpiu(x64emu_t *emu, uintptr_t fnc);
 void iFpuL(x64emu_t *emu, uintptr_t fnc);
+void iFppL(x64emu_t *emu, uintptr_t fnc);
 void fFfff(x64emu_t *emu, uintptr_t fnc);
 void fFffp(x64emu_t *emu, uintptr_t fnc);
 void dFddd(x64emu_t *emu, uintptr_t fnc);
@@ -90,6 +92,8 @@ void dFddp(x64emu_t *emu, uintptr_t fnc);
 void pFEpi(x64emu_t *emu, uintptr_t fnc);
 void pFEpp(x64emu_t *emu, uintptr_t fnc);
 void pFipp(x64emu_t *emu, uintptr_t fnc);
+void pFpiL(x64emu_t *emu, uintptr_t fnc);
+void pFppL(x64emu_t *emu, uintptr_t fnc);
 void vFEpup(x64emu_t *emu, uintptr_t fnc);
 void iFEupp(x64emu_t *emu, uintptr_t fnc);
 void iFEpip(x64emu_t *emu, uintptr_t fnc);
@@ -97,6 +101,8 @@ void iFEppp(x64emu_t *emu, uintptr_t fnc);
 void iFuipp(x64emu_t *emu, uintptr_t fnc);
 void pFEppi(x64emu_t *emu, uintptr_t fnc);
 void pFEppp(x64emu_t *emu, uintptr_t fnc);
+void pFppiL(x64emu_t *emu, uintptr_t fnc);
+void pFppuL(x64emu_t *emu, uintptr_t fnc);
 void iFEpppp(x64emu_t *emu, uintptr_t fnc);
 void iFipppi(x64emu_t *emu, uintptr_t fnc);
 void iFEpippppp(x64emu_t *emu, uintptr_t fnc);
diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h
index e8987aea..b20a5ffc 100755
--- a/src/wrapped/wrappedlibc_private.h
+++ b/src/wrapped/wrappedlibc_private.h
@@ -1119,11 +1119,22 @@ GO(malloc, pFL) // need to wrap to clear allocated memory?
 //GO(_mcount, 
 //GOW(mcount, 
 //GOW(memalign, 
-//GOW(memccpy, 
-//GO(memcpy, 
+GOW(memccpy, pFppiL)
+GO(memchr, pFpiL)
+GO(memcmp, iFppL)
+GO(memcpy, pFppL)
+GO(__memcpy_chk, pFppuL)
 //GO(memfd_create, 
 //GO(memfrob, 
 //GOW(memmem, 
+//GOI(memmove, 
+//GOI(__memmove_chk, 
+//GOI(__mempcpy, 
+//GOI(mempcpy, 
+//GOI(__mempcpy_chk, 
+//GOI(memrchr, 
+//GOI(memset, 
+//GOI(__memset_chk, 
 //GO(__mempcpy_small, 
 //GO(__merge_grp, 
 //GO(mincore, 
@@ -1754,6 +1765,7 @@ GO(strcmp, iFpp)
 //GO(strftime, 
 //GO(__strftime_l, 
 //GOW(strftime_l, 
+GO(strlen, LFp)
 //GO(__strncat_chk, 
 //GO(__strncpy_chk, 
 //GO(__strndup, 
@@ -2246,18 +2258,6 @@ GOM(__deregister_frame_info, pFp)
 //GOI(__gettimeofday, 
 //GOI(gettimeofday, 
 //GOI(index, 
-//GOI(memchr, 
-//GOI(memcmp, 
-//GOI(memcpy, 
-//GOI(__memcpy_chk, 
-//GOI(memmove, 
-//GOI(__memmove_chk, 
-//GOI(__mempcpy, 
-//GOI(mempcpy, 
-//GOI(__mempcpy_chk, 
-//GOI(memrchr, 
-//GOI(memset, 
-//GOI(__memset_chk, 
 //GOI(__rawmemchr, 
 //GOI(rawmemchr, 
 //GOI(rindex, 
@@ -2276,7 +2276,6 @@ GOM(__deregister_frame_info, pFp)
 //GOI(strcmp, 
 //GOI(strcpy, 
 //GOI(strcspn, 
-//GOI(strlen, 
 //GOI(strncasecmp, 
 //GOI(__strncasecmp_l, 
 //GOI(strncasecmp_l,