about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-08-28 18:35:24 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-08-28 18:35:24 +0200
commit126c59b4a41b3f17b4fdea6e1fd94bd15d1638d7 (patch)
treef4ddcd2506cc59d159dc9e937e4bbab53e0b4b23 /src
parentb7be225846153a1ed44b149b6600fb86c3fa0b42 (diff)
downloadbox64-126c59b4a41b3f17b4fdea6e1fd94bd15d1638d7.tar.gz
box64-126c59b4a41b3f17b4fdea6e1fd94bd15d1638d7.zip
[BOX32] More wrapped 32bits functions, and some fixes too
Diffstat (limited to 'src')
-rw-r--r--src/box32.c7
-rw-r--r--src/emu/x64emu_private.h2
-rwxr-xr-xsrc/include/myalign32.h1
-rwxr-xr-xsrc/libtools/myalign32.c99
-rwxr-xr-xsrc/libtools/threads32.c14
-rw-r--r--src/wrapped32/generated/functions_list.txt15
-rw-r--r--src/wrapped32/generated/wrappedlibctypes32.h3
-rw-r--r--src/wrapped32/generated/wrappedlibpthreadtypes32.h2
-rw-r--r--src/wrapped32/generated/wrapper32.c20
-rw-r--r--src/wrapped32/generated/wrapper32.h10
-rwxr-xr-xsrc/wrapped32/wrappedlibc.c37
-rwxr-xr-xsrc/wrapped32/wrappedlibc_private.h24
-rwxr-xr-xsrc/wrapped32/wrappedlibpthread_private.h4
13 files changed, 198 insertions, 40 deletions
diff --git a/src/box32.c b/src/box32.c
index 24af6b06..9add2a61 100644
--- a/src/box32.c
+++ b/src/box32.c
@@ -11,7 +11,7 @@
 
 KHASH_MAP_INIT_INT64(to, ulong_t);
 KHASH_MAP_INIT_INT(from, uintptr_t);
-KHASH_MAP_INIT_STR(strings, char*);
+KHASH_MAP_INIT_STR(strings, ptr_t);
 
 static kh_from_t*   hash_from;
 static kh_to_t*     hash_to;
@@ -304,8 +304,9 @@ ptr_t to_cstring(char* p) {
         ret = to_ptrv(box_strdup(p));
         int r;
         k = kh_put(strings, const_strings, (char*)from_ptrv(ret), &r);
+        kh_value(const_strings, k) = ret;
     } else
-        ret = to_ptrv(kh_value(const_strings, k));
+        ret = kh_value(const_strings, k);
     pthread_rwlock_unlock(&hash_lock);
     return ret;
 }
@@ -319,7 +320,7 @@ ptr_t to_cstring_d(char* p) {
     if(k==kh_end(const_strings)) {
         // assert?
     } else {
-        ret = to_ptrv(kh_value(const_strings, k));
+        ret = kh_value(const_strings, k);
         kh_del(strings, const_strings, k);
         free(from_ptrv(ret));
     }
diff --git a/src/emu/x64emu_private.h b/src/emu/x64emu_private.h
index a8690343..39b41aa4 100644
--- a/src/emu/x64emu_private.h
+++ b/src/emu/x64emu_private.h
@@ -135,6 +135,8 @@ typedef struct x64emu_s {
     int         type;       // EMUTYPE_xxx define
     #ifdef BOX32
     int         libc_err;   // copy of errno from libc
+    unsigned short libctype[384];   // copy from __ctype_b because, again, is thread local
+    const unsigned short **orig_ctype;    // source used for this copy
     #endif
 } x64emu_t;
 
diff --git a/src/include/myalign32.h b/src/include/myalign32.h
index fb2eb132..b889f4a4 100755
--- a/src/include/myalign32.h
+++ b/src/include/myalign32.h
@@ -76,6 +76,7 @@ typedef struct  va_list {
 #define PREPARE_VALIST_32_(A) CREATE_SYSV_VALIST_32(A)
 
 void myStackAlign32(const char* fmt, uint32_t* st, uint64_t* mystack);
+void myStackAlignScanf32(const char* fmt, uint32_t* st, uint64_t* mystack);
 void myStackAlignGVariantNew32(const char* fmt, uint32_t* st, uint64_t* mystack);
 void myStackAlignW32(const char* fmt, uint32_t* st, uint64_t* mystack);
 
diff --git a/src/libtools/myalign32.c b/src/libtools/myalign32.c
index ee0b2790..6bcb015f 100755
--- a/src/libtools/myalign32.c
+++ b/src/libtools/myalign32.c
@@ -138,6 +138,105 @@ void myStackAlign32(const char* fmt, uint32_t* st, uint64_t* mystack)
     }
 }
 
