about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-05 14:41:10 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-05 14:41:10 +0100
commita6337819c0975b733ab8784dedbea7707da06a6f (patch)
tree5cb37a681c5020c25f53b35444e41e5e9961b8e9 /src
parentcafbaa1e239994ee0ef694e2650cb224ce15a7a9 (diff)
downloadbox64-a6337819c0975b733ab8784dedbea7707da06a6f.tar.gz
box64-a6337819c0975b733ab8784dedbea7707da06a6f.zip
Added atof, atoi, atol and atoll wrapped functions
Diffstat (limited to 'src')
-rw-r--r--src/wrapped/generated/functions_list.txt2
-rw-r--r--src/wrapped/generated/wrapper.c4
-rw-r--r--src/wrapped/generated/wrapper.h2
-rwxr-xr-xsrc/wrapped/wrappedlibc_private.h8
4 files changed, 12 insertions, 4 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt
index 5814e601..1dd76985 100644
--- a/src/wrapped/generated/functions_list.txt
+++ b/src/wrapped/generated/functions_list.txt
@@ -5,6 +5,8 @@
 #() iFi
 #() iFu
 #() iFp
+#() IFp
+#() dFp
 #() lFp
 #() pFE
 #() pFp
diff --git a/src/wrapped/generated/wrapper.c b/src/wrapped/generated/wrapper.c
index e80c2f78..db22ceed 100644
--- a/src/wrapped/generated/wrapper.c
+++ b/src/wrapped/generated/wrapper.c
@@ -76,6 +76,8 @@ typedef int32_t (*iFE_t)(x64emu_t*);
 typedef int32_t (*iFi_t)(int32_t);
 typedef int32_t (*iFu_t)(uint32_t);
 typedef int32_t (*iFp_t)(void*);
+typedef int64_t (*IFp_t)(void*);
+typedef double (*dFp_t)(void*);
 typedef intptr_t (*lFp_t)(void*);
 typedef void* (*pFE_t)(x64emu_t*);
 typedef void* (*pFp_t)(void*);
@@ -109,6 +111,8 @@ void iFE(x64emu_t *emu, uintptr_t fcn) { iFE_t fn = (iFE_t)fcn; R_RAX=fn(emu); }
 void iFi(x64emu_t *emu, uintptr_t fcn) { iFi_t fn = (iFi_t)fcn; R_RAX=fn((int32_t)R_RDI); }
 void iFu(x64emu_t *emu, uintptr_t fcn) { iFu_t fn = (iFu_t)fcn; R_RAX=fn((uint32_t)R_RDI); }
 void iFp(x64emu_t *emu, uintptr_t fcn) { iFp_t fn = (iFp_t)fcn; R_RAX=fn((void*)R_RDI); }
+void IFp(x64emu_t *emu, uintptr_t fcn) { IFp_t fn = (IFp_t)fcn; R_RAX=(uint64_t)fn((void*)R_RDI); }
+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 pFE(x64emu_t *emu, uintptr_t fcn) { pFE_t fn = (pFE_t)fcn; R_RAX=(uintptr_t)fn(emu); }
 void pFp(x64emu_t *emu, uintptr_t fcn) { pFp_t fn = (pFp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI); }
diff --git a/src/wrapped/generated/wrapper.h b/src/wrapped/generated/wrapper.h
index dee487d3..2b8bac8a 100644
--- a/src/wrapped/generated/wrapper.h
+++ b/src/wrapped/generated/wrapper.h
@@ -37,6 +37,8 @@ void iFE(x64emu_t *emu, uintptr_t fnc);
 void iFi(x64emu_t *emu, uintptr_t fnc);
 void iFu(x64emu_t *emu, uintptr_t fnc);
 void iFp(x64emu_t *emu, uintptr_t fnc);
+void IFp(x64emu_t *emu, uintptr_t fnc);
+void dFp(x64emu_t *emu, uintptr_t fnc);
 void lFp(x64emu_t *emu, uintptr_t fnc);
 void pFE(x64emu_t *emu, uintptr_t fnc);
 void pFp(x64emu_t *emu, uintptr_t fnc);
diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h
index 4d9b7ecc..aa5a9434 100755
--- a/src/wrapped/wrappedlibc_private.h
+++ b/src/wrapped/wrappedlibc_private.h
@@ -55,10 +55,10 @@
 //GO(__assert, 
 //GO(__assert_fail, 
 //GO(__assert_perror_fail, 
-//GO(atof, 
-//GO(atoi, 
-//GO(atol, 
-//GO(atoll, 
+GO(atof, dFp)
+GO(atoi, iFp)
+GO(atol, lFp)
+GO(atoll, IFp)
 //GO(authdes_create, 
 //GO(authdes_getucred, 
 //GO(authdes_pk_create,