about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-08-31 14:52:45 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-08-31 14:52:45 +0200
commit6f086014799148ae4e5c9375558118a19a916df3 (patch)
tree254d2472116f9bac99add150f730e010d3962946 /src
parent6d6739ccea802354cdba614190d1e87ab8ed0072 (diff)
downloadbox64-6f086014799148ae4e5c9375558118a19a916df3.tar.gz
box64-6f086014799148ae4e5c9375558118a19a916df3.zip
[BOX32] Another batch of 32bits wrapped function, for libtier0_s.so
Diffstat (limited to 'src')
-rwxr-xr-xsrc/include/myalign32.h30
-rwxr-xr-xsrc/libtools/myalign64_32.c55
-rw-r--r--src/wrapped32/generated/functions_list.txt25
-rw-r--r--src/wrapped32/generated/wrappedlibctypes32.h11
-rw-r--r--src/wrapped32/generated/wrapper32.c26
-rw-r--r--src/wrapped32/generated/wrapper32.h14
-rwxr-xr-xsrc/wrapped32/wrappedlibc.c297
-rwxr-xr-xsrc/wrapped32/wrappedlibc_private.h84
8 files changed, 381 insertions, 161 deletions
diff --git a/src/include/myalign32.h b/src/include/myalign32.h
index 2638bf5d..c6576643 100755
--- a/src/include/myalign32.h
+++ b/src/include/myalign32.h
@@ -83,6 +83,7 @@ void myStackAlignW32(const char* fmt, uint32_t* st, uint64_t* mystack);
 
 void UnalignStat64_32(const void* source, void* dest);
 
+void UnalignStatFS_32(const void* source, void* dest);
 void UnalignStatFS64_32(const void* source, void* dest);
 #if 0
 void UnalignOggVorbis(void* dest, void* source); // Arm -> x86
@@ -180,7 +181,36 @@ struct i386_statvfs64 {
   int __f_spare[5];
 } __attribute__((packed));
 
+struct i386_statvfs {
+  ulong_t f_bsize;
+  ulong_t f_frsize;
+  uint32_t f_blocks;
+  uint32_t f_bfree;
+  uint32_t f_bavail;
+  uint32_t f_files;
+  uint32_t f_ffree;
+  uint32_t f_favail;
+  ulong_t f_fsid;
+  int __f_unused;
+  ulong_t f_flag;
+  ulong_t f_namemax;
+  unsigned int f_type;
+  int __f_spare[5];
+} __attribute__((packed));
+
+void UnalignStatVFS_32(const void* source, void* dest);
 void UnalignStatVFS64_32(const void* source, void* dest);
