From 80b357da41743af7ba37857098c4d0c0784b31e0 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 27 Dec 2024 18:08:06 +0100 Subject: [PATCH] [BOX32] Adapted signatures of 2 32bits libc wrapped functions --- src/wrapped32/generated/functions_list.txt | 1 + src/wrapped32/generated/wrapper32.c | 2 ++ src/wrapped32/generated/wrapper32.h | 1 + src/wrapped32/wrappedlibc_private.h | 4 ++-- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt index 820250ffd..5282757d6 100644 --- a/src/wrapped32/generated/functions_list.txt +++ b/src/wrapped32/generated/functions_list.txt @@ -118,6 +118,7 @@ #() hEv -> hEv #() hFv -> hFv #() aEa -> aEa +#() tEv -> tEv #() tEi -> tEi #() tEu -> tEu #() tEp -> tEp diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c index 4ae67aa87..1038a1de2 100644 --- a/src/wrapped32/generated/wrapper32.c +++ b/src/wrapped32/generated/wrapper32.c @@ -212,6 +212,7 @@ typedef void* (*pFn_t)(void*); typedef uintptr_t (*hEv_t)(void); typedef uintptr_t (*hFv_t)(void); typedef void* (*aEa_t)(void*); +typedef char* (*tEv_t)(void); typedef char* (*tEi_t)(int32_t); typedef char* (*tEu_t)(uint32_t); typedef char* (*tEp_t)(void*); @@ -2017,6 +2018,7 @@ void pFn_32(x64emu_t *emu, uintptr_t fcn) { pFn_t fn = (pFn_t)fcn; void *aligned void hEv_32(x64emu_t *emu, uintptr_t fcn) { hEv_t fn = (hEv_t)fcn; errno = emu->libc_err; R_EAX = to_hash(fn()); emu->libc_err = errno; } void hFv_32(x64emu_t *emu, uintptr_t fcn) { hFv_t fn = (hFv_t)fcn; R_EAX = to_hash(fn()); } void aEa_32(x64emu_t *emu, uintptr_t fcn) { aEa_t fn = (aEa_t)fcn; errno = emu->libc_err; R_EAX = to_locale(fn(from_locale(from_ptri(ptr_t, R_ESP + 4)))); emu->libc_err = errno; } +void tEv_32(x64emu_t *emu, uintptr_t fcn) { tEv_t fn = (tEv_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn()); emu->libc_err = errno; } void tEi_32(x64emu_t *emu, uintptr_t fcn) { tEi_t fn = (tEi_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn(from_ptri(int32_t, R_ESP + 4))); emu->libc_err = errno; } void tEu_32(x64emu_t *emu, uintptr_t fcn) { tEu_t fn = (tEu_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn(from_ptri(uint32_t, R_ESP + 4))); emu->libc_err = errno; } void tEp_32(x64emu_t *emu, uintptr_t fcn) { tEp_t fn = (tEp_t)fcn; errno = emu->libc_err; R_EAX = to_cstring(fn(from_ptriv(R_ESP + 4))); emu->libc_err = errno; } diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h index 545080120..c278117ec 100644 --- a/src/wrapped32/generated/wrapper32.h +++ b/src/wrapped32/generated/wrapper32.h @@ -159,6 +159,7 @@ void pFn_32(x64emu_t *emu, uintptr_t fnc); void hEv_32(x64emu_t *emu, uintptr_t fnc); void hFv_32(x64emu_t *emu, uintptr_t fnc); void aEa_32(x64emu_t *emu, uintptr_t fnc); +void tEv_32(x64emu_t *emu, uintptr_t fnc); void tEi_32(x64emu_t *emu, uintptr_t fnc); void tEu_32(x64emu_t *emu, uintptr_t fnc); void tEp_32(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped32/wrappedlibc_private.h b/src/wrapped32/wrappedlibc_private.h index e4eefbdfe..1c233ec84 100755 --- a/src/wrapped32/wrappedlibc_private.h +++ b/src/wrapped32/wrappedlibc_private.h @@ -639,8 +639,8 @@ GOWM(gmtime_r, pEEpp) GO(gnu_dev_major, uEU) GO(gnu_dev_makedev, UEuu) GO(gnu_dev_minor, uEU) -GOW(gnu_get_libc_release, pEv) -GOW(gnu_get_libc_version, pEv) +GOW(gnu_get_libc_release, tEv) +GOW(gnu_get_libc_version, tEv) // __gnu_mcount_nc // __gnu_Unwind_Find_exidx GO(grantpt, iEi)