about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wrapped/generated/functions_list.txt3
-rw-r--r--src/wrapped/generated/wrapper.c5
-rw-r--r--src/wrapped/generated/wrapper.h3
-rwxr-xr-xsrc/wrapped/wrappedlibc.c23
-rwxr-xr-xsrc/wrapped/wrappedlibc_private.h8
5 files changed, 22 insertions, 20 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt
index c4963c84..5f7bf60a 100644
--- a/src/wrapped/generated/functions_list.txt
+++ b/src/wrapped/generated/functions_list.txt
@@ -79,6 +79,7 @@
 #() iFuu
 #() iFup
 #() iFUU
+#() iFli
 #() iFLL
 #() iFLp
 #() iFpw
@@ -608,6 +609,7 @@
 #() vFppupii
 #() vFpppppp
 #() iFEpippi
+#() iFEpuppp
 #() iFEppppp
 #() iFiiiiii
 #() iFiiiiip
@@ -874,3 +876,4 @@
 #() iFEpvpp -> iFEppp
 #() iFEpvpV -> iFEppV
 #() iFEpLvvpp -> iFEpLpp
+#() iFEpuvvppp -> iFEpuppp
diff --git a/src/wrapped/generated/wrapper.c b/src/wrapped/generated/wrapper.c
index 2d50729a..730b4930 100644
--- a/src/wrapped/generated/wrapper.c
+++ b/src/wrapped/generated/wrapper.c
@@ -112,6 +112,7 @@ typedef int32_t (*iFui_t)(uint32_t, int32_t);
 typedef int32_t (*iFuu_t)(uint32_t, uint32_t);
 typedef int32_t (*iFup_t)(uint32_t, void*);
 typedef int32_t (*iFUU_t)(uint64_t, uint64_t);
+typedef int32_t (*iFli_t)(intptr_t, int32_t);
 typedef int32_t (*iFLL_t)(uintptr_t, uintptr_t);
 typedef int32_t (*iFLp_t)(uintptr_t, void*);
 typedef int32_t (*iFpw_t)(void*, int16_t);
@@ -641,6 +642,7 @@ typedef void (*vFppiipi_t)(void*, void*, int32_t, int32_t, void*, int32_t);
 typedef void (*vFppupii_t)(void*, void*, uint32_t, void*, int32_t, int32_t);
 typedef void (*vFpppppp_t)(void*, void*, void*, void*, void*, void*);
 typedef int32_t (*iFEpippi_t)(x64emu_t*, void*, int32_t, void*, void*, int32_t);
+typedef int32_t (*iFEpuppp_t)(x64emu_t*, void*, uint32_t, void*, void*, void*);
 typedef int32_t (*iFEppppp_t)(x64emu_t*, void*, void*, void*, void*, void*);
 typedef int32_t (*iFiiiiii_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t);
 typedef int32_t (*iFiiiiip_t)(int32_t, int32_t, int32_t, int32_t, int32_t, void*);
