From ca08012bbfa11caaa4a36a9199a902ba335c296a Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 8 Dec 2024 09:41:31 +0100 Subject: [BOX32][WRAPPER] Added a couple of 32bits wrapped functions to libc --- src/wrapped32/generated/functions_list.txt | 2 ++ src/wrapped32/generated/wrapper32.c | 4 ++++ src/wrapped32/generated/wrapper32.h | 2 ++ src/wrapped32/wrappedlibc_private.h | 8 ++++---- 4 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt index 011620e9..91d44b61 100644 --- a/src/wrapped32/generated/functions_list.txt +++ b/src/wrapped32/generated/functions_list.txt @@ -972,8 +972,10 @@ #() iFXLbL_i -> iFXLBi #() iFXLbp_p -> iFXLBp #() IEpBp_ii -> IEpBii +#() IEpBp_ia -> IEpBia #() uFppibp_ -> uFppiB #() UEpBp_ii -> UEpBii +#() UEpBp_ia -> UEpBia #() lEiibl_L -> lEiiBL #() LEpBp_ii -> LEpBii #() LEpbp_Lp -> LEpBLp diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c index 4ced3a77..e3b50c97 100644 --- a/src/wrapped32/generated/wrapper32.c +++ b/src/wrapped32/generated/wrapper32.c @@ -1063,8 +1063,10 @@ typedef int32_t (*iFXLbp_i_t)(void*, uintptr_t, struct_p_t*, int32_t); typedef int32_t (*iFXLbL_i_t)(void*, uintptr_t, struct_L_t*, int32_t); typedef int32_t (*iFXLbp_p_t)(void*, uintptr_t, struct_p_t*, void*); typedef int64_t (*IEpBp_ii_t)(void*, struct_p_t*, int32_t, int32_t); +typedef int64_t (*IEpBp_ia_t)(void*, struct_p_t*, int32_t, void*); typedef uint32_t (*uFppibp__t)(void*, void*, int32_t, struct_p_t*); typedef uint64_t (*UEpBp_ii_t)(void*, struct_p_t*, int32_t, int32_t); +typedef uint64_t (*UEpBp_ia_t)(void*, struct_p_t*, int32_t, void*); typedef intptr_t (*lEiibl_L_t)(int32_t, int32_t, struct_l_t*, uintptr_t); typedef uintptr_t (*LEpBp_ii_t)(void*, struct_p_t*, int32_t, int32_t); typedef uintptr_t (*LEpbp_Lp_t)(void*, struct_p_t*, uintptr_t, void*); @@ -2714,8 +2716,10 @@ void iFXLbp_i_32(x64emu_t *emu, uintptr_t fcn) { iFXLbp_i_t fn = (iFXLbp_i_t)fcn void iFXLbL_i_32(x64emu_t *emu, uintptr_t fcn) { iFXLbL_i_t fn = (iFXLbL_i_t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptri(int32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } void iFXLbp_p_32(x64emu_t *emu, uintptr_t fcn) { iFXLbp_p_t fn = (iFXLbp_p_t)fcn; struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } void IEpBp_ii_32(x64emu_t *emu, uintptr_t fcn) { IEpBp_ii_t fn = (IEpBp_ii_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; 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), from_ptri(int32_t, R_ESP + 16)); 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); emu->libc_err = errno; } +void IEpBp_ia_32(x64emu_t *emu, uintptr_t fcn) { IEpBp_ia_t fn = (IEpBp_ia_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; 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), from_locale(from_ptri(ptr_t, R_ESP + 16))); 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); emu->libc_err = errno; } void uFppibp__32(x64emu_t *emu, uintptr_t fcn) { uFppibp__t fn = (uFppibp__t)fcn; struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } void UEpBp_ii_32(x64emu_t *emu, uintptr_t fcn) { UEpBp_ii_t fn = (UEpBp_ii_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; ui64_t r; r.u = (uint64_t)fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); 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); emu->libc_err = errno; } +void UEpBp_ia_32(x64emu_t *emu, uintptr_t fcn) { UEpBp_ia_t fn = (UEpBp_ia_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; ui64_t r; r.u = (uint64_t)fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_locale(from_ptri(ptr_t, R_ESP + 16))); 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); emu->libc_err = errno; } void lEiibl_L_32(x64emu_t *emu, uintptr_t fcn) { lEiibl_L_t fn = (lEiibl_L_t)fcn; errno = emu->libc_err; struct_l_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_l(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 16)))); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_l(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); emu->libc_err = errno; } void LEpBp_ii_32(x64emu_t *emu, uintptr_t fcn) { LEpBp_ii_t fn = (LEpBp_ii_t)fcn; errno = emu->libc_err; struct_p_t arg_8={0}; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } void LEpbp_Lp_32(x64emu_t *emu, uintptr_t fcn) { LEpbp_Lp_t fn = (LEpbp_Lp_t)fcn; errno = emu->libc_err; 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 = to_ulong(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); emu->libc_err = errno; } diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h index 3fb7b43b..cdd1382d 100644 --- a/src/wrapped32/generated/wrapper32.h +++ b/src/wrapped32/generated/wrapper32.h @@ -1013,8 +1013,10 @@ void iFXLbp_i_32(x64emu_t *emu, uintptr_t fnc); void iFXLbL_i_32(x64emu_t *emu, uintptr_t fnc); void iFXLbp_p_32(x64emu_t *emu, uintptr_t fnc); void IEpBp_ii_32(x64emu_t *emu, uintptr_t fnc); +void IEpBp_ia_32(x64emu_t *emu, uintptr_t fnc); void uFppibp__32(x64emu_t *emu, uintptr_t fnc); void UEpBp_ii_32(x64emu_t *emu, uintptr_t fnc); +void UEpBp_ia_32(x64emu_t *emu, uintptr_t fnc); void lEiibl_L_32(x64emu_t *emu, uintptr_t fnc); void LEpBp_ii_32(x64emu_t *emu, uintptr_t fnc); void LEpbp_Lp_32(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped32/wrappedlibc_private.h b/src/wrapped32/wrappedlibc_private.h index a31384d0..247c20f3 100755 --- a/src/wrapped32/wrappedlibc_private.h +++ b/src/wrapped32/wrappedlibc_private.h @@ -1722,8 +1722,8 @@ GO(strtoll, IEpBp_i) //GO(__strtol_l, lEppiip) //GOW(strtol_l, lEppiip) GO(__strtoll_internal, IEpBp_ii) -//GO(__strtoll_l, IEppip) -//GOW(strtoll_l, IEppip) +GO(__strtoll_l, IEpBp_ia) +GOW(strtoll_l, IEpBp_ia) //GOW(strtoq, IEppi) // is that ok? GOM(strtoul, LEpBp_i) //%%,noE GO2(__strtoul_internal, LEpBp_ii, my32_strtoul) //%%,noE @@ -1731,8 +1731,8 @@ GO(strtoull, UEpBp_i) //GO(__strtoul_l, uEppip) //GOW(strtoul_l, LEppip) GO(__strtoull_internal, UEpBp_ii) -//GO(__strtoull_l, UEppip) -//GOW(strtoull_l, UEppip) +GO(__strtoull_l, UEpBp_ia) +GOW(strtoull_l, UEpBp_ia) //GO(strtoumax, UEppi) //GOW(strtouq, UEppi) // ok? GOW(strverscmp, iEpp) -- cgit 1.4.1