about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-08-24 12:00:58 +0200
committerptitSeb <sebastien.chev@gmail.com>2025-08-24 12:00:58 +0200
commit747882cb4ef5d90955de8b21f74b9fc7850cc39c (patch)
tree153f210f99922551f1126109e102d278a762fc21 /src
parente76570ad7b1fbb97f3869a2266fcbaf79d94c8de (diff)
downloadbox64-747882cb4ef5d90955de8b21f74b9fc7850cc39c.tar.gz
box64-747882cb4ef5d90955de8b21f74b9fc7850cc39c.zip
[BOX32][WRAPPER] Added one more wrapped function to libc
Diffstat (limited to 'src')
-rw-r--r--src/wrapped32/generated/converter32.c15
-rw-r--r--src/wrapped32/generated/converter32.h7
-rw-r--r--src/wrapped32/generated/functions_list.txt1
-rw-r--r--src/wrapped32/generated/wrapper32.c2
-rw-r--r--src/wrapped32/generated/wrapper32.h1
-rwxr-xr-xsrc/wrapped32/wrappedlibc_private.h2
6 files changed, 27 insertions, 1 deletions
diff --git a/src/wrapped32/generated/converter32.c b/src/wrapped32/generated/converter32.c
index e2b66567..7151fe96 100644
--- a/src/wrapped32/generated/converter32.c
+++ b/src/wrapped32/generated/converter32.c
@@ -1078,3 +1078,18 @@ void to_struct_ppuiiiiiiiiipp(ptr_t d, const struct_ppuiiiiiiiiipp_t *src) {
 	*(ptr_t*)dest = to_ptrv(src->p12); dest += 4;
 	*(ptr_t*)dest = to_ptrv(src->p13); dest += 4;
 }
+
+void from_struct_lii(struct_lii_t *dest, ptr_t s) {
+	uint8_t* src = (uint8_t*)from_ptrv(s);
+	dest->l0 = from_long(*(long_t*)src); src += 4;
+	dest->i1 = *(int*)src; src += 4;
+	dest->i2 = *(int*)src; src += 4;
+}
+void to_struct_lii(ptr_t d, const struct_lii_t *src) {
+	if (!src) return;
+	uint8_t* dest = (uint8_t*)from_ptrv(d);
+	*(ulong_t*)dest = to_long(src->l0); dest += 4;
+	*(int*)dest = src->i1; dest += 4;
+	*(int*)dest = src->i2; dest += 4;
+}
+
diff --git a/src/wrapped32/generated/converter32.h b/src/wrapped32/generated/converter32.h
index ece6d0a0..a4fc7c26 100644
--- a/src/wrapped32/generated/converter32.h
+++ b/src/wrapped32/generated/converter32.h
@@ -545,5 +545,12 @@ typedef struct struct_ppuiiiiiiiiipp_s {
 } struct_ppuiiiiiiiiipp_t;
 void from_struct_ppuiiiiiiiiipp(struct_ppuiiiiiiiiipp_t *dest, ptr_t src);
 void to_struct_ppuiiiiiiiiipp(ptr_t dest, const struct_ppuiiiiiiiiipp_t *src);
+typedef struct struct_lii_s {
+	long l0;
+	int i1;
+	int i2;
+} struct_lii_t;
+void from_struct_lii(struct_lii_t *dest, ptr_t src);
+void to_struct_lii(ptr_t dest, const struct_lii_t *src);
 
 #endif // __CONVERTER_H_
diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt
index faf4d6d7..89f0c777 100644
--- a/src/wrapped32/generated/functions_list.txt
+++ b/src/wrapped32/generated/functions_list.txt
@@ -418,6 +418,7 @@
 #() uFpbpu_ -> uFpB
 #() pFnbpi_ -> pFnB
 #() vFpbupi_ -> vFpB
+#() iEpBlii_ -> iEpB
 #() iESBliu_ -> iESB
 #() iFbppi_i -> iFBi
 #() iFbp_bp_ -> iFBB
diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c
index b0164497..12ab0e69 100644
--- a/src/wrapped32/generated/wrapper32.c
+++ b/src/wrapped32/generated/wrapper32.c
@@ -512,6 +512,7 @@ typedef int32_t (*iFXbip__t)(void*, struct_ip_t*);
 typedef uint32_t (*uFpbpu__t)(void*, struct_pu_t*);
 typedef void* (*pFnbpi__t)(void*, struct_pi_t*);
 typedef void (*vFpbupi__t)(void*, struct_upi_t*);
+typedef int32_t (*iEpBlii__t)(void*, struct_lii_t*);
 typedef int32_t (*iESBliu__t)(void*, struct_liu_t*);
 typedef int32_t (*iFbppi_i_t)(struct_ppi_t*, int32_t);
 typedef int32_t (*iFbp_bp__t)(struct_p_t*, struct_p_t*);
@@ -2672,6 +2673,7 @@ void iFXbip__32(x64emu_t *emu, uintptr_t fcn) { iFXbip__t fn = (iFXbip__t)fcn; s
 void uFpbpu__32(x64emu_t *emu, uintptr_t fcn) { uFpbpu__t fn = (uFpbpu__t)fcn; struct_pu_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pu(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
 void pFnbpi__32(x64emu_t *emu, uintptr_t fcn) { pFnbpi__t fn = (pFnbpi__t)fcn; void *aligned_xcb = align_xcb_connection32(from_ptriv(R_ESP + 4)); struct_pi_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pi(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_ptrv(fn(aligned_xcb, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL)); unalign_xcb_connection32(aligned_xcb, from_ptriv(R_ESP + 4)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pi(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
 void vFpbupi__32(x64emu_t *emu, uintptr_t fcn) { vFpbupi__t fn = (vFpbupi__t)fcn; struct_upi_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_upi(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_upi(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
+void iEpBlii__32(x64emu_t *emu, uintptr_t fcn) { iEpBlii__t fn = (iEpBlii__t)fcn; errno = emu->libc_err; struct_lii_t arg_8={0}; R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_lii(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; }
 void iESBliu__32(x64emu_t *emu, uintptr_t fcn) { iESBliu__t fn = (iESBliu__t)fcn; errno = emu->libc_err; struct_liu_t arg_8={0}; R_EAX = fn(io_convert32(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_liu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; }
 void iFbppi_i_32(x64emu_t *emu, uintptr_t fcn) { iFbppi_i_t fn = (iFbppi_i_t)fcn; struct_ppi_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppi(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(int32_t, R_ESP + 8)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppi(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); }
 void iFbp_bp__32(x64emu_t *emu, uintptr_t fcn) { iFbp_bp__t fn = (iFbp_bp__t)fcn; struct_p_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_p(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 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 + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h
index c8a62455..b3a9233e 100644
--- a/src/wrapped32/generated/wrapper32.h
+++ b/src/wrapped32/generated/wrapper32.h
@@ -459,6 +459,7 @@ void iFXbip__32(x64emu_t *emu, uintptr_t fnc);
 void uFpbpu__32(x64emu_t *emu, uintptr_t fnc);
 void pFnbpi__32(x64emu_t *emu, uintptr_t fnc);
 void vFpbupi__32(x64emu_t *emu, uintptr_t fnc);
+void iEpBlii__32(x64emu_t *emu, uintptr_t fnc);
 void iESBliu__32(x64emu_t *emu, uintptr_t fnc);
 void iFbppi_i_32(x64emu_t *emu, uintptr_t fnc);
 void iFbp_bp__32(x64emu_t *emu, uintptr_t fnc);
diff --git a/src/wrapped32/wrappedlibc_private.h b/src/wrapped32/wrappedlibc_private.h
index 15195f04..9ced18ce 100755
--- a/src/wrapped32/wrappedlibc_private.h
+++ b/src/wrapped32/wrappedlibc_private.h
@@ -418,7 +418,7 @@ GO(fseek, iESli)
 GO(fseeko, iESli)
 GO(fseeko64, iESIi)
 GO(__fsetlocking, iESi)
-//GO(fsetpos, iEpp)
+GO(fsetpos, iEpBlii_)
 //GO(fsetpos64, iEpp)
 GO(fsetxattr, iEippLi)
 GOM(fstat, iFip)    //%%,noE