@@ -987,6 +989,7 @@ void iFui(x64emu_t *emu, uintptr_t fcn) { iFui_t fn = (iFui_t)fcn; R_RAX=fn((uin
 void iFuu(x64emu_t *emu, uintptr_t fcn) { iFuu_t fn = (iFuu_t)fcn; R_RAX=fn((uint32_t)R_RDI, (uint32_t)R_RSI); }
 void iFup(x64emu_t *emu, uintptr_t fcn) { iFup_t fn = (iFup_t)fcn; R_RAX=fn((uint32_t)R_RDI, (void*)R_RSI); }
 void iFUU(x64emu_t *emu, uintptr_t fcn) { iFUU_t fn = (iFUU_t)fcn; R_RAX=fn((uint64_t)R_RDI, (uint64_t)R_RSI); }
+void iFli(x64emu_t *emu, uintptr_t fcn) { iFli_t fn = (iFli_t)fcn; R_RAX=fn((intptr_t)R_RDI, (int32_t)R_RSI); }
 void iFLL(x64emu_t *emu, uintptr_t fcn) { iFLL_t fn = (iFLL_t)fcn; R_RAX=fn((uintptr_t)R_RDI, (uintptr_t)R_RSI); }
 void iFLp(x64emu_t *emu, uintptr_t fcn) { iFLp_t fn = (iFLp_t)fcn; R_RAX=fn((uintptr_t)R_RDI, (void*)R_RSI); }
 void iFpw(x64emu_t *emu, uintptr_t fcn) { iFpw_t fn = (iFpw_t)fcn; R_RAX=fn((void*)R_RDI, (int16_t)R_RSI); }
@@ -1516,6 +1519,7 @@ void vFppiipi(x64emu_t *emu, uintptr_t fcn) { vFppiipi_t fn = (vFppiipi_t)fcn; f
 void vFppupii(x64emu_t *emu, uintptr_t fcn) { vFppupii_t fn = (vFppupii_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9); }
 void vFpppppp(x64emu_t *emu, uintptr_t fcn) { vFpppppp_t fn = (vFpppppp_t)fcn; fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); }
 void iFEpippi(x64emu_t *emu, uintptr_t fcn) { iFEpippi_t fn = (iFEpippi_t)fcn; R_RAX=fn(emu, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8); }
+void iFEpuppp(x64emu_t *emu, uintptr_t fcn) { iFEpuppp_t fn = (iFEpuppp_t)fcn; R_RAX=fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); }
 void iFEppppp(x64emu_t *emu, uintptr_t fcn) { iFEppppp_t fn = (iFEppppp_t)fcn; R_RAX=fn(emu, (void*)R_RDI, (void*)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8); }
 void iFiiiiii(x64emu_t *emu, uintptr_t fcn) { iFiiiiii_t fn = (iFiiiiii_t)fcn; R_RAX=fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9); }
 void iFiiiiip(x64emu_t *emu, uintptr_t fcn) { iFiiiiip_t fn = (iFiiiiip_t)fcn; R_RAX=fn((int32_t)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9); }
@@ -1789,3 +1793,4 @@ void iFEvpp(x64emu_t *emu, uintptr_t fcn) { iFEpp_t fn = (iFEpp_t)fcn; R_RAX=fn(
 void iFEpvpp(x64emu_t *emu, uintptr_t fcn) { iFEppp_t fn = (iFEppp_t)fcn; R_RAX=fn(emu, (void*)R_RDI, (void*)R_RDX, (void*)R_RCX); }
 void iFEpvpV(x64emu_t *emu, uintptr_t fcn) { iFEppV_t fn = (iFEppV_t)fcn; R_RAX=fn(emu, (void*)R_RDI, (void*)R_RDX, (void*)(R_RSP + 8)); }
 void iFEpLvvpp(x64emu_t *emu, uintptr_t fcn) { iFEpLpp_t fn = (iFEpLpp_t)fcn; R_RAX=fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_R8, (void*)R_R9); }
+void iFEpuvvppp(x64emu_t *emu, uintptr_t fcn) { iFEpuppp_t fn = (iFEpuppp_t)fcn; R_RAX=fn(emu, (void*)R_RDI, (uint32_t)R_RSI, (void*)R_R8, (void*)R_R9, *(void**)(R_RSP + 8)); }
diff --git a/src/wrapped/generated/wrapper.h b/src/wrapped/generated/wrapper.h
index 0d8fd280..88c57022 100644
--- a/src/wrapped/generated/wrapper.h
+++ b/src/wrapped/generated/wrapper.h
@@ -109,6 +109,7 @@ void iFui(x64emu_t *emu, uintptr_t fnc);
 void iFuu(x64emu_t *emu, uintptr_t fnc);
 void iFup(x64emu_t *emu, uintptr_t fnc);
 void iFUU(x64emu_t *emu, uintptr_t fnc);
+void iFli(x64emu_t *emu, uintptr_t fnc);
 void iFLL(x64emu_t *emu, uintptr_t fnc);
 void iFLp(x64emu_t *emu, uintptr_t fnc);
 void iFpw(x64emu_t *emu, uintptr_t fnc);
@@ -638,6 +639,7 @@ void vFppiipi(x64emu_t *emu, uintptr_t fnc);
 void vFppupii(x64emu_t *emu, uintptr_t fnc);
 void vFpppppp(x64emu_t *emu, uintptr_t fnc);
 void iFEpippi(x64emu_t *emu, uintptr_t fnc);
+void iFEpuppp(x64emu_t *emu, uintptr_t fnc);
 void iFEppppp(x64emu_t *emu, uintptr_t fnc);
 void iFiiiiii(x64emu_t *emu, uintptr_t fnc);
 void iFiiiiip(x64emu_t *emu, uintptr_t fnc);
@@ -911,5 +913,6 @@ void iFEvpp(x64emu_t *emu, uintptr_t fnc);
 void iFEpvpp(x64emu_t *emu, uintptr_t fnc);
 void iFEpvpV(x64emu_t *emu, uintptr_t fnc);
 void iFEpLvvpp(x64emu_t *emu, uintptr_t fnc);
+void iFEpuvvppp(x64emu_t *emu, uintptr_t fnc);
 
 #endif //__WRAPPER_H_
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 0542d999..bae44fbf 100755
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -821,24 +821,15 @@ EXPORT int my___asprintf_chk(x64emu_t* emu, void* result_ptr, int flags, void* f
     return vasprintf((char**)result_ptr, (char*)fmt, V);
     #endif
 }
-
-EXPORT int my_vswprintf(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void * b, va_list V) {
-    #ifndef NOALIGN
-    // need to align on arm
-    myStackAlignW((const char*)fmt, (uint32_t*)b, emu->scratch);
-    PREPARE_VALIST;
-    void* f = vswprintf;
-    int r = ((iFpupp_t)f)(buff, s, fmt, VARARGS);
-    return r;
-    #else
-    void* f = vswprintf;
-    int r = ((iFpupp_t)f)(buff, s, fmt, (uint32_t*)b);
+#endif
+EXPORT int my_vswprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, x64_va_list_t b) {
+    CONVERT_VALIST(b);
+    int r = vswprintf(buff, s, fmt, VARARGS);
     return r;
-    #endif
 }
-EXPORT int my___vswprintf(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void * b, va_list V) __attribute__((alias("my_vswprintf")));
-EXPORT int my___vswprintf_chk(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void * b, va_list V) __attribute__((alias("my_vswprintf")));
-
+EXPORT int my___vswprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, x64_va_list_t b) __attribute__((alias("my_vswprintf")));
+EXPORT int my___vswprintf_chk(x64emu_t* emu, void* buff, size_t s, void * fmt, x64_va_list_t b) __attribute__((alias("my_vswprintf")));
+#if 0
 EXPORT void my_verr(x64emu_t* emu, int eval, void* fmt, void* b) {
     #ifndef NOALIGN
     myStackAlignW((const char*)fmt, (uint32_t*)b, emu->scratch);
diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h
index a33d9c96..a36f1442 100755
--- a/src/wrapped/wrappedlibc_private.h
+++ b/src/wrapped/wrappedlibc_private.h
@@ -985,8 +985,8 @@ GO(jrand48, iFp)
 //GO(key_secretkey_is_set, 
 //GO(key_setnet, 
 //GO(key_setsecret, 
-//GOW(kill, 
-//GO(killpg, 
+GOW(kill, iFli)
+GO(killpg, iFii)
 //GO(klogctl, 
 //GO(l64a, 
 //GO(labs, 
@@ -2059,8 +2059,8 @@ GOM(__vsnprintf_chk, iFEpLvvpp)
 //GO(__vsprintf_chk, 
 //GOW(__vsscanf, 
 //GOW(vsscanf, 
-//GOW(vswprintf, 
-//GO(__vswprintf_chk, 
+GOM(vswprintf, iFEpuppp)    // Weak
+GOM(__vswprintf_chk, iFEpuvvppp)    // Weak
 //GO(vswscanf, 
 //GO(vsyslog, 
 //GO(__vsyslog_chk,