+void myStackAlignScanf32(const char* fmt, uint32_t* st, uint64_t* mystack)
+{
+    
+    if(!fmt)
+        return;
+    // loop...
+    const char* p = fmt;
+    int state = 0;
+    int ign = 0;
+    while(*p)
+    {
+        switch(state) {
+            case 0:
+                ign = 0;
+                switch(*p) {
+                    case '%': state = 1; ++p; break;
+                    default:
+                        ++p;
+                }
+                break;
+            case 1: // normal
+            case 2: // l
+            case 3: // ll
+            case 4: // L
+            case 5: // z
+                switch(*p) {
+                    case '%': state = 0;  ++p; break; //%% = back to 0
+                    case 'l': ++state; if (state>3) state=3; ++p; break;
+                    case 'L': state = 4; ++p; break;
+                    case 'z': state = 5; ++p; break;
+                    case 'a':
+                    case 'A':
+                    case 'e':
+                    case 'E':
+                    case 'g':
+                    case 'G':
+                    case 'F':
+                    case 'f': state += 10; break;    //  float
+                    case 'd':
+                    case 'i':
+                    case 'o':
+                    case 'u':
+                    case 'x':
+                    case 'X': state += 20; break;   // int
+                    case 'h': ++p; break;  // ignored...
+                    case '\'':
+                    case '0':
+                    case '1':
+                    case '2':
+                    case '3':
+                    case '4':
+                    case '5':
+                    case '6':
+                    case '7':
+                    case '8':
+                    case '9':
+                    case '.': 
+                    case '#':
+                    case '+': 
+                    case '-': ++p; break; // formating, ignored
+                    case 'm': state = 0; ++p; break; // no argument
+                    case 'n':
+                    case 'p':
+                    case 'S':
+                    case 's': state = 30; break; // pointers
+                    case '$': ++p; break; // should issue a warning, it's not handled...
+                    case '*': ign=1; ++p; break; // ignore arg
+                    case ' ': state=0; ++p; break;
+                    default:
+                        state=20; // other stuff, put an int...
+                }
+                break;
+            case 11:    //double
+            case 12:    //%lg, still double
+            case 13:    //%llg, still double
+            case 14:    //%Lg long double
+            case 15:    //%zg
+            case 20:    // fallback
+            case 21:
+            case 22:
+            case 23:    // 64bits int
+            case 24:    // normal int / pointer
+            case 25:    // size_t int
+            case 30:
+                if(!ign) {
+                    *mystack = *st;
+                    ++st;
+                    ++mystack;
+                }
+                state = 0;
+                ++p;
+                break;
+            default:
+                // whaaaat?
+                state = 0;
+        }
+    }
+}
+
 void myStackAlignGVariantNew32(const char* fmt, uint32_t* st, uint64_t* mystack)
 {
     if (!fmt)
diff --git a/src/libtools/threads32.c b/src/libtools/threads32.c
index 1fc3a2df..bab4cf4f 100755
--- a/src/libtools/threads32.c
+++ b/src/libtools/threads32.c
@@ -293,6 +293,20 @@ EXPORT void my32___pthread_unregister_cancel(x64emu_t* emu, x64_unwind_buff_t* b
 	}
 }
 