+
+struct i386_dirent
+{
+  ulong_t d_ino;
+  ulong_t d_off;
+  uint16_t d_reclen;
+  uint8_t d_type;
+  char d_name[256];
+};
+void UnalignDirent_32(const void* source, void* dest);
+
 #if 0
 typedef struct {
   unsigned char *data;
diff --git a/src/libtools/myalign64_32.c b/src/libtools/myalign64_32.c
index f740c4f2..1c4a3d30 100755
--- a/src/libtools/myalign64_32.c
+++ b/src/libtools/myalign64_32.c
@@ -5,6 +5,7 @@
 #include <asm/stat.h>
 #include <sys/vfs.h>
 #include <sys/statvfs.h>
+#include <dirent.h>
 
 #include "x64emu.h"
 #include "emu/x64emu_private.h"
@@ -56,7 +57,6 @@ struct native_statfs64 {
   uint32_t    f_spare[4];
 };  // f_flags is not always defined, but then f_spare is [5] in that case
 
-
 void UnalignStatFS64_32(const void* source, void* dest)
 {
     struct i386_statfs64 *i386st = (struct i386_statfs64*)dest;
@@ -79,6 +79,28 @@ void UnalignStatFS64_32(const void* source, void* dest)
     i386st->f_spare[3]  = st->f_spare[3];
 }
 
+void UnalignStatFS_32(const void* source, void* dest)
+{
+    struct i386_statfs *i386st = (struct i386_statfs*)dest;
+    struct native_statfs64 *st = (struct native_statfs64*) source;
+
+    i386st->f_type      = st->f_type;
+    i386st->f_bsize     = st->f_bsize;
+    i386st->f_blocks    = st->f_blocks;
+    i386st->f_bfree     = st->f_bfree;
+    i386st->f_bavail    = st->f_bavail;
+    i386st->f_files     = st->f_files;
+    i386st->f_ffree     = st->f_ffree;
+    memcpy(&i386st->f_fsid, &st->f_fsid, sizeof(i386st->f_fsid));
+    i386st->f_namelen   = st->f_namelen;
+    i386st->f_frsize    = st->f_frsize;
+    i386st->f_flags     = st->f_flags;
+    i386st->f_spare[0]  = st->f_spare[0];
+    i386st->f_spare[1]  = st->f_spare[1];
+    i386st->f_spare[2]  = st->f_spare[2];
+    i386st->f_spare[3]  = st->f_spare[3];
+}
+
 struct native_statvfs {
     unsigned long int f_bsize;
     unsigned long int f_frsize;
@@ -117,6 +139,37 @@ void UnalignStatVFS64_32(const void* source, void* dest)
     i386st->f_type      = st->f_type;
 }
 
+void UnalignStatVFS_32(const void* source, void* dest)
+{
+    struct i386_statvfs *i386st = (struct i386_statvfs*)dest;
+    struct native_statvfs *st = (struct native_statvfs*) source;
+
+    i386st->f_bsize     = st->f_bsize;
+    i386st->f_frsize    = st->f_frsize;
+    i386st->f_blocks    = st->f_blocks;
+    i386st->f_bfree     = st->f_bfree;
+    i386st->f_bavail    = st->f_bavail;
+    i386st->f_files     = st->f_files;
+    i386st->f_ffree     = st->f_ffree;
+    i386st->f_favail    = st->f_favail;
+    i386st->f_fsid      = st->f_fsid;
+    i386st->f_flag      = st->f_flag;
+    i386st->f_namemax   = st->f_namemax;
+    i386st->f_type      = st->f_type;
+}
+
+void UnalignDirent_32(const void* source, void* dest)
+{
+    struct i386_dirent* i386d = (struct i386_dirent*)dest;
+    struct dirent* d = (struct dirent*)source;
+
+    i386d->d_ino = d->d_ino ^ (d->d_ino >> 32);
+    i386d->d_off = d->d_off;
+    i386d->d_reclen = d->d_reclen - 8;
+    i386d->d_type = d->d_type;
+    memcpy(i386d->d_name, d->d_name, d->d_reclen - (8+2+1));
+}
+
 #define TRANSFERT   \
 GO(l_type)          \
 GO(l_whence)        \
diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt
index a5cee043..25e262ca 100644
--- a/src/wrapped32/generated/functions_list.txt
+++ b/src/wrapped32/generated/functions_list.txt
@@ -35,9 +35,11 @@
 #() pFp -> pFp
 #() hFv -> hFv
 #() aFa -> aFa
+#() tFi -> tFi
 #() tFp -> tFp
 #() LFrL_ -> LFB
 #() pFrL_ -> pFB
+#() LFriiiiiiiiilt_ -> LFB
 #() vFEv -> vFEv
 #() vFEp -> vFEp
 #() iFEv -> iFEv
@@ -56,6 +58,7 @@
 #() iFli -> iFli
 #() iFpi -> iFpi
 #() iFpu -> iFpu
+#() iFpL -> iFpL
 #() iFpp -> iFpp
 #() iFph -> iFph
 #() iFhp -> iFhp
@@ -93,7 +96,9 @@
 #() pFrL_p -> pFBp
 #() iFuBLL_ -> iFuB
 #() iFprLL_ -> iFpB
+#() iFBLL_p -> iFBp
 #() iFrLL_BLL_ -> iFBB
+#() pFriiiiiiiiilt_p -> pFBp
 #() vFEip -> vFEip
 #() vFEpi -> vFEpi
 #() vFEpu -> vFEpu
@@ -113,6 +118,7 @@
 #() iFiuu -> iFiuu
 #() iFiLN -> iFiLN
 #() iFipu -> iFipu
+#() iFipL -> iFipL
 #() iFipp -> iFipp
 #() iFuii -> iFuii
 #() iFuip -> iFuip
@@ -136,12 +142,12 @@
 #() dFddd -> dFddd
 #() dFddp -> dFddp
 #() lFipL -> lFipL
+#() lFlpi -> lFlpi
 #() pFEip -> pFEip
 #() pFEpi -> pFEpi
 #() pFEpp -> pFEpp
 #() pFpiL -> pFpiL
 #() pFpih -> pFpih
-#() pFppu -> pFppu
 #() pFppL -> pFppL
 #() pFpOM -> pFpOM
 #() hFEpp -> hFEpp
@@ -158,6 +164,7 @@
 #() iFELup -> iFELup
 #() iFEpip -> iFEpip
 #() iFEpup -> iFEpup
+#() iFEpLi -> iFEpLi
 #() iFEppL -> iFEppL
 #() iFEppp -> iFEppp
 #() iFEppV -> iFEppV
@@ -166,6 +173,7 @@
 #() iFiiiN -> iFiiiN
 #() iFiiII -> iFiiII
 #() iFiuui -> iFiuui
+#() iFipii -> iFipii
 #() iFipup -> iFipup
 #() iFuupi -> iFuupi
 #() iFhpiL -> iFhpiL
@@ -189,6 +197,8 @@
 #() iFEpuppp -> iFEpuppp
 #() iFEpLppp -> iFEpLppp
 #() iFEpLiipV -> iFEpLiipV
+#() pFEpLiiii -> pFEpLiiii
+#() pFEpLiiiI -> pFEpLiiiI
 #() iFEpippppp -> iFEpippppp
 #defined(ANDROID) vFEpppp -> vFEpppp
 #defined(HAVE_LD80BITS) DFD -> DFD
@@ -199,6 +209,8 @@
 #!defined(HAVE_LD80BITS) KFKp -> KFKp
 #() iFEvpV -> iFEpV
 #() UFsvvs -> UFss
+#() pFEppv -> pFEpp
+#() iFEpvpp -> iFEppp
 #() iFEhvpV -> iFEhpV
 #() iFEpvvpV -> iFEppV
 #() iFEpuvvppp -> iFEpuppp
@@ -236,8 +248,11 @@ wrappedlibc:
   - setrlimit
 - iFpi:
   - backtrace
+- iFpL:
 - iFpp:
   - alphasort64
+  - statvfs
+  - utimes
 - iFpV:
 - iFhp:
   - statvfs64
@@ -245,6 +260,8 @@ wrappedlibc:
 - UFUU:
 - pFip:
   - signal
+- pFpi:
+  - backtrace_symbols
 - pFpp:
   - gmtime_r
   - localtime_r
@@ -254,16 +271,20 @@ wrappedlibc:
 - iFiip:
 - iFiiN:
 - iFipp:
+- iFpLi:
 - iFppL:
 - iFppp:
 - iFppV:
 - iFpOu:
 - lFipL:
+- pFppv:
+  - __realpath_chk
 - vFpLLp:
 - vFpppp:
   - __libc_init
 - iFiiII:
 - iFLLLL:
+- iFpvpp:
 - iFppiV:
 - iFpppp:
   - getaddrinfo
@@ -272,6 +293,8 @@ wrappedlibc:
 - iFpippp:
 - iFpLppp:
 - iFpLiipV:
+- pFpLiiii:
+- pFpLiiiI:
 - iFpippppp:
 - iFpuvvppp:
 wrappedlibdl:
diff --git a/src/wrapped32/generated/wrappedlibctypes32.h b/src/wrapped32/generated/wrappedlibctypes32.h
index 0a032fe6..a0afe81b 100644
--- a/src/wrapped32/generated/wrappedlibctypes32.h
+++ b/src/wrapped32/generated/wrappedlibctypes32.h
@@ -29,12 +29,14 @@ typedef void (*vFpi_t)(void*, int32_t);
 typedef void (*vFpu_t)(void*, uint32_t);
 typedef int32_t (*iFip_t)(int32_t, void*);
 typedef int32_t (*iFpi_t)(void*, int32_t);
+typedef int32_t (*iFpL_t)(void*, uintptr_t);
 typedef int32_t (*iFpp_t)(void*, void*);
 typedef int32_t (*iFpV_t)(void*, ...);
 typedef int32_t (*iFhp_t)(uintptr_t, void*);
 typedef int64_t (*IFII_t)(int64_t, int64_t);
 typedef uint64_t (*UFUU_t)(uint64_t, uint64_t);
 typedef void* (*pFip_t)(int32_t, void*);
+typedef void* (*pFpi_t)(void*, int32_t);
 typedef void* (*pFpp_t)(void*, void*);
 typedef uintptr_t (*hFpp_t)(void*, void*);
 typedef void (*vFipV_t)(int32_t, void*, ...);
@@ -42,15 +44,18 @@ typedef int32_t (*iFvpV_t)(void, void*, ...);
 typedef int32_t (*iFiip_t)(int32_t, int32_t, void*);
 typedef int32_t (*iFiiN_t)(int32_t, int32_t, ...);
 typedef int32_t (*iFipp_t)(int32_t, void*, void*);
+typedef int32_t (*iFpLi_t)(void*, uintptr_t, int32_t);
 typedef int32_t (*iFppL_t)(void*, void*, uintptr_t);
 typedef int32_t (*iFppp_t)(void*, void*, void*);
 typedef int32_t (*iFppV_t)(void*, void*, ...);
 typedef int32_t (*iFpOu_t)(void*, int32_t, uint32_t);
 typedef intptr_t (*lFipL_t)(int32_t, void*, uintptr_t);
+typedef void* (*pFppv_t)(void*, void*, void);
 typedef void (*vFpLLp_t)(void*, uintptr_t, uintptr_t, void*);
 typedef void (*vFpppp_t)(void*, void*, void*, void*);
 typedef int32_t (*iFiiII_t)(int32_t, int32_t, int64_t, int64_t);
 typedef int32_t (*iFLLLL_t)(uintptr_t, uintptr_t, uintptr_t, uintptr_t);
+typedef int32_t (*iFpvpp_t)(void*, void, void*, void*);
 typedef int32_t (*iFppiV_t)(void*, void*, int32_t, ...);
 typedef int32_t (*iFpppp_t)(void*, void*, void*, void*);
 typedef int32_t (*iFhvpV_t)(uintptr_t, void, void*, ...);
@@ -58,6 +63,8 @@ typedef int32_t (*iFpvvpV_t)(void*, void, void, void*, ...);
 typedef int32_t (*iFpippp_t)(void*, int32_t, void*, void*, void*);
 typedef int32_t (*iFpLppp_t)(void*, uintptr_t, void*, void*, void*);
 typedef int32_t (*iFpLiipV_t)(void*, uintptr_t, int32_t, int32_t, void*, ...);
+typedef void* (*pFpLiiii_t)(void*, uintptr_t, int32_t, int32_t, int32_t, int32_t);
+typedef void* (*pFpLiiiI_t)(void*, uintptr_t, int32_t, int32_t, int32_t, int64_t);
 typedef int32_t (*iFpippppp_t)(void*, int32_t, void*, void*, void*, void*, void*);
 typedef int32_t (*iFpuvvppp_t)(void*, uint32_t, void, void, void*, void*, void*);
 
@@ -72,10 +79,14 @@ typedef int32_t (*iFpuvvppp_t)(void*, uint32_t, void, void, void*, void*, void*)
 	GO(setrlimit, iFip_t) \
 	GO(backtrace, iFpi_t) \
 	GO(alphasort64, iFpp_t) \
+	GO(statvfs, iFpp_t) \
+	GO(utimes, iFpp_t) \
 	GO(statvfs64, iFhp_t) \
 	GO(signal, pFip_t) \
+	GO(backtrace_symbols, pFpi_t) \
 	GO(gmtime_r, pFpp_t) \
 	GO(localtime_r, pFpp_t) \
+	GO(__realpath_chk, pFppv_t) \
 	GO(__libc_init, vFpppp_t) \
 	GO(getaddrinfo, iFpppp_t)
 
diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c
index 50c13938..9483a408 100644
--- a/src/wrapped32/generated/wrapper32.c
+++ b/src/wrapped32/generated/wrapper32.c
@@ -109,9 +109,11 @@ typedef void* (*pFL_t)(uintptr_t);
 typedef void* (*pFp_t)(void*);
 typedef uintptr_t (*hFv_t)(void);
 typedef void* (*aFa_t)(void*);
+typedef char* (*tFi_t)(int32_t);
 typedef char* (*tFp_t)(void*);
 typedef uintptr_t (*LFrL__t)(struct_L_t*);
 typedef void* (*pFrL__t)(struct_L_t*);
+typedef uintptr_t (*LFriiiiiiiiilt__t)(struct_iiiiiiiiilt_t*);
 typedef void (*vFEv_t)(x64emu_t*);
 typedef void (*vFEp_t)(x64emu_t*, void*);
 typedef int32_t (*iFEv_t)(x64emu_t*);
@@ -130,6 +132,7 @@ typedef int32_t (*iFup_t)(uint32_t, void*);
 typedef int32_t (*iFli_t)(intptr_t, int32_t);
 typedef int32_t (*iFpi_t)(void*, int32_t);
 typedef int32_t (*iFpu_t)(void*, uint32_t);
+typedef int32_t (*iFpL_t)(void*, uintptr_t);
 typedef int32_t (*iFpp_t)(void*, void*);
 typedef int32_t (*iFph_t)(void*, uintptr_t);
 typedef int32_t (*iFhp_t)(uintptr_t, void*);
@@ -167,7 +170,9 @@ typedef double (*dFpBp__t)(void*, struct_p_t*);
 typedef void* (*pFrL_p_t)(struct_L_t*, void*);
 typedef int32_t (*iFuBLL__t)(uint32_t, struct_LL_t*);
 typedef int32_t (*iFprLL__t)(void*, struct_LL_t*);
+typedef int32_t (*iFBLL_p_t)(struct_LL_t*, void*);
 typedef int32_t (*iFrLL_BLL__t)(struct_LL_t*, struct_LL_t*);
+typedef void* (*pFriiiiiiiiilt_p_t)(struct_iiiiiiiiilt_t*, void*);
 typedef void (*vFEip_t)(x64emu_t*, int32_t, void*);
 typedef void (*vFEpi_t)(x64emu_t*, void*, int32_t);
 typedef void (*vFEpu_t)(x64emu_t*, void*, uint32_t);
@@ -187,6 +192,7 @@ typedef int32_t (*iFiII_t)(int32_t, int64_t, int64_t);
 typedef int32_t (*iFiuu_t)(int32_t, uint32_t, uint32_t);
 typedef int32_t (*iFiLN_t)(int32_t, uintptr_t, ...);
 typedef int32_t (*iFipu_t)(int32_t, void*, uint32_t);
+typedef int32_t (*iFipL_t)(int32_t, void*, uintptr_t);
 typedef int32_t (*iFipp_t)(int32_t, void*, void*);
 typedef int32_t (*iFuii_t)(uint32_t, int32_t, int32_t);
 typedef int32_t (*iFuip_t)(uint32_t, int32_t, void*);
@@ -210,12 +216,12 @@ typedef float (*fFffp_t)(float, float, void*);
 typedef double (*dFddd_t)(double, double, double);
 typedef double (*dFddp_t)(double, double, void*);
 typedef intptr_t (*lFipL_t)(int32_t, void*, uintptr_t);
+typedef intptr_t (*lFlpi_t)(intptr_t, void*, int32_t);
 typedef void* (*pFEip_t)(x64emu_t*, int32_t, void*);
 typedef void* (*pFEpi_t)(x64emu_t*, void*, int32_t);
 typedef void* (*pFEpp_t)(x64emu_t*, void*, void*);
 typedef void* (*pFpiL_t)(void*, int32_t, uintptr_t);
 typedef void* (*pFpih_t)(void*, int32_t, uintptr_t);
-typedef void* (*pFppu_t)(void*, void*, uint32_t);
 typedef void* (*pFppL_t)(void*, void*, uintptr_t);
 typedef void* (*pFpOM_t)(void*, int32_t, ...);
 typedef uintptr_t (*hFEpp_t)(x64emu_t*, void*, void*);
@@ -232,6 +238,7 @@ typedef int32_t (*iFEipp_t)(x64emu_t*, int32_t, void*, void*);
 typedef int32_t (*iFELup_t)(x64emu_t*, uintptr_t, uint32_t, void*);
 typedef int32_t (*iFEpip_t)(x64emu_t*, void*, int32_t, void*);
 typedef int32_t (*iFEpup_t)(x64emu_t*, void*, uint32_t, void*);
+typedef int32_t (*iFEpLi_t)(x64emu_t*, void*, uintptr_t, int32_t);
 typedef int32_t (*iFEppL_t)(x64emu_t*, void*, void*, uintptr_t);
 typedef int32_t (*iFEppp_t)(x64emu_t*, void*, void*, void*);
 typedef int32_t (*iFEppV_t)(x64emu_t*, void*, void*, void*);
@@ -240,6 +247,7 @@ typedef int32_t (*iFEhpV_t)(x64emu_t*, uintptr_t, void*, void*);
 typedef int32_t (*iFiiiN_t)(int32_t, int32_t, int32_t, ...);
 typedef int32_t (*iFiiII_t)(int32_t, int32_t, int64_t, int64_t);
 typedef int32_t (*iFiuui_t)(int32_t, uint32_t, uint32_t, int32_t);
+typedef int32_t (*iFipii_t)(int32_t, void*, int32_t, int32_t);
 typedef int32_t (*iFipup_t)(int32_t, void*, uint32_t, void*);
 typedef int32_t (*iFuupi_t)(uint32_t, uint32_t, void*, int32_t);
 typedef int32_t (*iFhpiL_t)(uintptr_t, void*, int32_t, uintptr_t);
@@ -263,6 +271,8 @@ typedef int32_t (*iFEpippp_t)(x64emu_t*, void*, int32_t, void*, void*, void*);
 typedef int32_t (*iFEpuppp_t)(x64emu_t*, void*, uint32_t, void*, void*, void*);
 typedef int32_t (*iFEpLppp_t)(x64emu_t*, void*, uintptr_t, void*, void*, void*);
 typedef int32_t (*iFEpLiipV_t)(x64emu_t*, void*, uintptr_t, int32_t, int32_t, void*, void*);
+typedef void* (*pFEpLiiii_t)(x64emu_t*, void*, uintptr_t, int32_t, int32_t, int32_t, int32_t);
+typedef void* (*pFEpLiiiI_t)(x64emu_t*, void*, uintptr_t, int32_t, int32_t, int32_t, int64_t);
 typedef int32_t (*iFEpippppp_t)(x64emu_t*, void*, int32_t, void*, void*, void*, void*, void*);
 
 #if defined(ANDROID)
@@ -318,9 +328,11 @@ void pFL_32(x64emu_t *emu, uintptr_t fcn) { pFL_t fn = (pFL_t)fcn; R_EAX = to_pt
 void pFp_32(x64emu_t *emu, uintptr_t fcn) { pFp_t fn = (pFp_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4))); }
 void hFv_32(x64emu_t *emu, uintptr_t fcn) { hFv_t fn = (hFv_t)fcn; R_EAX = to_hash(fn()); }
 void aFa_32(x64emu_t *emu, uintptr_t fcn) { aFa_t fn = (aFa_t)fcn; R_EAX = to_locale(fn(from_locale(from_ptri(ptr_t, R_ESP + 4)))); }
