diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2024-10-19 10:38:11 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2024-10-19 10:38:11 +0200 |
| commit | a5797da100bebf3941cecfb0fe0ed094f963f108 (patch) | |
| tree | 03a99ab13052e6c632f8a36951e2de587f256a99 /src/wrapped32 | |
| parent | 0821e6acc230b4cc9806ce29f4def74c76465394 (diff) | |
| download | box64-a5797da100bebf3941cecfb0fe0ed094f963f108.tar.gz box64-a5797da100bebf3941cecfb0fe0ed094f963f108.zip | |
[BOX32][WRAPPER] Added some more libc wrapped function, and 32bits globalsymbol infrastructure
Diffstat (limited to 'src/wrapped32')
| -rw-r--r-- | src/wrapped32/generated/functions_list.txt | 3 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrappedlibctypes32.h | 2 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrapper32.c | 2 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrapper32.h | 1 | ||||
| -rwxr-xr-x | src/wrapped32/wrappedlibc.c | 2 | ||||
| -rwxr-xr-x | src/wrapped32/wrappedlibc_private.h | 2 |
6 files changed, 10 insertions, 2 deletions
diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt index 00a1b693..ea90095d 100644 --- a/src/wrapped32/generated/functions_list.txt +++ b/src/wrapped32/generated/functions_list.txt @@ -1001,6 +1001,7 @@ #() iFiLLLL -> iFiLLLL #() iFipLLi -> iFipLLi #() iFippLi -> iFippLi +#() iFipppp -> iFipppp #() iFuiuup -> iFuiuup #() iFpiiuu -> iFpiiuu #() iFpippp -> iFpippp @@ -1736,6 +1737,8 @@ wrappedlibc: - iFSvpV: - LFpBp_iv: - iFiippi: +- iFipppp: + - getopt_long - iFuppLp: - getgrgid_r - getpwuid_r diff --git a/src/wrapped32/generated/wrappedlibctypes32.h b/src/wrapped32/generated/wrappedlibctypes32.h index 3ee8fcef..7f8d7aab 100644 --- a/src/wrapped32/generated/wrappedlibctypes32.h +++ b/src/wrapped32/generated/wrappedlibctypes32.h @@ -92,6 +92,7 @@ typedef int32_t (*iFSvpp_t)(void*, void, void*, void*); typedef int32_t (*iFSvpV_t)(void*, void, void*, ...); typedef uintptr_t (*LFpBp_iv_t)(void*, struct_p_t*, int32_t, void); typedef int32_t (*iFiippi_t)(int32_t, int32_t, void*, void*, int32_t); +typedef int32_t (*iFipppp_t)(int32_t, void*, void*, void*, void*); typedef int32_t (*iFuppLp_t)(uint32_t, void*, void*, uintptr_t, void*); typedef int32_t (*iFpvvpV_t)(void*, void, void, void*, ...); typedef int32_t (*iFpiLpp_t)(void*, int32_t, uintptr_t, void*, void*); @@ -175,6 +176,7 @@ typedef int32_t (*iFpLiLppp_t)(void*, uintptr_t, int32_t, uintptr_t, void*, void GO(utimensat, iFippi_t) \ GO(readlinkat, iFippL_t) \ GO(getaddrinfo, iFpppp_t) \ + GO(getopt_long, iFipppp_t) \ GO(getgrgid_r, iFuppLp_t) \ GO(getpwuid_r, iFuppLp_t) \ GO(posix_spawn_file_actions_addopen, iFpipOi_t) \ diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c index 818aec2e..21c36577 100644 --- a/src/wrapped32/generated/wrapper32.c +++ b/src/wrapped32/generated/wrapper32.c @@ -1091,6 +1091,7 @@ typedef int32_t (*iFiiipp_t)(int32_t, int32_t, int32_t, void*, void*); typedef int32_t (*iFiLLLL_t)(int32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); typedef int32_t (*iFipLLi_t)(int32_t, void*, uintptr_t, uintptr_t, int32_t); typedef int32_t (*iFippLi_t)(int32_t, void*, void*, uintptr_t, int32_t); +typedef int32_t (*iFipppp_t)(int32_t, void*, void*, void*, void*); typedef int32_t (*iFuiuup_t)(uint32_t, int32_t, uint32_t, uint32_t, void*); typedef int32_t (*iFpiiuu_t)(void*, int32_t, int32_t, uint32_t, uint32_t); typedef int32_t (*iFpippp_t)(void*, int32_t, void*, void*, void*); @@ -2593,6 +2594,7 @@ void iFiiipp_32(x64emu_t *emu, uintptr_t fcn) { iFiiipp_t fn = (iFiiipp_t)fcn; R 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), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ulong(from_ptri(ulong_t, R_ESP + 20))); } void iFipLLi_32(x64emu_t *emu, uintptr_t fcn) { iFipLLi_t fn = (iFipLLi_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20)); } void iFippLi_32(x64emu_t *emu, uintptr_t fcn) { iFippLi_t fn = (iFippLi_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20)); } +void iFipppp_32(x64emu_t *emu, uintptr_t fcn) { iFipppp_t fn = (iFipppp_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } void iFuiuup_32(x64emu_t *emu, uintptr_t fcn) { iFuiuup_t fn = (iFuiuup_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } void iFpiiuu_32(x64emu_t *emu, uintptr_t fcn) { iFpiiuu_t fn = (iFpiiuu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } void iFpippp_32(x64emu_t *emu, uintptr_t fcn) { iFpippp_t fn = (iFpippp_t)fcn; R_EAX = fn(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)); } diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h index 49e9c30b..a4ef1dcb 100644 --- a/src/wrapped32/generated/wrapper32.h +++ b/src/wrapped32/generated/wrapper32.h @@ -1042,6 +1042,7 @@ void iFiiipp_32(x64emu_t *emu, uintptr_t fnc); void iFiLLLL_32(x64emu_t *emu, uintptr_t fnc); void iFipLLi_32(x64emu_t *emu, uintptr_t fnc); void iFippLi_32(x64emu_t *emu, uintptr_t fnc); +void iFipppp_32(x64emu_t *emu, uintptr_t fnc); void iFuiuup_32(x64emu_t *emu, uintptr_t fnc); void iFpiiuu_32(x64emu_t *emu, uintptr_t fnc); void iFpippp_32(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped32/wrappedlibc.c b/src/wrapped32/wrappedlibc.c index 935a88dc..e120f7bc 100755 --- a/src/wrapped32/wrappedlibc.c +++ b/src/wrapped32/wrappedlibc.c @@ -2284,6 +2284,7 @@ EXPORT int my32_getopt(int argc, char* const argv[], const char *optstring) return ret; } +#endif EXPORT int my32_getopt_long(int argc, char* const argv[], const char* optstring, const struct option *longopts, int *longindex) { int ret = getopt_long(argc, argv, optstring, longopts, longindex); @@ -2297,7 +2298,6 @@ EXPORT int my32_getopt_long_only(int argc, char* const argv[], const char* optst my32_checkGlobalOpt(); return ret; } -#endif EXPORT int my32_alphasort64(x64emu_t* emu, ptr_t* d1_, ptr_t* d2_) { diff --git a/src/wrapped32/wrappedlibc_private.h b/src/wrapped32/wrappedlibc_private.h index 47c2ae8d..9bfdf013 100755 --- a/src/wrapped32/wrappedlibc_private.h +++ b/src/wrapped32/wrappedlibc_private.h @@ -532,7 +532,7 @@ GO(getnameinfo, iFpupupui) GOW(get_nprocs, iFv) //GOW(get_nprocs_conf, iFv) //GOM(getopt, iFipp) //%noE -//GOM(getopt_long, iFipppp) //%noE +GOM(getopt_long, iFipppp) //%noE //GOM(getopt_long_only, iFipppp) //%noE GOW(getpagesize, iFv) GO(__getpagesize, iFv) |