+#define X86_RWLOCK_SIZE	32
+EXPORT int my32_pthread_rwlock_init(void* rdlock, void* attr)
+{
+	// the structure is bigger, but the "active" part should be the same size, so just save/restoore the padding at init
+	uint8_t buff[sizeof(pthread_rwlock_t)];
+	if(rdlock && sizeof(pthread_rwlock_t)>X86_RWLOCK_SIZE) {
+		memcpy(buff, rdlock+32, sizeof(pthread_rwlock_t)-X86_RWLOCK_SIZE);
+	}
+	int ret = pthread_rwlock_init(rdlock, attr);
+	memcpy(rdlock+32, buff, sizeof(pthread_rwlock_t)-X86_RWLOCK_SIZE);
+	return ret;
+}
+EXPORT int my32___pthread_rwlock_init(void*, void*) __attribute__((alias("my32_pthread_rwlock_init")));
+
 EXPORT void my32___pthread_unwind_next(x64emu_t* emu, void* p)
 {
 	emu->quit = 1;
diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt
index b634a1b4..9232fe99 100644
--- a/src/wrapped32/generated/functions_list.txt
+++ b/src/wrapped32/generated/functions_list.txt
@@ -27,6 +27,7 @@
 #() LFv -> LFv
 #() LFL -> LFL
 #() LFp -> LFp
+#() pFv -> pFv
 #() pFu -> pFu
 #() pFL -> pFL
 #() pFp -> pFp
@@ -46,13 +47,14 @@
 #() iFiI -> iFiI
 #() iFiu -> iFiu
 #() iFip -> iFip
+#() iFih -> iFih
 #() iFuu -> iFuu
 #() iFup -> iFup
 #() iFli -> iFli
 #() iFpi -> iFpi
 #() iFpu -> iFpu
 #() iFpp -> iFpp
-#() iFhp -> iFhp
+#() iFph -> iFph
 #() iFhh -> iFhh
 #() IFII -> IFII
 #() uFEu -> uFEu
@@ -75,7 +77,9 @@
 #() pFEv -> pFEv
 #() pFEp -> pFEp
 #() pFLL -> pFLL
+#() pFpi -> pFpi
 #() pFpL -> pFpL
+#() pFpp -> pFpp
 #() tFip -> tFip
 #() tFpL -> tFpL
 #() iFHBp_ -> iFHB
@@ -128,6 +132,7 @@
 #() hFEpp -> hFEpp
 #() hFppH -> hFppH
 #() aFipa -> aFipa
+#() tFipu -> tFipu
 #() IFpBp_i -> IFpBi
 #() lFpBp_i -> lFpBi
 #() vFEipV -> vFEipV
@@ -140,6 +145,7 @@
 #() iFEppu -> iFEppu
 #() iFEppL -> iFEppL
 #() iFEppp -> iFEppp
+#() iFEppV -> iFEppV
 #() iFEpOu -> iFEpOu
 #() iFEhpV -> iFEhpV
 #() iFiiII -> iFiiII
@@ -150,6 +156,7 @@
 #() pFpiLL -> pFpiLL
 #() pFppuL -> pFppuL
 #() pFppLL -> pFppLL
+#() vFEpLLp -> vFEpLLp
 #() iFEppiV -> iFEppiV
 #() iFEpppi -> iFEpppi
 #() iFiLLLL -> iFiLLLL
@@ -158,7 +165,6 @@
 #() iFEpLppp -> iFEpLppp
 #() iFEpLiipV -> iFEpLiipV
 #() iFEpippppp -> iFEpippppp
-#defined(ANDROID) pFv -> pFv
 #defined(ANDROID) vFEpppp -> vFEpppp
 #defined(HAVE_LD80BITS) DFD -> DFD
 #defined(HAVE_LD80BITS) DFDD -> DFDD
@@ -189,6 +195,7 @@ wrappedlibc:
 - uFV:
 - LFL:
 - pFv:
+  - __ctype_b_loc
   - __errno_location
 - pFL:
 - vFip:
@@ -208,7 +215,9 @@ wrappedlibc:
 - iFipp:
 - iFppL:
 - iFppp:
+- iFppV:
 - iFpOu:
+- vFpLLp:
 - vFpppp:
   - __libc_init
 - iFiiII:
@@ -355,6 +364,7 @@ wrappedlibpthread:
   - __pthread_key_create
   - __pthread_mutex_init
   - __pthread_once
+  - __pthread_rwlock_init
   - pthread_attr_getdetachstate
   - pthread_attr_getguardsize
   - pthread_attr_getinheritsched
@@ -372,6 +382,7 @@ wrappedlibpthread:
   - pthread_mutex_init
   - pthread_mutex_timedlock
   - pthread_once
+  - pthread_rwlock_init
   - pthread_setname_np
 - vFppp:
   - _pthread_cleanup_push
diff --git a/src/wrapped32/generated/wrappedlibctypes32.h b/src/wrapped32/generated/wrappedlibctypes32.h
index 459586b4..b50248eb 100644
--- a/src/wrapped32/generated/wrappedlibctypes32.h
+++ b/src/wrapped32/generated/wrappedlibctypes32.h
@@ -38,7 +38,9 @@ typedef int32_t (*iFiiN_t)(int32_t, int32_t, ...);
 typedef int32_t (*iFipp_t)(int32_t, void*, void*);
 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 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 (*iFppiV_t)(void*, void*, int32_t, ...);
@@ -50,6 +52,7 @@ typedef int32_t (*iFpuvvppp_t)(void*, uint32_t, void, void, void*, void*, void*)
 
 #define SUPER() ADDED_FUNCTIONS() \
 	GO(__close_nocancel, iFi_t) \
+	GO(__ctype_b_loc, pFv_t) \
 	GO(__errno_location, pFv_t) \
 	GO(alphasort64, iFpp_t) \
 	GO(signal, pFip_t) \
diff --git a/src/wrapped32/generated/wrappedlibpthreadtypes32.h b/src/wrapped32/generated/wrappedlibpthreadtypes32.h
index 74b615de..ca45f0a4 100644
--- a/src/wrapped32/generated/wrappedlibpthreadtypes32.h
+++ b/src/wrapped32/generated/wrappedlibpthreadtypes32.h
@@ -62,6 +62,7 @@ typedef int32_t (*iFhppp_t)(uintptr_t, void*, void*, void*);
 	GO(__pthread_key_create, iFpp_t) \
 	GO(__pthread_mutex_init, iFpp_t) \
 	GO(__pthread_once, iFpp_t) \
+	GO(__pthread_rwlock_init, iFpp_t) \
 	GO(pthread_attr_getdetachstate, iFpp_t) \
 	GO(pthread_attr_getguardsize, iFpp_t) \
 	GO(pthread_attr_getinheritsched, iFpp_t) \
@@ -79,6 +80,7 @@ typedef int32_t (*iFhppp_t)(uintptr_t, void*, void*, void*);
 	GO(pthread_mutex_init, iFpp_t) \
 	GO(pthread_mutex_timedlock, iFpp_t) \
 	GO(pthread_once, iFpp_t) \
+	GO(pthread_rwlock_init, iFpp_t) \
 	GO(pthread_setname_np, iFpp_t) \
 	GO(_pthread_cleanup_push, vFppp_t) \
 	GO(_pthread_cleanup_push_defer, vFppp_t) \
diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c
index f4132f5f..6f0f1383 100644
--- a/src/wrapped32/generated/wrapper32.c
+++ b/src/wrapped32/generated/wrapper32.c
@@ -101,6 +101,7 @@ typedef intptr_t (*lFp_t)(void*);
 typedef uintptr_t (*LFv_t)(void);
 typedef uintptr_t (*LFL_t)(uintptr_t);
 typedef uintptr_t (*LFp_t)(void*);
+typedef void* (*pFv_t)(void);
 typedef void* (*pFu_t)(uint32_t);
 typedef void* (*pFL_t)(uintptr_t);
 typedef void* (*pFp_t)(void*);
@@ -120,13 +121,14 @@ typedef int32_t (*iFii_t)(int32_t, int32_t);
 typedef int32_t (*iFiI_t)(int32_t, int64_t);
 typedef int32_t (*iFiu_t)(int32_t, uint32_t);
 typedef int32_t (*iFip_t)(int32_t, void*);
+typedef int32_t (*iFih_t)(int32_t, uintptr_t);
 typedef int32_t (*iFuu_t)(uint32_t, uint32_t);
 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 (*iFpp_t)(void*, void*);
-typedef int32_t (*iFhp_t)(uintptr_t, void*);
+typedef int32_t (*iFph_t)(void*, uintptr_t);
 typedef int32_t (*iFhh_t)(uintptr_t, uintptr_t);
 typedef int64_t (*IFII_t)(int64_t, int64_t);
 typedef uint32_t (*uFEu_t)(x64emu_t*, uint32_t);
@@ -149,7 +151,9 @@ typedef uintptr_t (*LFpp_t)(void*, void*);
 typedef void* (*pFEv_t)(x64emu_t*);
 typedef void* (*pFEp_t)(x64emu_t*, void*);
 typedef void* (*pFLL_t)(uintptr_t, uintptr_t);
+typedef void* (*pFpi_t)(void*, int32_t);
 typedef void* (*pFpL_t)(void*, uintptr_t);
+typedef void* (*pFpp_t)(void*, void*);
 typedef char* (*tFip_t)(int32_t, void*);
 typedef char* (*tFpL_t)(void*, uintptr_t);
 typedef int32_t (*iFHBp__t)(uintptr_t, struct_p_t*);
@@ -202,6 +206,7 @@ typedef void* (*pFpOM_t)(void*, int32_t, ...);
 typedef uintptr_t (*hFEpp_t)(x64emu_t*, void*, void*);
 typedef uintptr_t (*hFppH_t)(void*, void*, uintptr_t);
 typedef void* (*aFipa_t)(int32_t, void*, void*);
+typedef char* (*tFipu_t)(int32_t, void*, uint32_t);
 typedef int64_t (*IFpBp_i_t)(void*, struct_p_t*, int32_t);
 typedef intptr_t (*lFpBp_i_t)(void*, struct_p_t*, int32_t);
 typedef void (*vFEipV_t)(x64emu_t*, int32_t, void*, void*);
@@ -214,6 +219,7 @@ typedef int32_t (*iFEpup_t)(x64emu_t*, void*, uint32_t, void*);
 typedef int32_t (*iFEppu_t)(x64emu_t*, void*, void*, uint32_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*);
 typedef int32_t (*iFEpOu_t)(x64emu_t*, void*, int32_t, uint32_t);
 typedef int32_t (*iFEhpV_t)(x64emu_t*, uintptr_t, void*, void*);
 typedef int32_t (*iFiiII_t)(int32_t, int32_t, int64_t, int64_t);
@@ -224,6 +230,7 @@ typedef void* (*pFEppp_t)(x64emu_t*, void*, void*, void*);
 typedef void* (*pFpiLL_t)(void*, int32_t, uintptr_t, uintptr_t);
 typedef void* (*pFppuL_t)(void*, void*, uint32_t, uintptr_t);
 typedef void* (*pFppLL_t)(void*, void*, uintptr_t, uintptr_t);
+typedef void (*vFEpLLp_t)(x64emu_t*, void*, uintptr_t, uintptr_t, void*);
 typedef int32_t (*iFEppiV_t)(x64emu_t*, void*, void*, int32_t, void*);
 typedef int32_t (*iFEpppi_t)(x64emu_t*, void*, void*, void*, int32_t);
 typedef int32_t (*iFiLLLL_t)(int32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
@@ -234,7 +241,6 @@ typedef int32_t (*iFEpLiipV_t)(x64emu_t*, void*, uintptr_t, int32_t, int32_t, vo
 typedef int32_t (*iFEpippppp_t)(x64emu_t*, void*, int32_t, void*, void*, void*, void*, void*);
 
 #if defined(ANDROID)
-typedef void* (*pFv_t)(void);
 typedef void (*vFEpppp_t)(x64emu_t*, void*, void*, void*, void*);
 #endif
 
@@ -279,6 +285,7 @@ void lFp_32(x64emu_t *emu, uintptr_t fcn) { lFp_t fn = (lFp_t)fcn; R_EAX = to_lo
 void LFv_32(x64emu_t *emu, uintptr_t fcn) { LFv_t fn = (LFv_t)fcn; R_EAX = to_ulong(fn()); }
 void LFL_32(x64emu_t *emu, uintptr_t fcn) { LFL_t fn = (LFL_t)fcn; R_EAX = to_ulong(fn(to_ulong(from_ptri(ulong_t, R_ESP + 4)))); }
 void LFp_32(x64emu_t *emu, uintptr_t fcn) { LFp_t fn = (LFp_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4))); }
+void pFv_32(x64emu_t *emu, uintptr_t fcn) { pFv_t fn = (pFv_t)fcn; R_EAX = to_ptrv(fn()); }
 void pFu_32(x64emu_t *emu, uintptr_t fcn) { pFu_t fn = (pFu_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4))); }
 void pFL_32(x64emu_t *emu, uintptr_t fcn) { pFL_t fn = (pFL_t)fcn; R_EAX = to_ptrv(fn(to_ulong(from_ptri(ulong_t, R_ESP + 4)))); }
 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))); }