+void tFi_32(x64emu_t *emu, uintptr_t fcn) { tFi_t fn = (tFi_t)fcn; R_EAX = to_cstring(fn(from_ptri(int32_t, R_ESP + 4))); }
 void tFp_32(x64emu_t *emu, uintptr_t fcn) { tFp_t fn = (tFp_t)fcn; R_EAX = to_cstring(fn(from_ptriv(R_ESP + 4))); }
 void LFrL__32(x64emu_t *emu, uintptr_t fcn) { LFrL__t fn = (LFrL__t)fcn; struct_L_t arg_4; from_struct_L(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = to_ulong(fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL)); }
 void pFrL__32(x64emu_t *emu, uintptr_t fcn) { pFrL__t fn = (pFrL__t)fcn; struct_L_t arg_4; from_struct_L(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = to_ptrv(fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL)); }
+void LFriiiiiiiiilt__32(x64emu_t *emu, uintptr_t fcn) { LFriiiiiiiiilt__t fn = (LFriiiiiiiiilt__t)fcn; struct_iiiiiiiiilt_t arg_4; from_struct_iiiiiiiiilt(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = to_ulong(fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL)); }
 void vFEv_32(x64emu_t *emu, uintptr_t fcn) { vFEv_t fn = (vFEv_t)fcn; fn(emu); }
 void vFEp_32(x64emu_t *emu, uintptr_t fcn) { vFEp_t fn = (vFEp_t)fcn; fn(emu, from_ptriv(R_ESP + 4)); }
 void iFEv_32(x64emu_t *emu, uintptr_t fcn) { iFEv_t fn = (iFEv_t)fcn; R_EAX = fn(emu); }
@@ -339,6 +351,7 @@ void iFup_32(x64emu_t *emu, uintptr_t fcn) { iFup_t fn = (iFup_t)fcn; R_EAX = fn
 void iFli_32(x64emu_t *emu, uintptr_t fcn) { iFli_t fn = (iFli_t)fcn; R_EAX = fn(to_long(from_ptri(long_t, R_ESP + 4)), from_ptri(int32_t, R_ESP + 8)); }
 void iFpi_32(x64emu_t *emu, uintptr_t fcn) { iFpi_t fn = (iFpi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); }
 void iFpu_32(x64emu_t *emu, uintptr_t fcn) { iFpu_t fn = (iFpu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); }
+void iFpL_32(x64emu_t *emu, uintptr_t fcn) { iFpL_t fn = (iFpL_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8))); }
 void iFpp_32(x64emu_t *emu, uintptr_t fcn) { iFpp_t fn = (iFpp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); }
 void iFph_32(x64emu_t *emu, uintptr_t fcn) { iFph_t fn = (iFph_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_hash(from_ptri(ptr_t, R_ESP + 8))); }
 void iFhp_32(x64emu_t *emu, uintptr_t fcn) { iFhp_t fn = (iFhp_t)fcn; R_EAX = fn(from_hash(from_ptri(ptr_t, R_ESP + 4)), from_ptriv(R_ESP + 8)); }
@@ -376,7 +389,9 @@ void dFpBp__32(x64emu_t *emu, uintptr_t fcn) { dFpBp__t fn = (dFpBp__t)fcn; stru
 void pFrL_p_32(x64emu_t *emu, uintptr_t fcn) { pFrL_p_t fn = (pFrL_p_t)fcn; struct_L_t arg_4; from_struct_L(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = to_ptrv(fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8))); }
 void iFuBLL__32(x64emu_t *emu, uintptr_t fcn) { iFuBLL__t fn = (iFuBLL__t)fcn; struct_LL_t arg_8; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_LL(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
 void iFprLL__32(x64emu_t *emu, uintptr_t fcn) { iFprLL__t fn = (iFprLL__t)fcn; struct_LL_t arg_8; from_struct_LL(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); }
+void iFBLL_p_32(x64emu_t *emu, uintptr_t fcn) { iFBLL_p_t fn = (iFBLL_p_t)fcn; struct_LL_t arg_4; R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_LL(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); }
 void iFrLL_BLL__32(x64emu_t *emu, uintptr_t fcn) { iFrLL_BLL__t fn = (iFrLL_BLL__t)fcn; struct_LL_t arg_4; from_struct_LL(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_LL_t arg_8; R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_LL(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
+void pFriiiiiiiiilt_p_32(x64emu_t *emu, uintptr_t fcn) { pFriiiiiiiiilt_p_t fn = (pFriiiiiiiiilt_p_t)fcn; struct_iiiiiiiiilt_t arg_4; from_struct_iiiiiiiiilt(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = to_ptrv(fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8))); }
 void vFEip_32(x64emu_t *emu, uintptr_t fcn) { vFEip_t fn = (vFEip_t)fcn; fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); }
 void vFEpi_32(x64emu_t *emu, uintptr_t fcn) { vFEpi_t fn = (vFEpi_t)fcn; fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); }
 void vFEpu_32(x64emu_t *emu, uintptr_t fcn) { vFEpu_t fn = (vFEpu_t)fcn; fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); }
@@ -396,6 +411,7 @@ void iFiII_32(x64emu_t *emu, uintptr_t fcn) { iFiII_t fn = (iFiII_t)fcn; R_EAX =
 void iFiuu_32(x64emu_t *emu, uintptr_t fcn) { iFiuu_t fn = (iFiuu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); }
 void iFiLN_32(x64emu_t *emu, uintptr_t fcn) { iFiLN_t fn = (iFiLN_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); }
 void iFipu_32(x64emu_t *emu, uintptr_t fcn) { iFipu_t fn = (iFipu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); }
+void iFipL_32(x64emu_t *emu, uintptr_t fcn) { iFipL_t fn = (iFipL_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12))); }
 void iFipp_32(x64emu_t *emu, uintptr_t fcn) { iFipp_t fn = (iFipp_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); }
 void iFuii_32(x64emu_t *emu, uintptr_t fcn) { iFuii_t fn = (iFuii_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); }
 void iFuip_32(x64emu_t *emu, uintptr_t fcn) { iFuip_t fn = (iFuip_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); }
@@ -419,12 +435,12 @@ void fFffp_32(x64emu_t *emu, uintptr_t fcn) { fFffp_t fn = (fFffp_t)fcn; float f
 void dFddd_32(x64emu_t *emu, uintptr_t fcn) { dFddd_t fn = (dFddd_t)fcn; double db = fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20)); fpu_do_push(emu); ST0val = db; }
 void dFddp_32(x64emu_t *emu, uintptr_t fcn) { dFddp_t fn = (dFddp_t)fcn; double db = fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12), from_ptriv(R_ESP + 20)); fpu_do_push(emu); ST0val = db; }
 void lFipL_32(x64emu_t *emu, uintptr_t fcn) { lFipL_t fn = (lFipL_t)fcn; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)))); }
