about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-13 13:47:30 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-13 13:47:30 +0100
commit721038513fb3f0065a64072db120f8d7256da4d8 (patch)
treece1662de6e3399e32c30b6b97049faa8a6234f31 /src
parent195efffa15cb6d3838d2d2e3db9d23f218c49ccc (diff)
downloadbox64-721038513fb3f0065a64072db120f8d7256da4d8.tar.gz
box64-721038513fb3f0065a64072db120f8d7256da4d8.zip
Wrapped some more 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.c9
-rwxr-xr-xsrc/wrapped/wrappedlibc_private.h8
-rwxr-xr-xsrc/wrapped/wrappedlibpthread_private.h2
6 files changed, 17 insertions, 10 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt
index d34f086d..c0fd7dde 100644
--- a/src/wrapped/generated/functions_list.txt
+++ b/src/wrapped/generated/functions_list.txt
@@ -237,6 +237,7 @@
 #() iFppd
 #() iFppL
 #() iFppp
+#() iFppV
 #() iFSpL
 #() IFiIi
 #() IFpIi
@@ -544,6 +545,7 @@
 #() iFiiupp
 #() iFipiii
 #() iFipppi
+#() iFipppp
 #() iFpiiii
 #() iFpiiip
 #() iFpiiuu
diff --git a/src/wrapped/generated/wrapper.c b/src/wrapped/generated/wrapper.c
index fa9f89cc..2ed7125a 100644
--- a/src/wrapped/generated/wrapper.c
+++ b/src/wrapped/generated/wrapper.c
@@ -270,6 +270,7 @@ typedef int32_t (*iFppu_t)(void*, void*, uint32_t);
 typedef int32_t (*iFppd_t)(void*, void*, double);
 typedef int32_t (*iFppL_t)(void*, void*, uintptr_t);
 typedef int32_t (*iFppp_t)(void*, void*, void*);
+typedef int32_t (*iFppV_t)(void*, void*, void*);
 typedef int32_t (*iFSpL_t)(void*, void*, uintptr_t);
 typedef int64_t (*IFiIi_t)(int32_t, int64_t, int32_t);
 typedef int64_t (*IFpIi_t)(void*, int64_t, int32_t);