@@ -298,13 +305,14 @@ void iFii_32(x64emu_t *emu, uintptr_t fcn) { iFii_t fn = (iFii_t)fcn; R_EAX = fn
 void iFiI_32(x64emu_t *emu, uintptr_t fcn) { iFiI_t fn = (iFiI_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int64_t, R_ESP + 8)); }
 void iFiu_32(x64emu_t *emu, uintptr_t fcn) { iFiu_t fn = (iFiu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); }
 void iFip_32(x64emu_t *emu, uintptr_t fcn) { iFip_t fn = (iFip_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); }
+void iFih_32(x64emu_t *emu, uintptr_t fcn) { iFih_t fn = (iFih_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_hash(from_ptri(ptr_t, R_ESP + 8))); }
 void iFuu_32(x64emu_t *emu, uintptr_t fcn) { iFuu_t fn = (iFuu_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); }
 void iFup_32(x64emu_t *emu, uintptr_t fcn) { iFup_t fn = (iFup_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); }
 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 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 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)); }
+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 iFhh_32(x64emu_t *emu, uintptr_t fcn) { iFhh_t fn = (iFhh_t)fcn; R_EAX = fn(from_hash(from_ptri(ptr_t, R_ESP + 4)), from_hash(from_ptri(ptr_t, R_ESP + 8))); }
 void IFII_32(x64emu_t *emu, uintptr_t fcn) { IFII_t fn = (IFII_t)fcn; ui64_t r; r.i = fn(from_ptri(int64_t, R_ESP + 4), from_ptri(int64_t, R_ESP + 12)); R_EAX = r.d[0]; R_EDX = r.d[1]; }
 void uFEu_32(x64emu_t *emu, uintptr_t fcn) { uFEu_t fn = (uFEu_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptri(uint32_t, R_ESP + 4)); }