+void lFlpi_32(x64emu_t *emu, uintptr_t fcn) { lFlpi_t fn = (lFlpi_t)fcn; R_EAX = to_long(fn(to_long(from_ptri(long_t, R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); }
 void pFEip_32(x64emu_t *emu, uintptr_t fcn) { pFEip_t fn = (pFEip_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8))); }
 void pFEpi_32(x64emu_t *emu, uintptr_t fcn) { pFEpi_t fn = (pFEpi_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8))); }
 void pFEpp_32(x64emu_t *emu, uintptr_t fcn) { pFEpp_t fn = (pFEpp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8))); }
 void pFpiL_32(x64emu_t *emu, uintptr_t fcn) { pFpiL_t fn = (pFpiL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)))); }
 void pFpih_32(x64emu_t *emu, uintptr_t fcn) { pFpih_t fn = (pFpih_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_hash(from_ptri(ptr_t, R_ESP + 12)))); }
-void pFppu_32(x64emu_t *emu, uintptr_t fcn) { pFppu_t fn = (pFppu_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12))); }
 void pFppL_32(x64emu_t *emu, uintptr_t fcn) { pFppL_t fn = (pFppL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)))); }
 void pFpOM_32(x64emu_t *emu, uintptr_t fcn) { pFpOM_t fn = (pFpOM_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), of_convert32(from_ptri(int32_t, R_ESP + 8)), from_ptriv(R_ESP + 12),from_ptriv(R_ESP + 12 + 4))); }
 void hFEpp_32(x64emu_t *emu, uintptr_t fcn) { hFEpp_t fn = (hFEpp_t)fcn; R_EAX = to_hash(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8))); }
@@ -441,6 +457,7 @@ void iFEipp_32(x64emu_t *emu, uintptr_t fcn) { iFEipp_t fn = (iFEipp_t)fcn; R_EA
 void iFELup_32(x64emu_t *emu, uintptr_t fcn) { iFELup_t fn = (iFELup_t)fcn; R_EAX = fn(emu, to_ulong(from_ptri(ulong_t, R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); }
 void iFEpip_32(x64emu_t *emu, uintptr_t fcn) { iFEpip_t fn = (iFEpip_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); }
 void iFEpup_32(x64emu_t *emu, uintptr_t fcn) { iFEpup_t fn = (iFEpup_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); }
+void iFEpLi_32(x64emu_t *emu, uintptr_t fcn) { iFEpLi_t fn = (iFEpLi_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12)); }
 void iFEppL_32(x64emu_t *emu, uintptr_t fcn) { iFEppL_t fn = (iFEppL_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12))); }
 void iFEppp_32(x64emu_t *emu, uintptr_t fcn) { iFEppp_t fn = (iFEppp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); }
 void iFEppV_32(x64emu_t *emu, uintptr_t fcn) { iFEppV_t fn = (iFEppV_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptrv(R_ESP + 12)); }
@@ -449,6 +466,7 @@ void iFEhpV_32(x64emu_t *emu, uintptr_t fcn) { iFEhpV_t fn = (iFEhpV_t)fcn; R_EA
 void iFiiiN_32(x64emu_t *emu, uintptr_t fcn) { iFiiiN_t fn = (iFiiiN_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); }
 void iFiiII_32(x64emu_t *emu, uintptr_t fcn) { iFiiII_t fn = (iFiiII_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int64_t, R_ESP + 12), from_ptri(int64_t, R_ESP + 20)); }
 void iFiuui_32(x64emu_t *emu, uintptr_t fcn) { iFiuui_t fn = (iFiuui_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); }
+void iFipii_32(x64emu_t *emu, uintptr_t fcn) { iFipii_t fn = (iFipii_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); }
 void iFipup_32(x64emu_t *emu, uintptr_t fcn) { iFipup_t fn = (iFipup_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); }
 void iFuupi_32(x64emu_t *emu, uintptr_t fcn) { iFuupi_t fn = (iFuupi_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); }
 void iFhpiL_32(x64emu_t *emu, uintptr_t fcn) { iFhpiL_t fn = (iFhpiL_t)fcn; R_EAX = fn(from_hash(from_ptri(ptr_t, R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), to_ulong(from_ptri(ulong_t, R_ESP + 16))); }
@@ -472,6 +490,8 @@ void iFEpippp_32(x64emu_t *emu, uintptr_t fcn) { iFEpippp_t fn = (iFEpippp_t)fcn
 void iFEpuppp_32(x64emu_t *emu, uintptr_t fcn) { iFEpuppp_t fn = (iFEpuppp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); }
 void iFEpLppp_32(x64emu_t *emu, uintptr_t fcn) { iFEpLppp_t fn = (iFEpLppp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); }
 void iFEpLiipV_32(x64emu_t *emu, uintptr_t fcn) { iFEpLiipV_t fn = (iFEpLiipV_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptrv(R_ESP + 24)); }
+void pFEpLiiii_32(x64emu_t *emu, uintptr_t fcn) { pFEpLiiii_t fn = (pFEpLiiii_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24))); }
+void pFEpLiiiI_32(x64emu_t *emu, uintptr_t fcn) { pFEpLiiiI_t fn = (pFEpLiiiI_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int64_t, R_ESP + 24))); }
 void iFEpippppp_32(x64emu_t *emu, uintptr_t fcn) { iFEpippppp_t fn = (iFEpippppp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); }
 
 #if defined(ANDROID)
@@ -492,6 +512,8 @@ void KFKp_32(x64emu_t *emu, uintptr_t fcn) { KFKp_t fn = (KFKp_t)fcn; double db
 
 void iFEvpV_32(x64emu_t *emu, uintptr_t fcn) { iFEpV_t fn = (iFEpV_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 8), from_ptrv(R_ESP + 12)); }
 void UFsvvs_32(x64emu_t *emu, uintptr_t fcn) { UFss_t fn = (UFss_t)fcn; ui64_t r; r.u = (uint64_t)fn(from_ptrv(R_ESP + 4), from_ptrv(R_ESP + 12)); R_EAX = r.d[0]; R_EDX = r.d[1]; }
+void pFEppv_32(x64emu_t *emu, uintptr_t fcn) { pFEpp_t fn = (pFEpp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8))); }
+void iFEpvpp_32(x64emu_t *emu, uintptr_t fcn) { iFEppp_t fn = (iFEppp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); }
 void iFEhvpV_32(x64emu_t *emu, uintptr_t fcn) { iFEhpV_t fn = (iFEhpV_t)fcn; R_EAX = fn(emu, from_hash(from_ptri(ptr_t, R_ESP + 4)), from_ptriv(R_ESP + 12), from_ptrv(R_ESP + 16)); }
 void iFEpvvpV_32(x64emu_t *emu, uintptr_t fcn) { iFEppV_t fn = (iFEppV_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 16), from_ptrv(R_ESP + 20)); }
 void iFEpuvvppp_32(x64emu_t *emu, uintptr_t fcn) { iFEpuppp_t fn = (iFEpuppp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); }
diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h
index ede84357..00d4c7ff 100644
--- a/src/wrapped32/generated/wrapper32.h
+++ b/src/wrapped32/generated/wrapper32.h
@@ -75,9 +75,11 @@ void pFL_32(x64emu_t *emu, uintptr_t fnc);
 void pFp_32(x64emu_t *emu, uintptr_t fnc);
 void hFv_32(x64emu_t *emu, uintptr_t fnc);
 void aFa_32(x64emu_t *emu, uintptr_t fnc);
+void tFi_32(x64emu_t *emu, uintptr_t fnc);
 void tFp_32(x64emu_t *emu, uintptr_t fnc);
 void LFrL__32(x64emu_t *emu, uintptr_t fnc);
 void pFrL__32(x64emu_t *emu, uintptr_t fnc);
+void LFriiiiiiiiilt__32(x64emu_t *emu, uintptr_t fnc);
 void vFEv_32(x64emu_t *emu, uintptr_t fnc);
 void vFEp_32(x64emu_t *emu, uintptr_t fnc);
 void iFEv_32(x64emu_t *emu, uintptr_t fnc);
@@ -96,6 +98,7 @@ void iFup_32(x64emu_t *emu, uintptr_t fnc);
 void iFli_32(x64emu_t *emu, uintptr_t fnc);
 void iFpi_32(x64emu_t *emu, uintptr_t fnc);
 void iFpu_32(x64emu_t *emu, uintptr_t fnc);
+void iFpL_32(x64emu_t *emu, uintptr_t fnc);
 void iFpp_32(x64emu_t *emu, uintptr_t fnc);
 void iFph_32(x64emu_t *emu, uintptr_t fnc);
 void iFhp_32(x64emu_t *emu, uintptr_t fnc);
@@ -133,7 +136,9 @@ void dFpBp__32(x64emu_t *emu, uintptr_t fnc);
 void pFrL_p_32(x64emu_t *emu, uintptr_t fnc);
 void iFuBLL__32(x64emu_t *emu, uintptr_t fnc);
 void iFprLL__32(x64emu_t *emu, uintptr_t fnc);
+void iFBLL_p_32(x64emu_t *emu, uintptr_t fnc);
 void iFrLL_BLL__32(x64emu_t *emu, uintptr_t fnc);
+void pFriiiiiiiiilt_p_32(x64emu_t *emu, uintptr_t fnc);
 void vFEip_32(x64emu_t *emu, uintptr_t fnc);
 void vFEpi_32(x64emu_t *emu, uintptr_t fnc);
 void vFEpu_32(x64emu_t *emu, uintptr_t fnc);
@@ -153,6 +158,7 @@ void iFiII_32(x64emu_t *emu, uintptr_t fnc);
 void iFiuu_32(x64emu_t *emu, uintptr_t fnc);
 void iFiLN_32(x64emu_t *emu, uintptr_t fnc);
 void iFipu_32(x64emu_t *emu, uintptr_t fnc);
+void iFipL_32(x64emu_t *emu, uintptr_t fnc);
 void iFipp_32(x64emu_t *emu, uintptr_t fnc);
 void iFuii_32(x64emu_t *emu, uintptr_t fnc);
 void iFuip_32(x64emu_t *emu, uintptr_t fnc);
@@ -176,12 +182,12 @@ void fFffp_32(x64emu_t *emu, uintptr_t fnc);
 void dFddd_32(x64emu_t *emu, uintptr_t fnc);
 void dFddp_32(x64emu_t *emu, uintptr_t fnc);
 void lFipL_32(x64emu_t *emu, uintptr_t fnc);
+void lFlpi_32(x64emu_t *emu, uintptr_t fnc);
 void pFEip_32(x64emu_t *emu, uintptr_t fnc);
 void pFEpi_32(x64emu_t *emu, uintptr_t fnc);
 void pFEpp_32(x64emu_t *emu, uintptr_t fnc);
 void pFpiL_32(x64emu_t *emu, uintptr_t fnc);
 void pFpih_32(x64emu_t *emu, uintptr_t fnc);