@@ -577,6 +578,7 @@ typedef int32_t (*iFEpppV_t)(x64emu_t*, void*, void*, 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 (*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);
 typedef int32_t (*iFpiiip_t)(void*, int32_t, int32_t, int32_t, void*);
 typedef int32_t (*iFpiiuu_t)(void*, int32_t, int32_t, uint32_t, uint32_t);
@@ -1208,6 +1210,7 @@ void iFppu(x64emu_t *emu, uintptr_t fcn) { iFppu_t fn = (iFppu_t)fcn; R_RAX=fn((
 void iFppd(x64emu_t *emu, uintptr_t fcn) { iFppd_t fn = (iFppd_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, emu->xmm[0].d[0]); }
 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 iFppp(x64emu_t *emu, uintptr_t fcn) { iFppp_t fn = (iFppp_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); }
+void iFppV(x64emu_t *emu, uintptr_t fcn) { iFppV_t fn = (iFppV_t)fcn; R_RAX=fn((void*)R_RDI, (void*)R_RSI, (void*)(R_RSP + 8)); }
 void iFSpL(x64emu_t *emu, uintptr_t fcn) { iFSpL_t fn = (iFSpL_t)fcn; R_RAX=fn(io_convert((void*)R_RDI), (void*)R_RSI, (uintptr_t)R_RDX); }
 void IFiIi(x64emu_t *emu, uintptr_t fcn) { IFiIi_t fn = (IFiIi_t)fcn; R_RAX=(uint64_t)fn((int32_t)R_RDI, (int64_t)R_RSI, (int32_t)R_RDX); }
 void IFpIi(x64emu_t *emu, uintptr_t fcn) { IFpIi_t fn = (IFpIi_t)fcn; R_RAX=(uint64_t)fn((void*)R_RDI, (int64_t)R_RSI, (int32_t)R_RDX); }
@@ -1515,6 +1518,7 @@ void iFEpppV(x64emu_t *emu, uintptr_t fcn) { iFEpppV_t fn = (iFEpppV_t)fcn; R_RA
 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 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); }
 void iFpiiip(x64emu_t *emu, uintptr_t fcn) { iFpiiip_t fn = (iFpiiip_t)fcn; R_RAX=fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (void*)R_R8); }
 void iFpiiuu(x64emu_t *emu, uintptr_t fcn) { iFpiiuu_t fn = (iFpiiuu_t)fcn; R_RAX=fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8); }
diff --git a/src/wrapped/generated/wrapper.h b/src/wrapped/generated/wrapper.h
index 88b969a9..12c264cb 100644
--- a/src/wrapped/generated/wrapper.h
+++ b/src/wrapped/generated/wrapper.h
@@ -267,6 +267,7 @@ void iFppu(x64emu_t *emu, uintptr_t fnc);
 void iFppd(x64emu_t *emu, uintptr_t fnc);
 void iFppL(x64emu_t *emu, uintptr_t fnc);
 void iFppp(x64emu_t *emu, uintptr_t fnc);
+void iFppV(x64emu_t *emu, uintptr_t fnc);
 void iFSpL(x64emu_t *emu, uintptr_t fnc);
 void IFiIi(x64emu_t *emu, uintptr_t fnc);
 void IFpIi(x64emu_t *emu, uintptr_t fnc);
@@ -574,6 +575,7 @@ void iFEpppV(x64emu_t *emu, uintptr_t fnc);
 void iFiiupp(x64emu_t *emu, uintptr_t fnc);
 void iFipiii(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);
 void iFpiiip(x64emu_t *emu, uintptr_t fnc);
 void iFpiiuu(x64emu_t *emu, uintptr_t fnc);
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index ef4c5c25..21291cd5 100755
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -759,15 +759,14 @@ EXPORT int my___isoc99_vsscanf(x64emu_t* emu, void* stream, void* fmt, void* b)
 
 EXPORT int my___isoc99_vfscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my_vfscanf")));
 EXPORT int my___isoc99_fscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my_vfscanf")));
-
-EXPORT int my___isoc99_sscanf(x64emu_t* emu, void* stream, void* fmt, void* b)
+#endif
+EXPORT int my___isoc99_sscanf(x64emu_t* emu, void* stream, void* fmt, uint64_t* b)
 {
-  void* f = sscanf;
+  myStackAlignScanf(emu, (const char*)fmt, b, emu->scratch, 2);
   PREPARE_VALIST;
 
-  return ((iFppp_t)f)(stream, fmt, VARARGS);
+  return vsscanf(stream, fmt, VARARGS);
 }
-#endif
 
 EXPORT int my_vsnprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, x64_va_list_t b) {
     // need to align on arm
diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h
index ef636efa..c642c94d 100755
--- a/src/wrapped/wrappedlibc_private.h
+++ b/src/wrapped/wrappedlibc_private.h
@@ -906,7 +906,7 @@ GOW(isnanf, iFf)
 //GO(__isoc99_fscanf, 
 //GO(__isoc99_fwscanf, 
 //GO(__isoc99_scanf, 
-//GO(__isoc99_sscanf, 
+GOM(__isoc99_sscanf, iFppV)
 //GO(__isoc99_swscanf, 
 //GO(__isoc99_vfscanf, 
 //GO(__isoc99_vfwscanf, 
@@ -1578,9 +1578,9 @@ GO2(__realpath_chk, pFppv, my_realpath)
 //GOW(secure_getenv, 
 //GO(seed48, 
 //GOW(seed48_r, 
-//GO(seekdir, 
-//GO(__select, 
-//GOW(select, 
+GO(seekdir, vFpi)
+GO(__select, iFipppp)
+GOW(select, iFipppp)
 //GO(semctl, 
 //GO(semget, 
 //GO(semop, 
diff --git a/src/wrapped/wrappedlibpthread_private.h b/src/wrapped/wrappedlibpthread_private.h
index df32d63d..7eaa6858 100755
--- a/src/wrapped/wrappedlibpthread_private.h
+++ b/src/wrapped/wrappedlibpthread_private.h
@@ -65,7 +65,7 @@ GOM(pthread_cond_signal, iFEp)
 GOM(pthread_cond_timedwait, iFEppp)
 GOM(pthread_cond_wait, iFEpp)
 GOM(pthread_create, iFEpppp)
-//GO(pthread_detach, iFu)
+GO(pthread_detach, iFL)
 GO(pthread_equal, iFLL)
 //GOM(pthread_exit, vFEp)
 //GOM(pthread_getaffinity_np, iFEpup)