@@ -327,7 +335,9 @@ void LFpp_32(x64emu_t *emu, uintptr_t fcn) { LFpp_t fn = (LFpp_t)fcn; R_EAX = to
 void pFEv_32(x64emu_t *emu, uintptr_t fcn) { pFEv_t fn = (pFEv_t)fcn; R_EAX = to_ptrv(fn(emu)); }
 void pFEp_32(x64emu_t *emu, uintptr_t fcn) { pFEp_t fn = (pFEp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4))); }
 void pFLL_32(x64emu_t *emu, uintptr_t fcn) { pFLL_t fn = (pFLL_t)fcn; R_EAX = to_ptrv(fn(to_ulong(from_ptri(ulong_t, R_ESP + 4)), to_ulong(from_ptri(ulong_t, R_ESP + 8)))); }
+void pFpi_32(x64emu_t *emu, uintptr_t fcn) { pFpi_t fn = (pFpi_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8))); }
 void pFpL_32(x64emu_t *emu, uintptr_t fcn) { pFpL_t fn = (pFpL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)))); }
+void pFpp_32(x64emu_t *emu, uintptr_t fcn) { pFpp_t fn = (pFpp_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8))); }
 void tFip_32(x64emu_t *emu, uintptr_t fcn) { tFip_t fn = (tFip_t)fcn; R_EAX = to_cstring(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8))); }
 void tFpL_32(x64emu_t *emu, uintptr_t fcn) { tFpL_t fn = (tFpL_t)fcn; R_EAX = to_cstring(fn(from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)))); }
 void iFHBp__32(x64emu_t *emu, uintptr_t fcn) { iFHBp__t fn = (iFHBp__t)fcn; struct_p_t arg_8; R_EAX = fn(from_hash_d(from_ptri(ptr_t, R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
@@ -380,6 +390,7 @@ void pFpOM_32(x64emu_t *emu, uintptr_t fcn) { pFpOM_t fn = (pFpOM_t)fcn; R_EAX =
 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))); }
 void hFppH_32(x64emu_t *emu, uintptr_t fcn) { hFppH_t fn = (hFppH_t)fcn; R_EAX = to_hash(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_hash_d(from_ptri(ptr_t, R_ESP + 12)))); }
 void aFipa_32(x64emu_t *emu, uintptr_t fcn) { aFipa_t fn = (aFipa_t)fcn; R_EAX = to_locale(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_locale(from_ptri(ptr_t, R_ESP + 12)))); }
+void tFipu_32(x64emu_t *emu, uintptr_t fcn) { tFipu_t fn = (tFipu_t)fcn; R_EAX = to_cstring(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12))); }
 void IFpBp_i_32(x64emu_t *emu, uintptr_t fcn) { IFpBp_i_t fn = (IFpBp_i_t)fcn; struct_p_t arg_8; ui64_t r; r.i = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12)); R_EAX = r.d[0]; R_EDX = r.d[1]; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
 void lFpBp_i_32(x64emu_t *emu, uintptr_t fcn) { lFpBp_i_t fn = (lFpBp_i_t)fcn; struct_p_t arg_8; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
 void vFEipV_32(x64emu_t *emu, uintptr_t fcn) { vFEipV_t fn = (vFEipV_t)fcn; fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptrv(R_ESP + 12)); }
@@ -392,6 +403,7 @@ void iFEpup_32(x64emu_t *emu, uintptr_t fcn) { iFEpup_t fn = (iFEpup_t)fcn; R_EA
 void iFEppu_32(x64emu_t *emu, uintptr_t fcn) { iFEppu_t fn = (iFEppu_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_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)); }
 void iFEpOu_32(x64emu_t *emu, uintptr_t fcn) { iFEpOu_t fn = (iFEpOu_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), of_convert32(from_ptri(int32_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12)); }
 void iFEhpV_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 + 8), from_ptrv(R_ESP + 12)); }
 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)); }