-void pFppu_32(x64emu_t *emu, uintptr_t fnc);
 void pFppL_32(x64emu_t *emu, uintptr_t fnc);
 void pFpOM_32(x64emu_t *emu, uintptr_t fnc);
 void hFEpp_32(x64emu_t *emu, uintptr_t fnc);
@@ -198,6 +204,7 @@ void iFEipp_32(x64emu_t *emu, uintptr_t fnc);
 void iFELup_32(x64emu_t *emu, uintptr_t fnc);
 void iFEpip_32(x64emu_t *emu, uintptr_t fnc);
 void iFEpup_32(x64emu_t *emu, uintptr_t fnc);
+void iFEpLi_32(x64emu_t *emu, uintptr_t fnc);
 void iFEppL_32(x64emu_t *emu, uintptr_t fnc);
 void iFEppp_32(x64emu_t *emu, uintptr_t fnc);
 void iFEppV_32(x64emu_t *emu, uintptr_t fnc);
@@ -206,6 +213,7 @@ void iFEhpV_32(x64emu_t *emu, uintptr_t fnc);
 void iFiiiN_32(x64emu_t *emu, uintptr_t fnc);
 void iFiiII_32(x64emu_t *emu, uintptr_t fnc);
 void iFiuui_32(x64emu_t *emu, uintptr_t fnc);
+void iFipii_32(x64emu_t *emu, uintptr_t fnc);
 void iFipup_32(x64emu_t *emu, uintptr_t fnc);
 void iFuupi_32(x64emu_t *emu, uintptr_t fnc);
 void iFhpiL_32(x64emu_t *emu, uintptr_t fnc);
@@ -229,6 +237,8 @@ void iFEpippp_32(x64emu_t *emu, uintptr_t fnc);
 void iFEpuppp_32(x64emu_t *emu, uintptr_t fnc);
 void iFEpLppp_32(x64emu_t *emu, uintptr_t fnc);
 void iFEpLiipV_32(x64emu_t *emu, uintptr_t fnc);
+void pFEpLiiii_32(x64emu_t *emu, uintptr_t fnc);
+void pFEpLiiiI_32(x64emu_t *emu, uintptr_t fnc);
 void iFEpippppp_32(x64emu_t *emu, uintptr_t fnc);
 
 #if defined(ANDROID)
@@ -249,6 +259,8 @@ void KFKp_32(x64emu_t *emu, uintptr_t fnc);
 
 void iFEvpV_32(x64emu_t *emu, uintptr_t fnc);
 void UFsvvs_32(x64emu_t *emu, uintptr_t fnc);
+void pFEppv_32(x64emu_t *emu, uintptr_t fnc);
+void iFEpvpp_32(x64emu_t *emu, uintptr_t fnc);
 void iFEhvpV_32(x64emu_t *emu, uintptr_t fnc);
 void iFEpvvpV_32(x64emu_t *emu, uintptr_t fnc);
 void iFEpuvvppp_32(x64emu_t *emu, uintptr_t fnc);
diff --git a/src/wrapped32/wrappedlibc.c b/src/wrapped32/wrappedlibc.c
index 604d4a6c..d9aac79d 100755
--- a/src/wrapped32/wrappedlibc.c
+++ b/src/wrapped32/wrappedlibc.c
@@ -172,13 +172,12 @@ GO(13)  \
 GO(14)  \
 GO(15)
 
-#if 0
 // compare
 #define GO(A)   \