@@ -402,6 +414,7 @@ void pFEppp_32(x64emu_t *emu, uintptr_t fcn) { pFEppp_t fn = (pFEppp_t)fcn; R_EA
 void pFpiLL_32(x64emu_t *emu, uintptr_t fcn) { pFpiLL_t fn = (pFpiLL_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)), to_ulong(from_ptri(ulong_t, R_ESP + 16)))); }
 void pFppuL_32(x64emu_t *emu, uintptr_t fcn) { pFppuL_t fn = (pFppuL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), to_ulong(from_ptri(ulong_t, R_ESP + 16)))); }
 void pFppLL_32(x64emu_t *emu, uintptr_t fcn) { pFppLL_t fn = (pFppLL_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)), to_ulong(from_ptri(ulong_t, R_ESP + 16)))); }
+void vFEpLLp_32(x64emu_t *emu, uintptr_t fcn) { vFEpLLp_t fn = (vFEpLLp_t)fcn; fn(emu, from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), to_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); }
 void iFEppiV_32(x64emu_t *emu, uintptr_t fcn) { iFEppiV_t fn = (iFEppiV_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptrv(R_ESP + 16)); }
 void iFEpppi_32(x64emu_t *emu, uintptr_t fcn) { iFEpppi_t fn = (iFEpppi_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); }
 void iFiLLLL_32(x64emu_t *emu, uintptr_t fcn) { iFiLLLL_t fn = (iFiLLLL_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), to_ulong(from_ptri(ulong_t, R_ESP + 12)), to_ulong(from_ptri(ulong_t, R_ESP + 16)), to_ulong(from_ptri(ulong_t, R_ESP + 20))); }
@@ -412,7 +425,6 @@ void iFEpLiipV_32(x64emu_t *emu, uintptr_t fcn) { iFEpLiipV_t fn = (iFEpLiipV_t)
 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)
-void pFv_32(x64emu_t *emu, uintptr_t fcn) { pFv_t fn = (pFv_t)fcn; R_EAX = to_ptrv(fn()); }
 void vFEpppp_32(x64emu_t *emu, uintptr_t fcn) { vFEpppp_t fn = (vFEpppp_t)fcn; fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); }
 #endif
 
diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h
index e9be1667..f96f7a6a 100644
--- a/src/wrapped32/generated/wrapper32.h
+++ b/src/wrapped32/generated/wrapper32.h
@@ -67,6 +67,7 @@ void lFp_32(x64emu_t *emu, uintptr_t fnc);
 void LFv_32(x64emu_t *emu, uintptr_t fnc);
 void LFL_32(x64emu_t *emu, uintptr_t fnc);
 void LFp_32(x64emu_t *emu, uintptr_t fnc);
+void pFv_32(x64emu_t *emu, uintptr_t fnc);
 void pFu_32(x64emu_t *emu, uintptr_t fnc);
 void pFL_32(x64emu_t *emu, uintptr_t fnc);
 void pFp_32(x64emu_t *emu, uintptr_t fnc);
@@ -86,13 +87,14 @@ void iFii_32(x64emu_t *emu, uintptr_t fnc);
 void iFiI_32(x64emu_t *emu, uintptr_t fnc);
 void iFiu_32(x64emu_t *emu, uintptr_t fnc);
 void iFip_32(x64emu_t *emu, uintptr_t fnc);
+void iFih_32(x64emu_t *emu, uintptr_t fnc);
 void iFuu_32(x64emu_t *emu, uintptr_t fnc);
 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 iFpp_32(x64emu_t *emu, uintptr_t fnc);
-void iFhp_32(x64emu_t *emu, uintptr_t fnc);
+void iFph_32(x64emu_t *emu, uintptr_t fnc);
 void iFhh_32(x64emu_t *emu, uintptr_t fnc);
 void IFII_32(x64emu_t *emu, uintptr_t fnc);
 void uFEu_32(x64emu_t *emu, uintptr_t fnc);
@@ -115,7 +117,9 @@ void LFpp_32(x64emu_t *emu, uintptr_t fnc);
 void pFEv_32(x64emu_t *emu, uintptr_t fnc);
 void pFEp_32(x64emu_t *emu, uintptr_t fnc);
 void pFLL_32(x64emu_t *emu, uintptr_t fnc);
+void pFpi_32(x64emu_t *emu, uintptr_t fnc);
 void pFpL_32(x64emu_t *emu, uintptr_t fnc);
+void pFpp_32(x64emu_t *emu, uintptr_t fnc);
 void tFip_32(x64emu_t *emu, uintptr_t fnc);
 void tFpL_32(x64emu_t *emu, uintptr_t fnc);
 void iFHBp__32(x64emu_t *emu, uintptr_t fnc);
@@ -168,6 +172,7 @@ void pFpOM_32(x64emu_t *emu, uintptr_t fnc);
 void hFEpp_32(x64emu_t *emu, uintptr_t fnc);
 void hFppH_32(x64emu_t *emu, uintptr_t fnc);
 void aFipa_32(x64emu_t *emu, uintptr_t fnc);