-static uintptr_t my32_compare_fct_##A = 0;        \
-static int my32_compare_##A(void* a, void* b)     \
-{                                               \
-    return (int)RunFunction(my_context, my32_compare_fct_##A, 2, a, b);\
+static uintptr_t my32_compare_fct_##A = 0;                                      \
+static int my32_compare_##A(void* a, void* b)                                   \
+{                                                                               \
+    return (int)RunFunctionFmt(my32_compare_fct_##A, "pp", a, b);   \
 }
 SUPER()
 #undef GO
@@ -197,6 +196,7 @@ static void* findcompareFct(void* fct)
     return NULL;
 }
 
+#if 0
 // ftw
 #define GO(A)   \
 static uintptr_t my32_ftw_fct_##A = 0;                                      \
@@ -316,13 +316,16 @@ static void* findgloberrFct(void* fct)
     printf_log(LOG_NONE, "Warning, no more slot for libc globerr callback\n");
     return NULL;
 }
+#endif
 #undef dirent
 // filter_dir
 #define GO(A)   \
-static uintptr_t my32_filter_dir_fct_##A = 0;                               \
-static int my32_filter_dir_##A(const struct dirent* a)                    \
-{                                                                       \
-    return (int)RunFunction(my_context, my32_filter_dir_fct_##A, 1, a);     \
+static uintptr_t my32_filter_dir_fct_##A = 0;                       \
+static int my32_filter_dir_##A(const struct dirent64* a)            \
+{                                                                   \
+    struct i386_dirent d = {0};                                     \
+    UnalignDirent_32(a, &d);                                        \
+    return (int)RunFunctionFmt(my32_filter_dir_fct_##A, "p", &d);   \
 }
 SUPER()
 #undef GO
@@ -342,10 +345,13 @@ static void* findfilter_dirFct(void* fct)
 }
 // compare_dir
 #define GO(A)   \
-static uintptr_t my32_compare_dir_fct_##A = 0;                                  \
-static int my32_compare_dir_##A(const struct dirent* a, const struct dirent* b)    \
-{                                                                           \
-    return (int)RunFunction(my_context, my32_compare_dir_fct_##A, 2, a, b);     \
+static uintptr_t my32_compare_dir_fct_##A = 0;                                      \
+static int my32_compare_dir_##A(const struct dirent* a, const struct dirent* b)     \
+{                                                                                   \
+    struct i386_dirent d1, d2;                                                      \
+    UnalignDirent_32(a, &d1);                                                       \
+    UnalignDirent_32(a, &d2);                                                       \
+    return (int)RunFunctionFmt(my32_compare_dir_fct_##A, "pp", &d1, &d2);           \
 }
 SUPER()
 #undef GO
@@ -363,7 +369,6 @@ static void* findcompare_dirFct(void* fct)
     printf_log(LOG_NONE, "Warning, no more slot for libc compare_dir callback\n");
     return NULL;
 }
-#endif
 // filter64
 #define GO(A)   \
 static uintptr_t my32_filter64_fct_##A = 0;                                 \
@@ -446,6 +451,15 @@ EXPORT int my32_statvfs64(x64emu_t* emu, void* f, void* r)
     return ret;
 }
 
+EXPORT int my32_statvfs(x64emu_t* emu, void* f, void* r)
+{
+    struct statvfs s = {0};
+    int ret = statvfs(f, &s);
+    if(r)
+        UnalignStatVFS_32(&s, r);
+    return ret;
+}
+
 // some my32_XXX declare and defines
 int32_t my32___libc_start_main(x64emu_t* emu, int *(main) (int, char * *, char * *), 
     int argc, char * * ubp_av, void (*init) (void), void (*fini) (void), 
@@ -693,35 +707,24 @@ EXPORT int my32_vprintf(x64emu_t *emu, void* fmt, void* b) {
 }
 EXPORT int my32___vprintf_chk(x64emu_t *emu, void* fmt, void* b) __attribute__((alias("my32_vprintf")));
 
+#endif
 EXPORT int my32_vfprintf(x64emu_t *emu, void* F, void* fmt, void* b) {
-    #ifndef NOALIGN
     // need to align on arm
     myStackAlign32((const char*)fmt, b, emu->scratch);
     PREPARE_VALIST_32;
-    void* f = vfprintf;
-    return ((iFppp_t)f)(F, fmt, VARARGS_32);
-    #else
-    // other platform don't need that
-    return vfprintf(F, fmt, b);
-    #endif
+    return vfprintf(F, fmt, VARARGS_32);
 }
 EXPORT int my32___vfprintf_chk(x64emu_t *emu, void* F, void* fmt, void* b) __attribute__((alias("my32_vfprintf")));
 EXPORT int my32__IO_vfprintf(x64emu_t *emu, void* F, void* fmt, void* b) __attribute__((alias("my32_vfprintf")));
 
 EXPORT int my32_dprintf(x64emu_t *emu, int fd, void* fmt, void* V)  {
-    #ifndef NOALIGN
     // need to align on arm
     myStackAlign32((const char*)fmt, V, emu->scratch);
     PREPARE_VALIST_32;
-    void* f = vdprintf;
-    return ((iFipp_t)f)(fd, fmt, VARARGS_32);
-    #else
-    return vdprintf(fd, (const char*)fmt, (va_list)V);
-    #endif
+    return vdprintf(fd, fmt, VARARGS_32);
 }
 EXPORT int my32___dprintf_chk(x64emu_t *emu, int fd, void* fmt, void* V) __attribute__((alias("my32_dprintf")));
 
-#endif
 EXPORT int my32_fprintf(x64emu_t *emu, void* F, void* fmt, void* V)  {
     // need to align on arm
     myStackAlign32((const char*)fmt, V, emu->scratch);
@@ -1181,46 +1184,30 @@ EXPORT int my32___fxstat64(x64emu_t *emu, int vers, int fd, void* buf)
     UnalignStat64_32(&st, buf);
     return r;
 }
-#if 0
 EXPORT int my32_stat64(x64emu_t* emu, void* path, void* buf)
 {
     struct stat64 st;
     int r = stat64(path, &st);
-    UnalignStat64(&st, buf);
+    UnalignStat64_32(&st, buf);
     return r;
 }
 EXPORT int my32_lstat64(x64emu_t* emu, void* path, void* buf)
 {
     struct stat64 st;
     int r = lstat64(path, &st);
-    UnalignStat64(&st, buf);
+    UnalignStat64_32(&st, buf);
     return r;
 }
 
 EXPORT int my32___xstat(x64emu_t* emu, int v, void* path, void* buf)
 {
-    if (v == 1)
-    {
-        static iFipp_t f = NULL;
-        if(!f) {
-            library_t* lib = my_lib;
-            if(!lib)
-            {
-                errno = EINVAL;
-                return -1;
-            }
-            f = (iFipp_t)dlsym(lib->priv.w.lib, "__xstat");
-        }
-
-        return f(v, path, buf);
-    }
     struct stat64 st;
     int r = stat64((const char*)path, &st);
     if (r) return r;
     r = FillStatFromStat64(v, &st, buf);
     return r;
 }
-#endif
+
 EXPORT int my32___xstat64(x64emu_t* emu, int v, void* path, void* buf)
 {
     struct stat64 st;
@@ -1271,23 +1258,37 @@ EXPORT int my32__IO_file_stat(x64emu_t* emu, void* f, void* buf)
     UnalignStat64(&st, buf);
     return r;
 }
-
+#endif
+EXPORT int my32_fstatfs(int fd, void* buf)
+{
+    struct statfs64 st;
+    int r = fstatfs64(fd, &st);
+    UnalignStatFS_32(&st, buf);
+    return r;
+}
 EXPORT int my32_fstatfs64(int fd, void* buf)
 {
     struct statfs64 st;
     int r = fstatfs64(fd, &st);
-    UnalignStatFS64(&st, buf);
+    UnalignStatFS64_32(&st, buf);
     return r;
 }
 
+EXPORT int my32_statfs(const char* path, void* buf)
+{
+    struct statfs64 st;
+    int r = statfs64(path, &st);
+    UnalignStatFS_32(&st, buf);
+    return r;
+}
 EXPORT int my32_statfs64(const char* path, void* buf)
 {
     struct statfs64 st;
     int r = statfs64(path, &st);
-    UnalignStatFS64(&st, buf);
+    UnalignStatFS64_32(&st, buf);
     return r;
 }
-
+#if 0
 
 #ifdef ANDROID
 typedef int (*__compar_d_fn_t)(const void*, const void*, void*);
@@ -1357,7 +1358,6 @@ EXPORT void my32_qsort_r(x64emu_t* emu, void* base, size_t nmemb, size_t size, v
     args.emu = emu; args.f = (uintptr_t)fnc; args.r = 1; args.data = data;
     qsort_r(base, nmemb, size, (__compar_d_fn_t)my32_compare_r_cb, &args);
 }
-#if 0
 EXPORT void* my32_bsearch(x64emu_t* emu, void* key, void* base, size_t nmemb, size_t size, void* fnc)
 {
     return bsearch(key, base, nmemb, size, findcompareFct(fnc));
@@ -1372,41 +1372,19 @@ EXPORT void* my32_lfind(x64emu_t* emu, void* key, void* base, size_t* nmemb, siz
     return lfind(key, base, nmemb, size, findcompareFct(fnc));
 }
 
-
-struct i386_dirent {
-    uint32_t d_ino;
-    int32_t  d_off;
-    uint16_t d_reclen;
-    uint8_t  d_type;
-    char     d_name[256];
-};
-
 EXPORT void* my32_readdir(x64emu_t* emu, void* dirp)
 {
-    if (fix_64bit_inodes)
-    {
-        struct dirent64 *dp64 = readdir64((DIR *)dirp);
-        if (!dp64) return NULL;
-        uint32_t ino32 = dp64->d_ino ^ (dp64->d_ino >> 32);
-        int32_t off32 = dp64->d_off;
-        struct i386_dirent *dp32 = (struct i386_dirent *)&(dp64->d_off);
-        dp32->d_ino = ino32;
-        dp32->d_off = off32;
-        dp32->d_reclen -= 8;
-        return dp32;
-    }
-    else
-    {
-        static pFp_t f = NULL;
-        if(!f) {
-            library_t* lib = my_lib;
-            if(!lib) return NULL;
-            f = (pFp_t)dlsym(lib->priv.w.lib, "readdir");
-        }
-
-        return f(dirp);
-    }
+    struct dirent64 *dp64 = readdir64((DIR *)dirp);
+    if (!dp64) return NULL;
+    uint32_t ino32 = dp64->d_ino ^ (dp64->d_ino >> 32);
+    int32_t off32 = dp64->d_off;
+    struct i386_dirent *dp32 = (struct i386_dirent *)&(dp64->d_off);
+    dp32->d_ino = ino32;
+    dp32->d_off = off32;
+    dp32->d_reclen -= 8;
+    return dp32;
 }
+#if 0
 
 EXPORT int32_t my32_readdir_r(x64emu_t* emu, void* dirp, void* entry, void** result)
 {
@@ -1841,22 +1819,51 @@ EXPORT int32_t my32_glob64(x64emu_t *emu, void* pat, int32_t flags, void* errfnc
 }
 #endif
 #endif
-EXPORT int my32_scandir64(x64emu_t *emu, void* dir, void* namelist, void* sel, void* comp)
+EXPORT int my32_scandir(x64emu_t *emu, void* dir, void* namelist, void* sel, void* comp)
 {
-    return scandir64(dir, namelist, findfilter64Fct(sel), findcompare64Fct(comp));
+    struct dirent64** list;
+    int ret = scandir64(dir, &list, findfilter64Fct(sel), findcompare64Fct(comp));
+    if(ret>=0)
+        *(ptr_t*)namelist = to_ptrv(list);
+    if (ret>0) {
+        // adjust the array of dirent...
+        ptr_t* dp32_list = (ptr_t*)list;
+        struct dirent64** dp64_list = list;
+        for(int i=0; i<ret; ++i) {
+            struct dirent64* dp64 = dp64_list[i];
+            uint32_t ino32 = dp64->d_ino ^ (dp64->d_ino >> 32);
+            int32_t off32 = dp64->d_off;
+            struct i386_dirent *dp32 = (struct i386_dirent *)&(dp64->d_off);
+            dp32->d_ino = ino32;
+            dp32->d_off = off32;
+            dp32->d_reclen -= 8;
+            *dp32_list = to_ptrv(dp32);
+            ++dp32_list;
+            ++dp64;
+        }
+    }
+    return ret;
 }
-#if 0
-EXPORT int my32_scandir(x64emu_t *emu, void* dir, void* namelist, void* sel, void* comp)
+EXPORT int my32_scandir64(x64emu_t *emu, void* dir, void* namelist, void* sel, void* comp)
 {
-    static iFpppp_t f = NULL;
-    if(!f) {
-        library_t* lib = my_lib;
-        if(!lib) return 0;
-        f = (iFpppp_t)dlsym(lib->priv.w.lib, "scandir");
+    struct dirent64** list;
+    int ret = scandir64(dir, &list, findfilter_dirFct(sel), findcompare_dirFct(comp));
+    if(ret>=0)
+        *(ptr_t*)namelist = to_ptrv(list);
+    if (ret>0) {
+        // adjust the array of dirent...
+        ptr_t* dp32_list = (ptr_t*)list;
+        struct dirent64** dp64_list = list;
+        for(int i=0; i<ret; ++i) {
+            struct dirent64* dp64 = dp64_list[i];
+            *dp32_list = to_ptrv(dp64);
+            ++dp32_list;
+            ++dp64;
+        }
     }
-
-    return f(dir, namelist, findfilter_dirFct(sel), findcompare_dirFct(comp));
+    return ret;
 }
+#if 0
 
 EXPORT int my32_ftw64(x64emu_t* emu, void* filename, void* func, int descriptors)
 {
@@ -1867,12 +1874,12 @@ EXPORT int32_t my32_nftw64(x64emu_t* emu, void* pathname, void* B, int32_t nopen
 {
     return nftw64(pathname, findnftw64Fct(B), nopenfd, flags);
 }
-
-EXPORT int32_t my32_execv(x64emu_t* emu, const char* path, char* const argv[])
+#endif
+EXPORT int32_t my32_execv(x64emu_t* emu, const char* path, ptr_t argv[])
 {
     int self = isProcSelf(path, "exe");
     int x86 = FileIsX86ELF(path);
-    int x64 = my_context->box64path?FileIsX64ELF(path):0;
+    int x64 = FileIsX64ELF(path);
     printf_log(LOG_DEBUG, "execv(\"%s\", %p) is x86=%d\n", path, argv, x86);
     if (x86 || x64 || self) {
         int skip_first = 0;
@@ -1883,24 +1890,38 @@ EXPORT int32_t my32_execv(x64emu_t* emu, const char* path, char* const argv[])
         while(argv[n]) ++n;
         const char** newargv = (const char**)calloc(n+2, sizeof(char*));
         newargv[0] = x64?emu->context->box64path:emu->context->box64path;
-        memcpy(newargv+1, argv+skip_first, sizeof(char*)*(n+1));
+        for(int i=0; i<n; ++i)
+            newargv[i+1] = from_ptrv(argv[skip_first+i]);
         if(self) newargv[1] = emu->context->fullpath;
         printf_log(LOG_DEBUG, " => execv(\"%s\", %p [\"%s\", \"%s\", \"%s\"...:%d])\n", emu->context->box64path, newargv, newargv[0], n?newargv[1]:"", (n>1)?newargv[2]:"",n);
         int ret = execv(newargv[0], (char* const*)newargv);
         free(newargv);
         return ret;
     }
-    return execv(path, argv);
+    // count argv and create the 64bits argv version
+    int n=0;
+    while(argv[n]) ++n;
+    char** newargv = (char**)calloc(n+1, sizeof(char*));
+    for(int i=0; i<=n; ++i)
+        newargv[i+1] = from_ptrv(argv[i]);
+    return execv(path, (void*)newargv);
 }
-#endif
-EXPORT int32_t my32_execve(x64emu_t* emu, const char* path, char* const argv[], char* const envp[])
+
+EXPORT int32_t my32_execve(x64emu_t* emu, const char* path, ptr_t argv[], ptr_t envp[])
 {
     int self = isProcSelf(path, "exe");
     int x86 = FileIsX86ELF(path);
-    int x64 = my_context->box64path?FileIsX64ELF(path):0;
+    int x64 = FileIsX64ELF(path);
+    char** newenvp = NULL;
     // hack to update the environ var if needed
-    if(envp == my_context->envv && environ) {
-        envp = environ;
+    if(envp == from_ptrv(my_context->envv32) && environ)
+        newenvp = environ;
+    else {
+        int n=0;
+        while(envp[n]) ++n;
+        const char** newenvp = (const char**)calloc(n+1, sizeof(char*));
+        for(int i=0; i<=n; ++i)
+            newenvp[i+1] = from_ptrv(envp[i]);
     }
     printf_log(LOG_DEBUG, "execve(\"%s\", %p, %p) is x86=%d\n", path, argv, envp, x86);
     if (x86 || x64 || self) {
@@ -1912,23 +1933,31 @@ EXPORT int32_t my32_execve(x64emu_t* emu, const char* path, char* const argv[],
         while(argv[n]) ++n;
         const char** newargv = (const char**)calloc(n+2, sizeof(char*));
         newargv[0] = x64?emu->context->box64path:emu->context->box64path;
-        memcpy(newargv+1, argv+skip_first, sizeof(char*)*(n+1));
+        for(int i=0; i<n; ++i)
+            newargv[i+1] = from_ptrv(argv[skip_first+i]);
         if(self) newargv[1] = emu->context->fullpath;
         printf_log(LOG_DEBUG, " => execve(\"%s\", %p [\"%s\", \"%s\", \"%s\"...:%d])\n", emu->context->box64path, newargv, newargv[0], n?newargv[1]:"", (n>1)?newargv[2]:"",n);
-        int ret = execve(newargv[0], (char* const*)newargv, envp);
+        int ret = execve(newargv[0], (char* const*)newargv, newenvp);
         free(newargv);
         return ret;
     }
+    // count argv and create the 64bits argv version
+    int n=0;
+    while(argv[n]) ++n;
+    const char** newargv = (const char**)calloc(n+1, sizeof(char*));
+    for(int i=0; i<=n; ++i)
+        newargv[i+1] = from_ptrv(argv[i]);
+
     if(!strcmp(path + strlen(path) - strlen("/uname"), "/uname")
-     && argv[1] && (!strcmp(argv[1], "-m") || !strcmp(argv[1], "-p") || !strcmp(argv[1], "-i"))
-     && !argv[2]) {
+     && newargv[1] && (!strcmp(newargv[1], "-m") || !strcmp(newargv[1], "-p") || !strcmp(newargv[1], "-i"))
+     && !newargv[2]) {
         // uname -m is redirected to box32 -m
         path = my_context->box64path;
-        char *argv2[3] = { my_context->box64path, argv[1], NULL };
-        return execve(path, argv2, envp);
+        const char *argv2[3] = { my_context->box64path, newargv[1], NULL };
+        return execve(path, (void*)argv2, newenvp);
     }
 
-    return execve(path, argv, envp);
+    return execve(path, (void*)newargv, newenvp);
 }
 #if 0
 // execvp should use PATH to search for the program first
@@ -2437,6 +2466,31 @@ EXPORT int my32_backtrace(x64emu_t* emu, void** buffer, int size)
     #endif
 }
 
+EXPORT void* my32_backtrace_symbols(x64emu_t* emu, ptr_t* buffer, int size)
+{
+    (void)emu;
+    ptr_t* ret = (ptr_t*)calloc(1, size*sizeof(ptr_t) + size*200);  // capping each strings to 200 chars, not using box_calloc (program space)
+    char* s = (char*)(ret+size);
+    for (int i=0; i<size; ++i) {
+        uintptr_t start = 0;
+        uint64_t sz = 0;
+        elfheader_t *hdr = FindElfAddress(my_context, buffer[i]);
+        const char* symbname = FindNearestSymbolName(hdr, from_ptrv(buffer[i]), &start, &sz);
+        if(!sz) sz=0x100;   // arbitrary value...
+        if (symbname && buffer[i]>=start && (buffer[i]<(start+sz) || !sz)) {
+            snprintf(s, 200, "%s(%s+%lx) [%p]", ElfName(hdr), symbname, buffer[i] - start, from_ptrv(buffer[i]));
+        } else if (hdr) {
+            snprintf(s, 200, "%s+%lx [%p]", ElfName(hdr), buffer[i] - (uintptr_t)GetBaseAddress(hdr), from_ptrv(buffer[i]));
+        } else {
+            snprintf(s, 200, "??? [%p]", from_ptrv(buffer[i]));
+        }
+        ret[i] = to_ptrv(s);
+        s += 200;
+    }
+    return ret;
+}
+
+
 EXPORT struct __processor_model
 {
   unsigned int __cpu_vendor;
@@ -2556,7 +2610,6 @@ EXPORT int32_t my32_setjmp(x64emu_t* emu, /*struct __jmp_buf_tag __env[1]*/void
 {
     return  my32___sigsetjmp(emu, p, 1);
 }
-#if 0
 EXPORT void my32___explicit_bzero_chk(x64emu_t* emu, void* dst, uint32_t len, uint32_t dstlen)
 {
     memset(dst, 0, len);
@@ -2571,7 +2624,6 @@ EXPORT void* my32_realpath(x64emu_t* emu, void* path, void* resolved_path)
         return realpath(path, resolved_path);
 }
 
-#endif
 EXPORT int my32_readlinkat(x64emu_t* emu, int fd, void* path, void* buf, size_t bufsize)
 {
     if(isProcSelf(path, "exe")) {
@@ -2855,6 +2907,16 @@ EXPORT int my32_nanosleep(const struct timespec *req, struct timespec *rem)
     return nanosleep(req, rem);
 }
 
+EXPORT int my32_utimes(x64emu_t* emu, const char* name, uint32_t* times)
+{
+    struct timeval tm[2];
+    tm[0].tv_sec = times[0];
+    tm[0].tv_usec = times[1];
+    tm[1].tv_sec = times[2];
+    tm[1].tv_usec = times[3];
+    return utimes(name, tm);
+}
+
 // wrapped malloc using calloc, it seems x86 malloc set alloc'd block to zero somehow
 EXPORT void* my32_malloc(unsigned long size)
 {
@@ -2952,6 +3014,13 @@ EXPORT ptr_t my32_stdin = 0;
 EXPORT ptr_t my32_stdout = 0;
 EXPORT ptr_t my32_stderr = 0;
 
+EXPORT long_t my32_timezone = 0;
+EXPORT void my32_tzset()
+{
+    tzset();
+    my32_timezone = to_long(timezone);  // this might not be usefull, and we can probably just redirect to the original symbol
+}
+
 EXPORT int my32___libc_single_threaded = 0;
 
 EXPORT void* my32___errno_location(x64emu_t* emu)
diff --git a/src/wrapped32/wrappedlibc_private.h b/src/wrapped32/wrappedlibc_private.h
index 5c356f2e..702d398a 100755
--- a/src/wrapped32/wrappedlibc_private.h
+++ b/src/wrapped32/wrappedlibc_private.h
@@ -14,7 +14,7 @@ GO(abort, vFv)
 //GO(abs, iFi)
 //GOW(accept, iFipp)
 //GOM(accept4, iFEippi)   //%% glibc 2.10+
-//GOW(access, iFpi)
+GOW(access, iFpi)
 // acct
 //GOW(addmntent, iFpp)
 // addseverity
@@ -70,7 +70,7 @@ GOM(alphasort64, iFEpp)
 // __argz_stringify
 //GOW(argz_stringify, vFpLi)
 //GO(asctime, pFp)
-//GOW(asctime_r, pFpp)
+GOW(asctime_r, pFriiiiiiiiilt_p)
 //GOWM(asprintf, iFEppV)        //%%
 //GOM(__asprintf, iFEppV)      //%%
 //GOM(__asprintf_chk, iFEpipV) //%%
@@ -91,7 +91,7 @@ GOM(alphasort64, iFEpp)
 GOWM(backtrace, iFEpi)
 //GO(__backtrace, iFpi)
 //GO(__backtrace_symbols, pFpi)
-//GOW(backtrace_symbols, pFpi)
+GOWM(backtrace_symbols, pFEpi)
 //GO(__backtrace_symbols_fd, vFpii)
 //GOW(backtrace_symbols_fd, vFpii)
 //GO(basename, pFp)
@@ -186,7 +186,7 @@ DATAM(__cpu_model, 16)
 // __cyg_profile_func_enter
 // __cyg_profile_func_exit
 // daemon
-//DATAV(daylight, 4)
+DATAV(daylight, 4)
 // __daylight   // type B
 //GOW(dcgettext, pFppi)
 //GO(__dcgettext, pFppi)
@@ -205,7 +205,7 @@ DATAM(__cpu_model, 16)
 //GO(dirname, pFp)
 //GOS(div, pFpii) //%%,noE
 // _dl_addr
-//GOM(dl_iterate_phdr, iFEpp) //%%
+GO2(dl_iterate_phdr, iFEpp, my_dl_iterate_phdr) //%%
 // _dl_mcount_wrapper
 // _dl_mcount_wrapper_check
 // _dl_open_hook    // type B
@@ -284,14 +284,14 @@ GOM(__errno_location, pFEv)
 //GO2(execl, iFEpV, my_execv)
 //GO2(execle, iFEpV, my_execve)  // Nope! This one needs wrapping, because is char*, char*, ..., char*[]
 //GO2(execlp, iFpV, execvp)
-//GOWM(execv, iFEpp)     //%%
+GOWM(execv, iFEpp)     //%%
 //GOM(execve, iFEppp)   //%% and this one too...
 //GOWM(execvp, iFEpp)
 GO(exit, vFi)
 GO(_exit, vFi)
 GOW(_Exit, vFi)
 //GOM(__explicit_bzero_chk, vFEpuu)    //%% not always defined
-//GO(faccessat, iFipii)
+GO(faccessat, iFipii)
 // fattach
 //GO(__fbufsize, uFp)
 GOW(fchdir, iFi)
@@ -405,8 +405,8 @@ GO(freopen64, hFppH)
 //GO(fsetpos, iFpp)
 //GO(fsetpos64, iFpp)
 //GO(fsetxattr, iFippui)
-//GOW(fstatfs, iFip)
-//GOWM(fstatfs64, iFip)    //%%,noE
+GOWM(fstatfs, iFip) //%%,noE
+GOWM(fstatfs64, iFip)    //%%,noE
 //GO(fstatvfs, iFip)
 //GOW(fstatvfs64, iFip)   // alignment?
 GOW(fsync, iFi)
@@ -496,7 +496,7 @@ GOM(gethostbyname, pFEp)
 //GO(gethostent, pFv)
 //GO(gethostent_r, iFppupp)
 // gethostid
-//GOW(gethostname, iFpu)
+GOW(gethostname, iFpL)
 // __gethostname_chk
 //GO(getifaddrs, iFp)
 // getipv4sourcefilter
@@ -586,8 +586,8 @@ GOW(getsockname, iFipp)
 //GO(getspnam, pFp)
 // getspnam_r
 // getsubopt
-//GOW(gettext, pFp)
-//GOW(gettimeofday, iFpp)
+GOW(gettext, pFp)
+GOW(gettimeofday, iFBLL_p)
 //GO(__gettimeofday, iFpp)
 // getttyent
 // getttynam
@@ -623,8 +623,8 @@ GOWM(gmtime_r, pFEpp)
 GO(gnu_dev_major, uFU)
 GO(gnu_dev_makedev, UFii)       // dev_t seems to be a u64
 GO(gnu_dev_minor, uFU)
-//GOW(gnu_get_libc_release, pFv)
-//GOW(gnu_get_libc_version, pFv)
+GOW(gnu_get_libc_release, pFv)
+GOW(gnu_get_libc_version, pFv)
 // __gnu_mcount_nc
 // __gnu_Unwind_Find_exidx
 GO(grantpt, iFi)
@@ -1111,8 +1111,8 @@ GO(mkfifo, iFpu)
 //GO(mktime, LFp)
 //GO(mlock, iFpL)
 //GO(mlockall, iFi)
-//GOM(mmap, pFEpLiiii)    //%%
-//GOM(mmap64, pFEpLiiiI)  //%%
+GOM(mmap, pFEpLiiii)    //%%
+GOM(mmap64, pFEpLiiiI)  //%%
 // modf // Weak
 // modff    // Weak
 // modfl    // Weak
@@ -1122,7 +1122,7 @@ GO(mkfifo, iFpu)
 //DATA(__morecore, 4)
 GOW(mount, iFpppup)
 // mprobe
-//GOM(mprotect, iFEpLi)   //%%
+GOM(mprotect, iFEpLi)   //%%
 // mrand48
 // mrand48_r
 //GOWM(mremap, pFEpLLiN)	//%% 5th hidden paramerer "void* new_addr" if flags is MREMAP_FIXED
@@ -1134,7 +1134,7 @@ GOW(mount, iFpppup)
 // mtrace
 //GO(munlock, iFpL)
 //GO(munlockall, iFv)
-//GOM(munmap, iFEpL)       //%%
+GOM(munmap, iFEpL)       //%%
 // muntrace
 GOWM(nanosleep, iFrLL_BLL_)	 //%%,noE
 // __nanosleep  // Weak
@@ -1341,7 +1341,7 @@ GOM(read, lFipL) //%%,noE
 //GOW(__read, lFipL)
 // readahead    // Weak
 //GO(__read_chk, lFipLL)
-//GOM(readdir, pFEp)  //%% should also be weak
+GOWM(readdir, pFEp)  //%%
 GO(readdir64, pFp)  // check if alignement is correct
 // readdir64_r
 //GOM(readdir_r, iFEppp)  //%% should also be weak
@@ -1352,8 +1352,8 @@ GOM(readlink, iFEppL) //%%
 //GO(readv, lFipi)
 GO(realloc, pFpL)
 //DATAV(__realloc_hook, 4)
-//GOM(realpath, pFEpp) //%%
-GO(__realpath_chk, pFppu)
+GOM(realpath, pFEpp) //%%
+GO2(__realpath_chk, pFEppv, my32_realpath)
 // reboot
 // re_comp  // Weak
 // re_compile_fastmap   // Weak
@@ -1378,7 +1378,7 @@ GO(recv, lFipLi)
 //GO(remove, iFp)
 //GO(removexattr, iFpp)
 // remque
-//GO(rename, iFpp)
+GO(rename, iFpp)
 //GO(renameat, iFipip)
 //GO(renameat2, iFipipu)
 // _res // type B
@@ -1403,7 +1403,7 @@ GO(rewind, vFh)
 // rexec_af
 // rexecoptions // type B
 //GOW(rindex, pFpi)
-//GOW(rmdir, iFp)
+GOW(rmdir, iFp)
 //GO(readdir64_r, iFppp)  // is this present?
 // rpc_createerr    // type B
 // _rpc_dtablesize
@@ -1423,7 +1423,7 @@ GO(rewind, vFh)
 // scalbn   // Weak
 // scalbnf  // Weak
 // scalbnl  // Weak
-//GOM(scandir, iFEpppp) //%%
+GOM(scandir, iFEpppp) //%%
 GOM(scandir64, iFEpppp) //%%
 //GO2(scanf, iFpp, vscanf)
 //GO(__sched_cpualloc, pFu)   //TODO: check, return cpu_set_t* : should this be aligned/changed?
@@ -1455,7 +1455,7 @@ GO(secure_getenv, pFp)
 //GO(__select, iFipppp)
 GO(semctl, iFiiiN)
 GOW(semget, iFuii)
-//GOW(semop, iFipL)
+GOW(semop, iFipL)
 //GO(semtimedop, iFipup)
 GOW(send, lFipLi)
 // __send   // Weak
@@ -1592,10 +1592,10 @@ GOM(sscanf, iFEppV) //%%
 GOM(__stack_chk_fail, vFEv) //%%
 //GOM(lstat64, iFpp)	//%%,noE
 //GOM(stat64, iFpp)	//%%,noE
-//GOW(statfs, iFpp)
+GOWM(statfs, iFpp)  //%%,noE
 // __statfs
-//GOWM(statfs64, iFpp)     //%%,noE
-//GO(statvfs, iFpp)
+GOWM(statfs64, iFpp)     //%%,noE
+GOM(statvfs, iFEpp)
 GOWM(statvfs64, iFEhp)
 DATAM(stderr, 4)
 DATAM(stdin, 4)
@@ -1630,9 +1630,9 @@ GO(strcspn, LFpp)
 // __strcspn_c1
 // __strcspn_c2
 // __strcspn_c3
-//GOW(strdup, pFp)
-//GO(__strdup, pFp)
-//GO(strerror, pFi)
+GOW(strdup, pFp)
+GO(__strdup, pFp)
+GO(strerror, tFi)
 //GO(strerror_l, pFip)
 //GO(__strerror_r, pFipu)
 //GOW(strerror_r, pFipu)
@@ -1655,7 +1655,7 @@ GO(__strncpy_chk, pFppLL)
 GOW(strndup, pFpL)
 GO(__strndup, pFpL)
 GO(strnlen, LFpL)
-//GO(strpbrk, pFpp)
+GO(strpbrk, pFpp)
 // __strpbrk_c2
 // __strpbrk_c3
 //GO(strptime, pFppp)
@@ -1776,7 +1776,7 @@ GO(__sysconf, lFi)
 //DATA(sys_sigabbrev, 4)
 //DATA(_sys_siglist, 4)
 //DATA(sys_siglist, 4)
-//GOW(system, iFp)          // Need to wrap to use box86 if needed?
+GOW(system, iFp)          // Need to wrap to use box86 if needed?
 //GOM(__sysv_signal, pFEip) //%%
 //GOWM(sysv_signal, pFEip)  //%%
 GOW(tcdrain, iFi)
@@ -1796,13 +1796,13 @@ GO(tcsetpgrp, iFii)
 //GOW(textdomain, pFp)
 // tfind    // Weak
 GO(time, LFrL_)
-//GO(timegm, LFp)
+GO(timegm, LFriiiiiiiiilt_)
 // timelocal    // Weak
 GO(timerfd_create, iFii)
 //GO(timerfd_gettime, iFip)
 //GO(timerfd_settime, iFiipp)
 //GOW(times, iFp)
-//DATAV(timezone, 4)
+DATAM(timezone, 4)
 //DATAB(__timezone, 4)   // type B
 //GO(tmpfile, pFv)
 //GO(tmpfile64, pFv)
@@ -1839,7 +1839,7 @@ GO(towlower, iFi)
 // twalk    // Weak
 //DATAV(tzname, 4)
 //DATA(__tzname, 4)
-GOW(tzset, vFv)
+GOWM(tzset, vFv)    //%%,noE
 // ualarm
 //GO(__uflow, iFp)
 // ulckpwdf // Weak
@@ -1847,7 +1847,7 @@ GOW(tzset, vFv)
 GOW(umask, uFu)
 //GOW(umount, iFp)
 //GOW(umount2, iFpi)
-//GOWM(uname, iFp) //%%,noE
+GOWM(uname, iFp) //%%,noE
 //GO(__underflow, iFp)
 //GOW(ungetc, iFip)
 //GO(ungetwc, iFip)
@@ -1866,7 +1866,7 @@ GO(usleep, iFu)
 // ustat
 GO(utime, iFprLL_)
 //GO(utimensat, iFippi)
-//GOW(utimes, iFpp)   //TODO: check, signature is int utimes(const char *filename, const struct timeval times[2]);
+GOWM(utimes, iFEpp)
 //GOW(utmpname, iFp)
 // utmpxname
 //GOW(valloc, pFu)
@@ -1881,7 +1881,7 @@ GOM(__vasprintf_chk, iFEpippp) //%%
 GOWM(vfork, iFEv) //%%
 // __vfork
 //GOM(vfprintf, iFEppp) //%%
-//GOM(__vfprintf_chk, iFEpvpp) //%%
+GOM(__vfprintf_chk, iFEpvpp) //%%
 //GOWM(vfscanf, iFEppp)  //%%
 // __vfscanf
 //GOWM(vfwprintf, iFEppp)    //%%
@@ -1916,8 +1916,8 @@ GOM(__vsnprintf_chk, iFEpuvvppp)  //%%
 //GOW(wait3, iFpip)
 //GOW(wait4, iFipip)
 GOW(waitid, iFuupi) // might need to wrap "p", it's a siginfo_t *
-//GOW(waitpid, lFlpi)
-//GOW(__waitpid, lFlpi)
+GOW(waitpid, lFlpi)
+GOW(__waitpid, lFlpi)
 //GO(warn, vFppppppppp)
 //GO(warnx, vFppppppppp)
 //GOW(wcpcpy, pFpp)
@@ -2111,7 +2111,7 @@ GO(__xmknod, iFipup)
 GO(__xpg_strerror_r, tFipu)
 // xprt_register
 // xprt_unregister
-//GOM(__xstat, iFEipp) //%%
+GOM(__xstat, iFEipp) //%%
 GOM(__xstat64, iFEipp) //%%
 
 // forcing a custom __gmon_start__ that does nothing