+void tFipu_32(x64emu_t *emu, uintptr_t fnc);
 void IFpBp_i_32(x64emu_t *emu, uintptr_t fnc);
 void lFpBp_i_32(x64emu_t *emu, uintptr_t fnc);
 void vFEipV_32(x64emu_t *emu, uintptr_t fnc);
@@ -180,6 +185,7 @@ void iFEpup_32(x64emu_t *emu, uintptr_t fnc);
 void iFEppu_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);
 void iFEpOu_32(x64emu_t *emu, uintptr_t fnc);
 void iFEhpV_32(x64emu_t *emu, uintptr_t fnc);
 void iFiiII_32(x64emu_t *emu, uintptr_t fnc);
@@ -190,6 +196,7 @@ void pFEppp_32(x64emu_t *emu, uintptr_t fnc);
 void pFpiLL_32(x64emu_t *emu, uintptr_t fnc);
 void pFppuL_32(x64emu_t *emu, uintptr_t fnc);
 void pFppLL_32(x64emu_t *emu, uintptr_t fnc);
+void vFEpLLp_32(x64emu_t *emu, uintptr_t fnc);
 void iFEppiV_32(x64emu_t *emu, uintptr_t fnc);
 void iFEpppi_32(x64emu_t *emu, uintptr_t fnc);
 void iFiLLLL_32(x64emu_t *emu, uintptr_t fnc);
@@ -200,7 +207,6 @@ void iFEpLiipV_32(x64emu_t *emu, uintptr_t fnc);
 void iFEpippppp_32(x64emu_t *emu, uintptr_t fnc);
 
 #if defined(ANDROID)
-void pFv_32(x64emu_t *emu, uintptr_t fnc);
 void vFEpppp_32(x64emu_t *emu, uintptr_t fnc);
 #endif
 
diff --git a/src/wrapped32/wrappedlibc.c b/src/wrapped32/wrappedlibc.c
index 54c444fb..926fcdb8 100755
--- a/src/wrapped32/wrappedlibc.c
+++ b/src/wrapped32/wrappedlibc.c
@@ -870,19 +870,6 @@ EXPORT int my32_vfscanf(x64emu_t* emu, void* stream, void* fmt, void* b) // prob
 }
 
 
-
-EXPORT int my32_vsscanf(x64emu_t* emu, void* stream, void* fmt, void* b)
-{
-    //myStackAlign32((const char*)fmt, (uint32_t*)b, emu->scratch);
-    PREPARE_VALIST_32_(b);
-    void* f = vsscanf;
-
-    return ((iFppp_t)f)(stream, fmt, VARARGS_32_(b));
-}
-
-EXPORT int my32__vsscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my32_vsscanf")));
-EXPORT int my32_sscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my32_vsscanf")));
-
 EXPORT int my32__IO_vfscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my32_vfscanf")));
 EXPORT int my32___isoc99_vsscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my32_vsscanf")));
 
@@ -898,6 +885,16 @@ EXPORT int my32___isoc99_sscanf(x64emu_t* emu, void* stream, void* fmt, void* b)
 }
 #endif
 #endif
+EXPORT int my32_vsscanf(x64emu_t* emu, void* buff, void* fmt, void* b)
+{
+    myStackAlignScanf32((const char*)fmt, (uint32_t*)b, emu->scratch);
+    PREPARE_VALIST_32;
+    vsscanf(buff, fmt, VARARGS_32);
+}
+
+EXPORT int my32__vsscanf(x64emu_t* emu, void* buff, void* fmt, void* b) __attribute__((alias("my32_vsscanf")));
+EXPORT int my32_sscanf(x64emu_t* emu, void* buff, void* fmt, void* b) __attribute__((alias("my32_vsscanf")));
+
 EXPORT int my32_vsnprintf(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void * b, va_list V) {
     // need to align on arm
     myStackAlign32((const char*)fmt, (uint32_t*)b, emu->scratch);
@@ -1355,7 +1352,7 @@ static void qsort_r(void* base, size_t nmemb, size_t size, __compar_d_fn_t compa
     return qsort_r_helper(base, size, compar, arg, 0, nmemb - 1);
 }
 #endif
-
+#endif
 typedef struct compare_r_s {
     x64emu_t* emu;
     uintptr_t f;
@@ -1379,7 +1376,7 @@ 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));
@@ -2275,6 +2272,16 @@ EXPORT int my32_alphasort64(x64emu_t* emu, ptr_t* d1_, ptr_t* d2_)
     return alphasort64(d1_?(&d1):NULL, d2_?(&d2):NULL);
 }
 
+EXPORT void* my32___ctype_b_loc(x64emu_t* emu)
+{
+    const unsigned short** src =__ctype_b_loc();
+    if(src != emu->orig_ctype) {
+        memcpy(emu->libctype, *src-128, 384*sizeof(short));
+        emu->orig_ctype = src;
+    }
+    return &emu->libctype[128];
+}
+
 EXPORT struct __processor_model
 {
   unsigned int __cpu_vendor;
diff --git a/src/wrapped32/wrappedlibc_private.h b/src/wrapped32/wrappedlibc_private.h
index 2e41febb..a30ae524 100755
--- a/src/wrapped32/wrappedlibc_private.h
+++ b/src/wrapped32/wrappedlibc_private.h
@@ -166,7 +166,7 @@ GO(closelog, vFv)
 //GO(ctime, pFp)
 //GO(ctime_r, pFpp)
 //DATAM(__ctype_b, 4)
-//GO(__ctype_b_loc, pFv)
+GOM(__ctype_b_loc, pFEv)
 //GOW(__ctype_get_mb_cur_max, LFv)
 //DATAM(__ctype_tolower, 4)
 //GO(__ctype_tolower_loc, pFv)
@@ -367,9 +367,9 @@ GOW(fpathconf, iFii)
 GOM(__fprintf_chk, iFEhvpV) //%%
 // __fpu_control    // type B
 //GO(__fpurge, vFp)
-//GOW(fputc, iFip)
+GOW(fputc, iFih)
 //GO(fputc_unlocked, iFip)
-GOW(fputs, iFhp)    // Weak
+GOW(fputs, iFph)    // Weak
 //GO(fputs_unlocked, iFpp)
 //GO(fputwc, iFip)
 //GO(fputwc_unlocked, iFip)
@@ -469,7 +469,7 @@ GOW(getcwd, tFpL)
 GOW(getdtablesize, iFv)
 GOW(getegid, iFv)
 GO(getenv, tFp)
-//GOW(geteuid, pFv)
+GOW(geteuid, pFv)
 // getfsent
 // getfsfile
 // getfsspec
@@ -1188,7 +1188,7 @@ GOW(ntohs, uFu)
 // __obstack_vprintf_chk
 //GOWM(on_exit, iFEpp)  //%%
 //GO2(__on_exit, iFEpp, my_on_exit)   //%%
-//GOWM(open, iFEpOu)    //%%
+GOWM(open, iFEpOu)    //%%
 //GOWM(__open, iFEpOu)  //%%
 //GO(__open_2, iFpO)
 GOWM(open64, iFEpOu)  //%%
@@ -1319,7 +1319,7 @@ GO(putwchar_unlocked, iFi)
 //GO(qfcvt_r, iFKipppL)
 #endif
 // qgcvt
-//GOM(qsort, vFEpLLp) //%%
+GOM(qsort, vFEpLLp) //%%
 //GOM(qsort_r, vFEpLLpp) //%%
 // query_module // Weak
 //GO(quotactl, iFipip)
@@ -1582,7 +1582,7 @@ GO(srand48, vFi)
 // srand48_r    // Weak
 GOW(srandom, vFu)
 //GOW(srandom_r, iFup)
-//GOM(sscanf, iFEppV) //%%
+GOM(sscanf, iFEppV) //%%
 // ssignal  // Weak
 // sstk
 GOM(__stack_chk_fail, vFEv) //%%
@@ -1613,13 +1613,13 @@ GOW(strcasecmp, iFpp)
 //GO(__strcasestr, pFpp)
 //GO(strcat, pFpp)
 //GO(__strcat_chk, pFppL)
-//GO(strchr, pFpi)
+GO(strchr, pFpi)
 //GOW(strchrnul, pFpi)
 GO(strcmp, iFpp)
 //GO(strcoll, iFpp)
 //GO(__strcoll_l, iFppp)
 //GOW(strcoll_l, iFppp)
-//GO(strcpy, pFpp)
+GO(strcpy, pFpp)
 GO(__strcpy_chk, pFppL)
 // __strcpy_small
 GO(strcspn, LFpp)
@@ -1645,7 +1645,7 @@ GOW(strncasecmp, iFppL)
 // strncasecmp_l    // Weak
 GO(strncat, pFppL)
 //GO(__strncat_chk, pFppLL)
-//GO(strncmp, iFppL)
+GO(strncmp, iFppL)
 //GO(strncpy, pFppL)
 //GO(__strncpy_chk, pFppLL)
 //GOW(strndup, pFpL)
@@ -1847,7 +1847,7 @@ GOW(umask, uFu)
 //GO(__underflow, iFp)
 //GOW(ungetc, iFip)
 //GO(ungetwc, iFip)
-//GOW(unlink, iFp)
+GOW(unlink, iFp)
 //GO(unlinkat, iFipi)
 GO(unlockpt, iFi)
 //GOW(unsetenv, iFp)
@@ -2104,7 +2104,7 @@ GOW(wmemmove, pFppL)
 //GO(__xmknodat, iFiipip)
 //GO(__xpg_basename, pFp)
 // __xpg_sigpause   // Weak
-//GO(__xpg_strerror_r, pFipu)
+GO(__xpg_strerror_r, tFipu)
 // xprt_register
 // xprt_unregister
 //GOM(__xstat, iFEipp) //%%
diff --git a/src/wrapped32/wrappedlibpthread_private.h b/src/wrapped32/wrappedlibpthread_private.h
index be13d397..6f44c733 100755
--- a/src/wrapped32/wrappedlibpthread_private.h
+++ b/src/wrapped32/wrappedlibpthread_private.h
@@ -130,8 +130,8 @@ GO(pthread_rwlockattr_setkind_np, iFpi)
 // pthread_rwlockattr_setpshared
 // __pthread_rwlock_destroy
 GO(pthread_rwlock_destroy, iFp)
-GO(__pthread_rwlock_init, iFpp)
-GO(pthread_rwlock_init, iFpp)
+GOM(__pthread_rwlock_init, iFpp)    //%noE
+GOM(pthread_rwlock_init, iFpp)  //%noE
 GO(__pthread_rwlock_rdlock, iFp)
 GOM(pthread_rwlock_rdlock, iFp) //%noE
 // pthread_rwlock_timedrdlock