diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/emu/x64emu_private.h | 3 | ||||
| -rwxr-xr-x | src/include/myalign32.h | 1 | ||||
| -rwxr-xr-x | src/libtools/myalign32.c | 106 | ||||
| -rw-r--r-- | src/wrapped32/generated/functions_list.txt | 35 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrappedlibctypes32.h | 11 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrapper32.c | 52 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrapper32.h | 24 | ||||
| -rwxr-xr-x | src/wrapped32/wrappedlibc.c | 61 | ||||
| -rwxr-xr-x | src/wrapped32/wrappedlibc_private.h | 132 |
9 files changed, 328 insertions, 97 deletions
diff --git a/src/emu/x64emu_private.h b/src/emu/x64emu_private.h index bf59137d..903f2c0c 100644 --- a/src/emu/x64emu_private.h +++ b/src/emu/x64emu_private.h @@ -141,6 +141,9 @@ typedef struct x64emu_s { int libctolower[384]; // copy from __ctype_b_tolower address might be too high const int** ref_tolower; const int* tolower; + int libctoupper[384]; // copy from __ctype_b_toupper address might be too high + const int** ref_toupper; + const int* toupper; #endif } x64emu_t; diff --git a/src/include/myalign32.h b/src/include/myalign32.h index c6576643..c60cf30a 100755 --- a/src/include/myalign32.h +++ b/src/include/myalign32.h @@ -79,6 +79,7 @@ typedef struct va_list { void myStackAlign32(const char* fmt, uint32_t* st, uint64_t* mystack); void myStackAlignScanf32(const char* fmt, uint32_t* st, uint64_t* mystack); void myStackAlignGVariantNew32(const char* fmt, uint32_t* st, uint64_t* mystack); +void myStackAlignScanfW32(const char* fmt, uint32_t* st, uint64_t* mystack); void myStackAlignW32(const char* fmt, uint32_t* st, uint64_t* mystack); void UnalignStat64_32(const void* source, void* dest); diff --git a/src/libtools/myalign32.c b/src/libtools/myalign32.c index 6bcb015f..0dd2e94e 100755 --- a/src/libtools/myalign32.c +++ b/src/libtools/myalign32.c @@ -237,6 +237,105 @@ void myStackAlignScanf32(const char* fmt, uint32_t* st, uint64_t* mystack) } } +void myStackAlignScanfW32(const char* fmt, uint32_t* st, uint64_t* mystack) +{ + + if(!fmt) + return; + // loop... + const wchar_t* p = (const wchar_t*)fmt; + int state = 0; + int ign = 0; + while(*p) + { + switch(state) { + case 0: + ign = 0; + switch(*p) { + case '%': state = 1; ++p; break; + default: + ++p; + } + break; + case 1: // normal + case 2: // l + case 3: // ll + case 4: // L + case 5: // z + switch(*p) { + case '%': state = 0; ++p; break; //%% = back to 0 + case 'l': ++state; if (state>3) state=3; ++p; break; + case 'L': state = 4; ++p; break; + case 'z': state = 5; ++p; break; + case 'a': + case 'A': + case 'e': + case 'E': + case 'g': + case 'G': + case 'F': + case 'f': state += 10; break; // float + case 'd': + case 'i': + case 'o': + case 'u': + case 'x': + case 'X': state += 20; break; // int + case 'h': ++p; break; // ignored... + case '\'': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '.': + case '#': + case '+': + case '-': ++p; break; // formating, ignored + case 'm': state = 0; ++p; break; // no argument + case 'n': + case 'p': + case 'S': + case 's': state = 30; break; // pointers + case '$': ++p; break; // should issue a warning, it's not handled... + case '*': ign=1; ++p; break; // ignore arg + case ' ': state=0; ++p; break; + default: + state=20; // other stuff, put an int... + } + break; + case 11: //double + case 12: //%lg, still double + case 13: //%llg, still double + case 14: //%Lg long double + case 15: //%zg + case 20: // fallback + case 21: + case 22: + case 23: // 64bits int + case 24: // normal int / pointer + case 25: // size_t int + case 30: + if(!ign) { + *mystack = *st; + ++st; + ++mystack; + } + state = 0; + ++p; + break; + default: + // whaaaat? + state = 0; + } + } +} + void myStackAlignGVariantNew32(const char* fmt, uint32_t* st, uint64_t* mystack) { if (!fmt) @@ -455,7 +554,7 @@ void myStackAlignW32(const char* fmt, uint32_t* st, uint64_t* mystack) case 'o': state += 20; break; // int case 'x': case 'X': - case 'u': state += 40; break; // unsigned + case 'u': state += 40; break; // uint case 'h': ++p; break; // ignored... case '\'': case '0': @@ -477,7 +576,7 @@ void myStackAlignW32(const char* fmt, uint32_t* st, uint64_t* mystack) case 'S': case 's': state = 30; break; // pointers case '$': ++p; break; // should issue a warning, it's not handled... - case '*': *(mystack++) = *(st++); ++p; break; //fetch an int in the stack + case '*': *(mystack++) = *(st++); ++p; break; // fetch an int in the stack.... case ' ': state=0; ++p; break; default: state=20; // other stuff, put an int... @@ -524,9 +623,10 @@ void myStackAlignW32(const char* fmt, uint32_t* st, uint64_t* mystack) ++p; break; case 20: // fallback - case 40: case 21: case 24: // normal int / pointer + case 40: + case 41: *mystack = *st; ++mystack; ++st; diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt index 25e262ca..031b8f65 100644 --- a/src/wrapped32/generated/functions_list.txt +++ b/src/wrapped32/generated/functions_list.txt @@ -16,6 +16,7 @@ #() iFH -> iFH #() IFf -> IFf #() IFd -> IFd +#() IFh -> IFh #() uFv -> uFv #() uFu -> uFu #() uFU -> uFU @@ -25,6 +26,7 @@ #() dFd -> dFd #() lFi -> lFi #() lFp -> lFp +#() lFh -> lFh #() LFv -> LFv #() LFL -> LFL #() LFp -> LFp @@ -53,6 +55,7 @@ #() iFiu -> iFiu #() iFip -> iFip #() iFih -> iFih +#() iFia -> iFia #() iFuu -> iFuu #() iFup -> iFup #() iFli -> iFli @@ -84,6 +87,7 @@ #() LFpp -> LFpp #() pFEv -> pFEv #() pFEp -> pFEp +#() pFia -> pFia #() pFLL -> pFLL #() pFpi -> pFpi #() pFpL -> pFpL @@ -134,20 +138,27 @@ #() iFppu -> iFppu #() iFppL -> iFppL #() iFppp -> iFppp +#() iFppa -> iFppa #() iFpOu -> iFpOu +#() iFhIi -> iFhIi +#() iFhli -> iFhli #() iFhpL -> iFhpL #() IFiIi -> IFiIi #() fFfff -> fFfff #() fFffp -> fFffp +#() fFppa -> fFppa #() dFddd -> dFddd #() dFddp -> dFddp +#() dFppa -> dFppa #() lFipL -> lFipL #() lFlpi -> lFlpi +#() LFpip -> LFpip #() pFEip -> pFEip #() pFEpi -> pFEpi #() pFEpp -> pFEpp #() pFpiL -> pFpiL #() pFpih -> pFpih +#() pFpuL -> pFpuL #() pFppL -> pFppL #() pFpOM -> pFpOM #() hFEpp -> hFEpp @@ -155,6 +166,7 @@ #() aFipa -> aFipa #() tFipu -> tFipu #() IFpBp_i -> IFpBi +#() UFpBp_i -> UFpBi #() lFpBp_i -> lFpBi #() vFEipV -> vFEipV #() vFEppp -> vFEppp @@ -179,20 +191,30 @@ #() iFhpiL -> iFhpiL #() lFipLi -> lFipLi #() LFpLLh -> LFpLLh +#() LFppLp -> LFppLp +#() LFppLa -> LFppLa #() pFEppi -> pFEppi #() pFEppp -> pFEppp #() pFpiLL -> pFpiLL #() pFppLL -> pFppLL +#() LFpbp_Lp -> LFpBLp #() iFEpprLL_ -> iFEppB #() LFpLpriiiiiiiiilt_ -> LFpLpB #() vFEpLLp -> vFEpLLp +#() iFEpupV -> iFEpupV +#() iFEpLpV -> iFEpLpV #() iFEppiV -> iFEppiV #() iFEpppi -> iFEpppi #() iFEpppp -> iFEpppp #() iFiiipu -> iFiiipu #() iFiLLLL -> iFiLLLL #() iFpppup -> iFpppup +#() LFpLppa -> LFpLppa #() iFEBh_ppp -> iFEBppp +#() LFpbp_LLp -> LFpBLLp +#() LFpBp_LLp -> LFpBLLp +#() LFLbp_bL_Bp_BL_ -> LFLBBBB +#() LFpLpriiiiiiiiilt_a -> LFpLpBa #() iFEpippp -> iFEpippp #() iFEpuppp -> iFEpuppp #() iFEpLppp -> iFEpLppp @@ -204,9 +226,11 @@ #defined(HAVE_LD80BITS) DFD -> DFD #defined(HAVE_LD80BITS) DFDD -> DFDD #defined(HAVE_LD80BITS) DFDp -> DFDp +#defined(HAVE_LD80BITS) DFpBp_a -> DFpBa #!defined(HAVE_LD80BITS) KFK -> KFK #!defined(HAVE_LD80BITS) KFKK -> KFKK #!defined(HAVE_LD80BITS) KFKp -> KFKp +#!defined(HAVE_LD80BITS) KFpBp_a -> KFpBa #() iFEvpV -> iFEpV #() UFsvvs -> UFss #() pFEppv -> pFEpp @@ -229,6 +253,8 @@ wrappedlibc: - __close_nocancel - iFL: - iFp: +- iFh: + - getwc - iFO: - uFu: - uFV: @@ -236,6 +262,7 @@ wrappedlibc: - pFv: - __ctype_b_loc - __ctype_tolower_loc + - __ctype_toupper_loc - __errno_location - pFL: - pFp: @@ -274,8 +301,13 @@ wrappedlibc: - iFpLi: - iFppL: - iFppp: + - vswscanf - iFppV: + - swscanf - iFpOu: +- KFppa: + - __strtold_l + - strtold_l - lFipL: - pFppv: - __realpath_chk @@ -285,12 +317,15 @@ wrappedlibc: - iFiiII: - iFLLLL: - iFpvpp: +- iFpupV: +- iFpLpV: - iFppiV: - iFpppp: - getaddrinfo - iFhvpV: - iFpvvpV: - iFpippp: +- iFpuppp: - iFpLppp: - iFpLiipV: - pFpLiiii: diff --git a/src/wrapped32/generated/wrappedlibctypes32.h b/src/wrapped32/generated/wrappedlibctypes32.h index a0afe81b..0c9a12b1 100644 --- a/src/wrapped32/generated/wrappedlibctypes32.h +++ b/src/wrapped32/generated/wrappedlibctypes32.h @@ -17,6 +17,7 @@ typedef int32_t (*iFv_t)(void); typedef int32_t (*iFi_t)(int32_t); typedef int32_t (*iFL_t)(uintptr_t); typedef int32_t (*iFp_t)(void*); +typedef int32_t (*iFh_t)(uintptr_t); typedef int32_t (*iFO_t)(int32_t); typedef uint32_t (*uFu_t)(uint32_t); typedef uint32_t (*uFV_t)(...); @@ -49,6 +50,7 @@ typedef int32_t (*iFppL_t)(void*, void*, uintptr_t); typedef int32_t (*iFppp_t)(void*, void*, void*); typedef int32_t (*iFppV_t)(void*, void*, ...); typedef int32_t (*iFpOu_t)(void*, int32_t, uint32_t); +typedef double (*KFppa_t)(void*, void*, void*); typedef intptr_t (*lFipL_t)(int32_t, void*, uintptr_t); typedef void* (*pFppv_t)(void*, void*, void); typedef void (*vFpLLp_t)(void*, uintptr_t, uintptr_t, void*); @@ -56,11 +58,14 @@ typedef void (*vFpppp_t)(void*, void*, void*, void*); typedef int32_t (*iFiiII_t)(int32_t, int32_t, int64_t, int64_t); typedef int32_t (*iFLLLL_t)(uintptr_t, uintptr_t, uintptr_t, uintptr_t); typedef int32_t (*iFpvpp_t)(void*, void, void*, void*); +typedef int32_t (*iFpupV_t)(void*, uint32_t, void*, ...); +typedef int32_t (*iFpLpV_t)(void*, uintptr_t, void*, ...); typedef int32_t (*iFppiV_t)(void*, void*, int32_t, ...); typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); typedef int32_t (*iFhvpV_t)(uintptr_t, void, void*, ...); typedef int32_t (*iFpvvpV_t)(void*, void, void, void*, ...); typedef int32_t (*iFpippp_t)(void*, int32_t, void*, void*, void*); +typedef int32_t (*iFpuppp_t)(void*, uint32_t, void*, void*, void*); typedef int32_t (*iFpLppp_t)(void*, uintptr_t, void*, void*, void*); typedef int32_t (*iFpLiipV_t)(void*, uintptr_t, int32_t, int32_t, void*, ...); typedef void* (*pFpLiiii_t)(void*, uintptr_t, int32_t, int32_t, int32_t, int32_t); @@ -71,8 +76,10 @@ typedef int32_t (*iFpuvvppp_t)(void*, uint32_t, void, void, void*, void*, void*) #define SUPER() ADDED_FUNCTIONS() \ GO(freeaddrinfo, vFp_t) \ GO(__close_nocancel, iFi_t) \ + GO(getwc, iFh_t) \ GO(__ctype_b_loc, pFv_t) \ GO(__ctype_tolower_loc, pFv_t) \ + GO(__ctype_toupper_loc, pFv_t) \ GO(__errno_location, pFv_t) \ GO(gethostbyname, pFp_t) \ GO(getrlimit, iFip_t) \ @@ -86,6 +93,10 @@ typedef int32_t (*iFpuvvppp_t)(void*, uint32_t, void, void, void*, void*, void*) GO(backtrace_symbols, pFpi_t) \ GO(gmtime_r, pFpp_t) \ GO(localtime_r, pFpp_t) \ + GO(vswscanf, iFppp_t) \ + GO(swscanf, iFppV_t) \ + GO(__strtold_l, KFppa_t) \ + GO(strtold_l, KFppa_t) \ GO(__realpath_chk, pFppv_t) \ GO(__libc_init, vFpppp_t) \ GO(getaddrinfo, iFpppp_t) diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c index 9483a408..70b1047f 100644 --- a/src/wrapped32/generated/wrapper32.c +++ b/src/wrapped32/generated/wrapper32.c @@ -90,6 +90,7 @@ typedef int32_t (*iFh_t)(uintptr_t); typedef int32_t (*iFH_t)(uintptr_t); typedef int64_t (*IFf_t)(float); typedef int64_t (*IFd_t)(double); +typedef int64_t (*IFh_t)(uintptr_t); typedef uint32_t (*uFv_t)(void); typedef uint32_t (*uFu_t)(uint32_t); typedef uint32_t (*uFU_t)(uint64_t); @@ -99,6 +100,7 @@ typedef double (*dFv_t)(void); typedef double (*dFd_t)(double); typedef intptr_t (*lFi_t)(int32_t); typedef intptr_t (*lFp_t)(void*); +typedef intptr_t (*lFh_t)(uintptr_t); typedef uintptr_t (*LFv_t)(void); typedef uintptr_t (*LFL_t)(uintptr_t); typedef uintptr_t (*LFp_t)(void*); @@ -127,6 +129,7 @@ typedef int32_t (*iFiI_t)(int32_t, int64_t); typedef int32_t (*iFiu_t)(int32_t, uint32_t); typedef int32_t (*iFip_t)(int32_t, void*); typedef int32_t (*iFih_t)(int32_t, uintptr_t); +typedef int32_t (*iFia_t)(int32_t, void*); typedef int32_t (*iFuu_t)(uint32_t, uint32_t); typedef int32_t (*iFup_t)(uint32_t, void*); typedef int32_t (*iFli_t)(intptr_t, int32_t); @@ -158,6 +161,7 @@ typedef uintptr_t (*LFpL_t)(void*, uintptr_t); typedef uintptr_t (*LFpp_t)(void*, void*); typedef void* (*pFEv_t)(x64emu_t*); typedef void* (*pFEp_t)(x64emu_t*, void*); +typedef void* (*pFia_t)(int32_t, void*); typedef void* (*pFLL_t)(uintptr_t, uintptr_t); typedef void* (*pFpi_t)(void*, int32_t); typedef void* (*pFpL_t)(void*, uintptr_t); @@ -208,20 +212,27 @@ typedef int32_t (*iFpLL_t)(void*, uintptr_t, uintptr_t); typedef int32_t (*iFppu_t)(void*, void*, uint32_t); typedef int32_t (*iFppL_t)(void*, void*, uintptr_t); typedef int32_t (*iFppp_t)(void*, void*, void*); +typedef int32_t (*iFppa_t)(void*, void*, void*); typedef int32_t (*iFpOu_t)(void*, int32_t, uint32_t); +typedef int32_t (*iFhIi_t)(uintptr_t, int64_t, int32_t); +typedef int32_t (*iFhli_t)(uintptr_t, intptr_t, int32_t); typedef int32_t (*iFhpL_t)(uintptr_t, void*, uintptr_t); typedef int64_t (*IFiIi_t)(int32_t, int64_t, int32_t); typedef float (*fFfff_t)(float, float, float); typedef float (*fFffp_t)(float, float, void*); +typedef float (*fFppa_t)(void*, void*, void*); typedef double (*dFddd_t)(double, double, double); typedef double (*dFddp_t)(double, double, void*); +typedef double (*dFppa_t)(void*, void*, void*); typedef intptr_t (*lFipL_t)(int32_t, void*, uintptr_t); typedef intptr_t (*lFlpi_t)(intptr_t, void*, int32_t); +typedef uintptr_t (*LFpip_t)(void*, int32_t, void*); typedef void* (*pFEip_t)(x64emu_t*, int32_t, void*); typedef void* (*pFEpi_t)(x64emu_t*, void*, int32_t); typedef void* (*pFEpp_t)(x64emu_t*, void*, void*); typedef void* (*pFpiL_t)(void*, int32_t, uintptr_t); typedef void* (*pFpih_t)(void*, int32_t, uintptr_t); +typedef void* (*pFpuL_t)(void*, uint32_t, uintptr_t); typedef void* (*pFppL_t)(void*, void*, uintptr_t); typedef void* (*pFpOM_t)(void*, int32_t, ...); typedef uintptr_t (*hFEpp_t)(x64emu_t*, void*, void*); @@ -229,6 +240,7 @@ typedef uintptr_t (*hFppH_t)(void*, void*, uintptr_t); typedef void* (*aFipa_t)(int32_t, void*, void*); typedef char* (*tFipu_t)(int32_t, void*, uint32_t); typedef int64_t (*IFpBp_i_t)(void*, struct_p_t*, int32_t); +typedef uint64_t (*UFpBp_i_t)(void*, struct_p_t*, int32_t); typedef intptr_t (*lFpBp_i_t)(void*, struct_p_t*, int32_t); typedef void (*vFEipV_t)(x64emu_t*, int32_t, void*, void*); typedef void (*vFEppp_t)(x64emu_t*, void*, void*, void*); @@ -253,20 +265,30 @@ typedef int32_t (*iFuupi_t)(uint32_t, uint32_t, void*, int32_t); typedef int32_t (*iFhpiL_t)(uintptr_t, void*, int32_t, uintptr_t); typedef intptr_t (*lFipLi_t)(int32_t, void*, uintptr_t, int32_t); typedef uintptr_t (*LFpLLh_t)(void*, uintptr_t, uintptr_t, uintptr_t); +typedef uintptr_t (*LFppLp_t)(void*, void*, uintptr_t, void*); +typedef uintptr_t (*LFppLa_t)(void*, void*, uintptr_t, void*); typedef void* (*pFEppi_t)(x64emu_t*, void*, void*, int32_t); typedef void* (*pFEppp_t)(x64emu_t*, void*, void*, void*); typedef void* (*pFpiLL_t)(void*, int32_t, uintptr_t, uintptr_t); typedef void* (*pFppLL_t)(void*, void*, uintptr_t, uintptr_t); +typedef uintptr_t (*LFpbp_Lp_t)(void*, struct_p_t*, uintptr_t, void*); typedef int32_t (*iFEpprLL__t)(x64emu_t*, void*, void*, struct_LL_t*); typedef uintptr_t (*LFpLpriiiiiiiiilt__t)(void*, uintptr_t, void*, struct_iiiiiiiiilt_t*); typedef void (*vFEpLLp_t)(x64emu_t*, void*, uintptr_t, uintptr_t, void*); +typedef int32_t (*iFEpupV_t)(x64emu_t*, void*, uint32_t, void*, void*); +typedef int32_t (*iFEpLpV_t)(x64emu_t*, void*, uintptr_t, void*, void*); typedef int32_t (*iFEppiV_t)(x64emu_t*, void*, void*, int32_t, void*); typedef int32_t (*iFEpppi_t)(x64emu_t*, void*, void*, void*, int32_t); typedef int32_t (*iFEpppp_t)(x64emu_t*, void*, void*, void*, void*); typedef int32_t (*iFiiipu_t)(int32_t, int32_t, int32_t, void*, uint32_t); typedef int32_t (*iFiLLLL_t)(int32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); typedef int32_t (*iFpppup_t)(void*, void*, void*, uint32_t, void*); +typedef uintptr_t (*LFpLppa_t)(void*, uintptr_t, void*, void*, void*); typedef int32_t (*iFEBh_ppp_t)(x64emu_t*, struct_h_t*, void*, void*, void*); +typedef uintptr_t (*LFpbp_LLp_t)(void*, struct_p_t*, uintptr_t, uintptr_t, void*); +typedef uintptr_t (*LFpBp_LLp_t)(void*, struct_p_t*, uintptr_t, uintptr_t, void*); +typedef uintptr_t (*LFLbp_bL_Bp_BL__t)(uintptr_t, struct_p_t*, struct_L_t*, struct_p_t*, struct_L_t*); +typedef uintptr_t (*LFpLpriiiiiiiiilt_a_t)(void*, uintptr_t, void*, struct_iiiiiiiiilt_t*, void*); typedef int32_t (*iFEpippp_t)(x64emu_t*, void*, int32_t, void*, void*, void*); typedef int32_t (*iFEpuppp_t)(x64emu_t*, void*, uint32_t, void*, void*, void*); typedef int32_t (*iFEpLppp_t)(x64emu_t*, void*, uintptr_t, void*, void*, void*); @@ -283,12 +305,14 @@ typedef void (*vFEpppp_t)(x64emu_t*, void*, void*, void*, void*); typedef long double (*DFD_t)(long double); typedef long double (*DFDD_t)(long double, long double); typedef long double (*DFDp_t)(long double, void*); +typedef long double (*DFpBp_a_t)(void*, struct_p_t*, void*); #endif #if !defined(HAVE_LD80BITS) typedef double (*KFK_t)(double); typedef double (*KFKK_t)(double, double); typedef double (*KFKp_t)(double, void*); +typedef double (*KFpBp_a_t)(void*, struct_p_t*, void*); #endif void vFv_32(x64emu_t *emu, uintptr_t fcn) { vFv_t fn = (vFv_t)fcn; fn(); } @@ -309,6 +333,7 @@ void iFh_32(x64emu_t *emu, uintptr_t fcn) { iFh_t fn = (iFh_t)fcn; R_EAX = fn(fr void iFH_32(x64emu_t *emu, uintptr_t fcn) { iFH_t fn = (iFH_t)fcn; R_EAX = fn(from_hash_d(from_ptri(ptr_t, R_ESP + 4))); } void IFf_32(x64emu_t *emu, uintptr_t fcn) { IFf_t fn = (IFf_t)fcn; ui64_t r; r.i = fn(from_ptri(float, R_ESP + 4)); R_EAX = r.d[0]; R_EDX = r.d[1]; } void IFd_32(x64emu_t *emu, uintptr_t fcn) { IFd_t fn = (IFd_t)fcn; ui64_t r; r.i = fn(from_ptri(double, R_ESP + 4)); R_EAX = r.d[0]; R_EDX = r.d[1]; } +void IFh_32(x64emu_t *emu, uintptr_t fcn) { IFh_t fn = (IFh_t)fcn; ui64_t r; r.i = fn(from_hash(from_ptri(ptr_t, R_ESP + 4))); R_EAX = r.d[0]; R_EDX = r.d[1]; } void uFv_32(x64emu_t *emu, uintptr_t fcn) { uFv_t fn = (uFv_t)fcn; R_EAX = (uint32_t)fn(); } void uFu_32(x64emu_t *emu, uintptr_t fcn) { uFu_t fn = (uFu_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4)); } void uFU_32(x64emu_t *emu, uintptr_t fcn) { uFU_t fn = (uFU_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint64_t, R_ESP + 4)); } @@ -318,6 +343,7 @@ void dFv_32(x64emu_t *emu, uintptr_t fcn) { dFv_t fn = (dFv_t)fcn; double db = f void dFd_32(x64emu_t *emu, uintptr_t fcn) { dFd_t fn = (dFd_t)fcn; double db = fn(from_ptri(double, R_ESP + 4)); fpu_do_push(emu); ST0val = db; } void lFi_32(x64emu_t *emu, uintptr_t fcn) { lFi_t fn = (lFi_t)fcn; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4))); } void lFp_32(x64emu_t *emu, uintptr_t fcn) { lFp_t fn = (lFp_t)fcn; R_EAX = to_long(fn(from_ptriv(R_ESP + 4))); } +void lFh_32(x64emu_t *emu, uintptr_t fcn) { lFh_t fn = (lFh_t)fcn; R_EAX = to_long(fn(from_hash(from_ptri(ptr_t, R_ESP + 4)))); } void LFv_32(x64emu_t *emu, uintptr_t fcn) { LFv_t fn = (LFv_t)fcn; R_EAX = to_ulong(fn()); } void LFL_32(x64emu_t *emu, uintptr_t fcn) { LFL_t fn = (LFL_t)fcn; R_EAX = to_ulong(fn(to_ulong(from_ptri(ulong_t, R_ESP + 4)))); } void LFp_32(x64emu_t *emu, uintptr_t fcn) { LFp_t fn = (LFp_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4))); } @@ -346,6 +372,7 @@ void iFiI_32(x64emu_t *emu, uintptr_t fcn) { iFiI_t fn = (iFiI_t)fcn; R_EAX = fn void iFiu_32(x64emu_t *emu, uintptr_t fcn) { iFiu_t fn = (iFiu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); } void iFip_32(x64emu_t *emu, uintptr_t fcn) { iFip_t fn = (iFip_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); } void iFih_32(x64emu_t *emu, uintptr_t fcn) { iFih_t fn = (iFih_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_hash(from_ptri(ptr_t, R_ESP + 8))); } +void iFia_32(x64emu_t *emu, uintptr_t fcn) { iFia_t fn = (iFia_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_locale(from_ptri(ptr_t, R_ESP + 8))); } void iFuu_32(x64emu_t *emu, uintptr_t fcn) { iFuu_t fn = (iFuu_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); } void iFup_32(x64emu_t *emu, uintptr_t fcn) { iFup_t fn = (iFup_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); } void iFli_32(x64emu_t *emu, uintptr_t fcn) { iFli_t fn = (iFli_t)fcn; R_EAX = fn(to_long(from_ptri(long_t, R_ESP + 4)), from_ptri(int32_t, R_ESP + 8)); } @@ -377,6 +404,7 @@ void LFpL_32(x64emu_t *emu, uintptr_t fcn) { LFpL_t fn = (LFpL_t)fcn; R_EAX = to void LFpp_32(x64emu_t *emu, uintptr_t fcn) { LFpp_t fn = (LFpp_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8))); } void pFEv_32(x64emu_t *emu, uintptr_t fcn) { pFEv_t fn = (pFEv_t)fcn; R_EAX = to_ptrv(fn(emu)); } void pFEp_32(x64emu_t *emu, uintptr_t fcn) { pFEp_t fn = (pFEp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4))); } +void pFia_32(x64emu_t *emu, uintptr_t fcn) { pFia_t fn = (pFia_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_locale(from_ptri(ptr_t, R_ESP + 8)))); } void pFLL_32(x64emu_t *emu, uintptr_t fcn) { pFLL_t fn = (pFLL_t)fcn; R_EAX = to_ptrv(fn(to_ulong(from_ptri(ulong_t, R_ESP + 4)), to_ulong(from_ptri(ulong_t, R_ESP + 8)))); } void pFpi_32(x64emu_t *emu, uintptr_t fcn) { pFpi_t fn = (pFpi_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8))); } void pFpL_32(x64emu_t *emu, uintptr_t fcn) { pFpL_t fn = (pFpL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)))); } @@ -427,20 +455,27 @@ void iFpLL_32(x64emu_t *emu, uintptr_t fcn) { iFpLL_t fn = (iFpLL_t)fcn; R_EAX = void iFppu_32(x64emu_t *emu, uintptr_t fcn) { iFppu_t fn = (iFppu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } void iFppL_32(x64emu_t *emu, uintptr_t fcn) { iFppL_t fn = (iFppL_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12))); } void iFppp_32(x64emu_t *emu, uintptr_t fcn) { iFppp_t fn = (iFppp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iFppa_32(x64emu_t *emu, uintptr_t fcn) { iFppa_t fn = (iFppa_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_locale(from_ptri(ptr_t, R_ESP + 12))); } void iFpOu_32(x64emu_t *emu, uintptr_t fcn) { iFpOu_t fn = (iFpOu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), of_convert32(from_ptri(int32_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12)); } +void iFhIi_32(x64emu_t *emu, uintptr_t fcn) { iFhIi_t fn = (iFhIi_t)fcn; R_EAX = fn(from_hash(from_ptri(ptr_t, R_ESP + 4)), from_ptri(int64_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 16)); } +void iFhli_32(x64emu_t *emu, uintptr_t fcn) { iFhli_t fn = (iFhli_t)fcn; R_EAX = fn(from_hash(from_ptri(ptr_t, R_ESP + 4)), to_long(from_ptri(long_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12)); } void iFhpL_32(x64emu_t *emu, uintptr_t fcn) { iFhpL_t fn = (iFhpL_t)fcn; R_EAX = fn(from_hash(from_ptri(ptr_t, R_ESP + 4)), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12))); } void IFiIi_32(x64emu_t *emu, uintptr_t fcn) { IFiIi_t fn = (IFiIi_t)fcn; ui64_t r; r.i = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int64_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 16)); R_EAX = r.d[0]; R_EDX = r.d[1]; } void fFfff_32(x64emu_t *emu, uintptr_t fcn) { fFfff_t fn = (fFfff_t)fcn; float fl = fn(from_ptri(float, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptri(float, R_ESP + 12)); fpu_do_push(emu); ST0val = fl; } void fFffp_32(x64emu_t *emu, uintptr_t fcn) { fFffp_t fn = (fFffp_t)fcn; float fl = fn(from_ptri(float, R_ESP + 4), from_ptri(float, R_ESP + 8), from_ptriv(R_ESP + 12)); fpu_do_push(emu); ST0val = fl; } +void fFppa_32(x64emu_t *emu, uintptr_t fcn) { fFppa_t fn = (fFppa_t)fcn; float fl = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_locale(from_ptri(ptr_t, R_ESP + 12))); fpu_do_push(emu); ST0val = fl; } void dFddd_32(x64emu_t *emu, uintptr_t fcn) { dFddd_t fn = (dFddd_t)fcn; double db = fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12), from_ptri(double, R_ESP + 20)); fpu_do_push(emu); ST0val = db; } void dFddp_32(x64emu_t *emu, uintptr_t fcn) { dFddp_t fn = (dFddp_t)fcn; double db = fn(from_ptri(double, R_ESP + 4), from_ptri(double, R_ESP + 12), from_ptriv(R_ESP + 20)); fpu_do_push(emu); ST0val = db; } +void dFppa_32(x64emu_t *emu, uintptr_t fcn) { dFppa_t fn = (dFppa_t)fcn; double db = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_locale(from_ptri(ptr_t, R_ESP + 12))); fpu_do_push(emu); ST0val = db; } void lFipL_32(x64emu_t *emu, uintptr_t fcn) { lFipL_t fn = (lFipL_t)fcn; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)))); } void lFlpi_32(x64emu_t *emu, uintptr_t fcn) { lFlpi_t fn = (lFlpi_t)fcn; R_EAX = to_long(fn(to_long(from_ptri(long_t, R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void LFpip_32(x64emu_t *emu, uintptr_t fcn) { LFpip_t fn = (LFpip_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12))); } void pFEip_32(x64emu_t *emu, uintptr_t fcn) { pFEip_t fn = (pFEip_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8))); } void pFEpi_32(x64emu_t *emu, uintptr_t fcn) { pFEpi_t fn = (pFEpi_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8))); } void pFEpp_32(x64emu_t *emu, uintptr_t fcn) { pFEpp_t fn = (pFEpp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8))); } void pFpiL_32(x64emu_t *emu, uintptr_t fcn) { pFpiL_t fn = (pFpiL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)))); } void pFpih_32(x64emu_t *emu, uintptr_t fcn) { pFpih_t fn = (pFpih_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_hash(from_ptri(ptr_t, R_ESP + 12)))); } +void pFpuL_32(x64emu_t *emu, uintptr_t fcn) { pFpuL_t fn = (pFpuL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)))); } void pFppL_32(x64emu_t *emu, uintptr_t fcn) { pFppL_t fn = (pFppL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)))); } void pFpOM_32(x64emu_t *emu, uintptr_t fcn) { pFpOM_t fn = (pFpOM_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), of_convert32(from_ptri(int32_t, R_ESP + 8)), from_ptriv(R_ESP + 12),from_ptriv(R_ESP + 12 + 4))); } void hFEpp_32(x64emu_t *emu, uintptr_t fcn) { hFEpp_t fn = (hFEpp_t)fcn; R_EAX = to_hash(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8))); } @@ -448,6 +483,7 @@ void hFppH_32(x64emu_t *emu, uintptr_t fcn) { hFppH_t fn = (hFppH_t)fcn; R_EAX = void aFipa_32(x64emu_t *emu, uintptr_t fcn) { aFipa_t fn = (aFipa_t)fcn; R_EAX = to_locale(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_locale(from_ptri(ptr_t, R_ESP + 12)))); } void tFipu_32(x64emu_t *emu, uintptr_t fcn) { tFipu_t fn = (tFipu_t)fcn; R_EAX = to_cstring(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12))); } void IFpBp_i_32(x64emu_t *emu, uintptr_t fcn) { IFpBp_i_t fn = (IFpBp_i_t)fcn; struct_p_t arg_8; 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)); 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); } +void UFpBp_i_32(x64emu_t *emu, uintptr_t fcn) { UFpBp_i_t fn = (UFpBp_i_t)fcn; struct_p_t arg_8; 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)); 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); } void lFpBp_i_32(x64emu_t *emu, uintptr_t fcn) { lFpBp_i_t fn = (lFpBp_i_t)fcn; struct_p_t arg_8; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } void vFEipV_32(x64emu_t *emu, uintptr_t fcn) { vFEipV_t fn = (vFEipV_t)fcn; fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptrv(R_ESP + 12)); } void vFEppp_32(x64emu_t *emu, uintptr_t fcn) { vFEppp_t fn = (vFEppp_t)fcn; fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); } @@ -472,20 +508,30 @@ void iFuupi_32(x64emu_t *emu, uintptr_t fcn) { iFuupi_t fn = (iFuupi_t)fcn; R_EA void iFhpiL_32(x64emu_t *emu, uintptr_t fcn) { iFhpiL_t fn = (iFhpiL_t)fcn; R_EAX = fn(from_hash(from_ptri(ptr_t, R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), to_ulong(from_ptri(ulong_t, R_ESP + 16))); } void lFipLi_32(x64emu_t *emu, uintptr_t fcn) { lFipLi_t fn = (lFipLi_t)fcn; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16))); } void LFpLLh_32(x64emu_t *emu, uintptr_t fcn) { LFpLLh_t fn = (LFpLLh_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), to_ulong(from_ptri(ulong_t, R_ESP + 12)), from_hash(from_ptri(ptr_t, R_ESP + 16)))); } +void LFppLp_32(x64emu_t *emu, uintptr_t fcn) { LFppLp_t fn = (LFppLp_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16))); } +void LFppLa_32(x64emu_t *emu, uintptr_t fcn) { LFppLa_t fn = (LFppLa_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)), from_locale(from_ptri(ptr_t, R_ESP + 16)))); } void pFEppi_32(x64emu_t *emu, uintptr_t fcn) { pFEppi_t fn = (pFEppi_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } void pFEppp_32(x64emu_t *emu, uintptr_t fcn) { pFEppp_t fn = (pFEppp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); } void pFpiLL_32(x64emu_t *emu, uintptr_t fcn) { pFpiLL_t fn = (pFpiLL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)), to_ulong(from_ptri(ulong_t, R_ESP + 16)))); } void pFppLL_32(x64emu_t *emu, uintptr_t fcn) { pFppLL_t fn = (pFppLL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)), to_ulong(from_ptri(ulong_t, R_ESP + 16)))); } +void LFpbp_Lp_32(x64emu_t *emu, uintptr_t fcn) { LFpbp_Lp_t fn = (LFpbp_Lp_t)fcn; struct_p_t arg_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, to_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); } void iFEpprLL__32(x64emu_t *emu, uintptr_t fcn) { iFEpprLL__t fn = (iFEpprLL__t)fcn; struct_LL_t arg_12; from_struct_LL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); } void LFpLpriiiiiiiiilt__32(x64emu_t *emu, uintptr_t fcn) { LFpLpriiiiiiiiilt__t fn = (LFpLpriiiiiiiiilt__t)fcn; struct_iiiiiiiiilt_t arg_16; from_struct_iiiiiiiiilt(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL)); } void vFEpLLp_32(x64emu_t *emu, uintptr_t fcn) { vFEpLLp_t fn = (vFEpLLp_t)fcn; fn(emu, from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), to_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16)); } +void iFEpupV_32(x64emu_t *emu, uintptr_t fcn) { iFEpupV_t fn = (iFEpupV_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptrv(R_ESP + 16)); } +void iFEpLpV_32(x64emu_t *emu, uintptr_t fcn) { iFEpLpV_t fn = (iFEpLpV_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptrv(R_ESP + 16)); } void iFEppiV_32(x64emu_t *emu, uintptr_t fcn) { iFEppiV_t fn = (iFEppiV_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptrv(R_ESP + 16)); } void iFEpppi_32(x64emu_t *emu, uintptr_t fcn) { iFEpppi_t fn = (iFEpppi_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } void iFEpppp_32(x64emu_t *emu, uintptr_t fcn) { iFEpppp_t fn = (iFEpppp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } void iFiiipu_32(x64emu_t *emu, uintptr_t fcn) { iFiiipu_t fn = (iFiiipu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } 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), to_ulong(from_ptri(ulong_t, R_ESP + 8)), to_ulong(from_ptri(ulong_t, R_ESP + 12)), to_ulong(from_ptri(ulong_t, R_ESP + 16)), to_ulong(from_ptri(ulong_t, R_ESP + 20))); } void iFpppup_32(x64emu_t *emu, uintptr_t fcn) { iFpppup_t fn = (iFpppup_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void LFpLppa_32(x64emu_t *emu, uintptr_t fcn) { LFpLppa_t fn = (LFpLppa_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_locale(from_ptri(ptr_t, R_ESP + 20)))); } void iFEBh_ppp_32(x64emu_t *emu, uintptr_t fcn) { iFEBh_ppp_t fn = (iFEBh_ppp_t)fcn; struct_h_t arg_4; R_EAX = fn(emu, *(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_h(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } +void LFpbp_LLp_32(x64emu_t *emu, uintptr_t fcn) { LFpbp_LLp_t fn = (LFpbp_LLp_t)fcn; struct_p_t arg_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, to_ulong(from_ptri(ulong_t, R_ESP + 12)), to_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void LFpBp_LLp_32(x64emu_t *emu, uintptr_t fcn) { LFpBp_LLp_t fn = (LFpBp_LLp_t)fcn; struct_p_t arg_8; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, to_ulong(from_ptri(ulong_t, R_ESP + 12)), to_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } +void LFLbp_bL_Bp_BL__32(x64emu_t *emu, uintptr_t fcn) { LFLbp_bL_Bp_BL__t fn = (LFLbp_bL_Bp_BL__t)fcn; struct_p_t arg_8; from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_L_t arg_12; from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_p_t arg_16; struct_L_t arg_20; R_EAX = to_ulong(fn(to_ulong(from_ptri(ulong_t, R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } +void LFpLpriiiiiiiiilt_a_32(x64emu_t *emu, uintptr_t fcn) { LFpLpriiiiiiiiilt_a_t fn = (LFpLpriiiiiiiiilt_a_t)fcn; struct_iiiiiiiiilt_t arg_16; from_struct_iiiiiiiiilt(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_locale(from_ptri(ptr_t, R_ESP + 20)))); } void iFEpippp_32(x64emu_t *emu, uintptr_t fcn) { iFEpippp_t fn = (iFEpippp_t)fcn; R_EAX = fn(emu, 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)); } void iFEpuppp_32(x64emu_t *emu, uintptr_t fcn) { iFEpuppp_t fn = (iFEpuppp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } void iFEpLppp_32(x64emu_t *emu, uintptr_t fcn) { iFEpLppp_t fn = (iFEpLppp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } @@ -502,12 +548,14 @@ void vFEpppp_32(x64emu_t *emu, uintptr_t fcn) { vFEpppp_t fn = (vFEpppp_t)fcn; f void DFD_32(x64emu_t *emu, uintptr_t fcn) { DFD_t fn = (DFD_t)fcn; long double ld = fn(LD2localLD(from_ptrv(R_ESP + 4))); fpu_do_push(emu); ST0val = ld; } void DFDD_32(x64emu_t *emu, uintptr_t fcn) { DFDD_t fn = (DFDD_t)fcn; long double ld = fn(LD2localLD(from_ptrv(R_ESP + 4)), LD2localLD(from_ptrv(R_ESP + 16))); fpu_do_push(emu); ST0val = ld; } void DFDp_32(x64emu_t *emu, uintptr_t fcn) { DFDp_t fn = (DFDp_t)fcn; long double ld = fn(LD2localLD(from_ptrv(R_ESP + 4)), from_ptriv(R_ESP + 16)); fpu_do_push(emu); ST0val = ld; } +void DFpBp_a_32(x64emu_t *emu, uintptr_t fcn) { DFpBp_a_t fn = (DFpBp_a_t)fcn; struct_p_t arg_8; long double ld = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_locale(from_ptri(ptr_t, R_ESP + 12))); fpu_do_push(emu); ST0val = ld; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } #endif #if !defined(HAVE_LD80BITS) void KFK_32(x64emu_t *emu, uintptr_t fcn) { KFK_t fn = (KFK_t)fcn; double db = fn(FromLD(from_ptrv(R_ESP + 4))); fpu_do_push(emu); ST0val = db; } void KFKK_32(x64emu_t *emu, uintptr_t fcn) { KFKK_t fn = (KFKK_t)fcn; double db = fn(FromLD(from_ptrv(R_ESP + 4)), FromLD(from_ptrv(R_ESP + 16))); fpu_do_push(emu); ST0val = db; } void KFKp_32(x64emu_t *emu, uintptr_t fcn) { KFKp_t fn = (KFKp_t)fcn; double db = fn(FromLD(from_ptrv(R_ESP + 4)), from_ptriv(R_ESP + 16)); fpu_do_push(emu); ST0val = db; } +void KFpBp_a_32(x64emu_t *emu, uintptr_t fcn) { KFpBp_a_t fn = (KFpBp_a_t)fcn; struct_p_t arg_8; double db = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_locale(from_ptri(ptr_t, R_ESP + 12))); fpu_do_push(emu); ST0val = db; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } #endif void iFEvpV_32(x64emu_t *emu, uintptr_t fcn) { iFEpV_t fn = (iFEpV_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 8), from_ptrv(R_ESP + 12)); } @@ -536,17 +584,21 @@ int isRetX87Wrapper32(wrapper_t fun) { if (fun == &dFpBp__32) return 1; if (fun == &fFfff_32) return 1; if (fun == &fFffp_32) return 1; + if (fun == &fFppa_32) return 1; if (fun == &dFddd_32) return 1; if (fun == &dFddp_32) return 1; + if (fun == &dFppa_32) return 1; #if defined(HAVE_LD80BITS) if (fun == &DFD_32) return 1; if (fun == &DFDD_32) return 1; if (fun == &DFDp_32) return 1; + if (fun == &DFpBp_a_32) return 1; #endif #if !defined(HAVE_LD80BITS) if (fun == &KFK_32) return 1; if (fun == &KFKK_32) return 1; if (fun == &KFKp_32) return 1; + if (fun == &KFpBp_a_32) return 1; #endif return 0; } diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h index 00d4c7ff..170ca677 100644 --- a/src/wrapped32/generated/wrapper32.h +++ b/src/wrapped32/generated/wrapper32.h @@ -56,6 +56,7 @@ void iFh_32(x64emu_t *emu, uintptr_t fnc); void iFH_32(x64emu_t *emu, uintptr_t fnc); void IFf_32(x64emu_t *emu, uintptr_t fnc); void IFd_32(x64emu_t *emu, uintptr_t fnc); +void IFh_32(x64emu_t *emu, uintptr_t fnc); void uFv_32(x64emu_t *emu, uintptr_t fnc); void uFu_32(x64emu_t *emu, uintptr_t fnc); void uFU_32(x64emu_t *emu, uintptr_t fnc); @@ -65,6 +66,7 @@ void dFv_32(x64emu_t *emu, uintptr_t fnc); void dFd_32(x64emu_t *emu, uintptr_t fnc); void lFi_32(x64emu_t *emu, uintptr_t fnc); void lFp_32(x64emu_t *emu, uintptr_t fnc); +void lFh_32(x64emu_t *emu, uintptr_t fnc); void LFv_32(x64emu_t *emu, uintptr_t fnc); void LFL_32(x64emu_t *emu, uintptr_t fnc); void LFp_32(x64emu_t *emu, uintptr_t fnc); @@ -93,6 +95,7 @@ void iFiI_32(x64emu_t *emu, uintptr_t fnc); void iFiu_32(x64emu_t *emu, uintptr_t fnc); void iFip_32(x64emu_t *emu, uintptr_t fnc); void iFih_32(x64emu_t *emu, uintptr_t fnc); +void iFia_32(x64emu_t *emu, uintptr_t fnc); void iFuu_32(x64emu_t *emu, uintptr_t fnc); void iFup_32(x64emu_t *emu, uintptr_t fnc); void iFli_32(x64emu_t *emu, uintptr_t fnc); @@ -124,6 +127,7 @@ void LFpL_32(x64emu_t *emu, uintptr_t fnc); void LFpp_32(x64emu_t *emu, uintptr_t fnc); void pFEv_32(x64emu_t *emu, uintptr_t fnc); void pFEp_32(x64emu_t *emu, uintptr_t fnc); +void pFia_32(x64emu_t *emu, uintptr_t fnc); void pFLL_32(x64emu_t *emu, uintptr_t fnc); void pFpi_32(x64emu_t *emu, uintptr_t fnc); void pFpL_32(x64emu_t *emu, uintptr_t fnc); @@ -174,20 +178,27 @@ void iFpLL_32(x64emu_t *emu, uintptr_t fnc); void iFppu_32(x64emu_t *emu, uintptr_t fnc); void iFppL_32(x64emu_t *emu, uintptr_t fnc); void iFppp_32(x64emu_t *emu, uintptr_t fnc); +void iFppa_32(x64emu_t *emu, uintptr_t fnc); void iFpOu_32(x64emu_t *emu, uintptr_t fnc); +void iFhIi_32(x64emu_t *emu, uintptr_t fnc); +void iFhli_32(x64emu_t *emu, uintptr_t fnc); void iFhpL_32(x64emu_t *emu, uintptr_t fnc); void IFiIi_32(x64emu_t *emu, uintptr_t fnc); void fFfff_32(x64emu_t *emu, uintptr_t fnc); void fFffp_32(x64emu_t *emu, uintptr_t fnc); +void fFppa_32(x64emu_t *emu, uintptr_t fnc); void dFddd_32(x64emu_t *emu, uintptr_t fnc); void dFddp_32(x64emu_t *emu, uintptr_t fnc); +void dFppa_32(x64emu_t *emu, uintptr_t fnc); void lFipL_32(x64emu_t *emu, uintptr_t fnc); void lFlpi_32(x64emu_t *emu, uintptr_t fnc); +void LFpip_32(x64emu_t *emu, uintptr_t fnc); void pFEip_32(x64emu_t *emu, uintptr_t fnc); void pFEpi_32(x64emu_t *emu, uintptr_t fnc); void pFEpp_32(x64emu_t *emu, uintptr_t fnc); void pFpiL_32(x64emu_t *emu, uintptr_t fnc); void pFpih_32(x64emu_t *emu, uintptr_t fnc); +void pFpuL_32(x64emu_t *emu, uintptr_t fnc); void pFppL_32(x64emu_t *emu, uintptr_t fnc); void pFpOM_32(x64emu_t *emu, uintptr_t fnc); void hFEpp_32(x64emu_t *emu, uintptr_t fnc); @@ -195,6 +206,7 @@ void hFppH_32(x64emu_t *emu, uintptr_t fnc); void aFipa_32(x64emu_t *emu, uintptr_t fnc); void tFipu_32(x64emu_t *emu, uintptr_t fnc); void IFpBp_i_32(x64emu_t *emu, uintptr_t fnc); +void UFpBp_i_32(x64emu_t *emu, uintptr_t fnc); void lFpBp_i_32(x64emu_t *emu, uintptr_t fnc); void vFEipV_32(x64emu_t *emu, uintptr_t fnc); void vFEppp_32(x64emu_t *emu, uintptr_t fnc); @@ -219,20 +231,30 @@ void iFuupi_32(x64emu_t *emu, uintptr_t fnc); void iFhpiL_32(x64emu_t *emu, uintptr_t fnc); void lFipLi_32(x64emu_t *emu, uintptr_t fnc); void LFpLLh_32(x64emu_t *emu, uintptr_t fnc); +void LFppLp_32(x64emu_t *emu, uintptr_t fnc); +void LFppLa_32(x64emu_t *emu, uintptr_t fnc); void pFEppi_32(x64emu_t *emu, uintptr_t fnc); void pFEppp_32(x64emu_t *emu, uintptr_t fnc); void pFpiLL_32(x64emu_t *emu, uintptr_t fnc); void pFppLL_32(x64emu_t *emu, uintptr_t fnc); +void LFpbp_Lp_32(x64emu_t *emu, uintptr_t fnc); void iFEpprLL__32(x64emu_t *emu, uintptr_t fnc); void LFpLpriiiiiiiiilt__32(x64emu_t *emu, uintptr_t fnc); void vFEpLLp_32(x64emu_t *emu, uintptr_t fnc); +void iFEpupV_32(x64emu_t *emu, uintptr_t fnc); +void iFEpLpV_32(x64emu_t *emu, uintptr_t fnc); void iFEppiV_32(x64emu_t *emu, uintptr_t fnc); void iFEpppi_32(x64emu_t *emu, uintptr_t fnc); void iFEpppp_32(x64emu_t *emu, uintptr_t fnc); void iFiiipu_32(x64emu_t *emu, uintptr_t fnc); void iFiLLLL_32(x64emu_t *emu, uintptr_t fnc); void iFpppup_32(x64emu_t *emu, uintptr_t fnc); +void LFpLppa_32(x64emu_t *emu, uintptr_t fnc); void iFEBh_ppp_32(x64emu_t *emu, uintptr_t fnc); +void LFpbp_LLp_32(x64emu_t *emu, uintptr_t fnc); +void LFpBp_LLp_32(x64emu_t *emu, uintptr_t fnc); +void LFLbp_bL_Bp_BL__32(x64emu_t *emu, uintptr_t fnc); +void LFpLpriiiiiiiiilt_a_32(x64emu_t *emu, uintptr_t fnc); void iFEpippp_32(x64emu_t *emu, uintptr_t fnc); void iFEpuppp_32(x64emu_t *emu, uintptr_t fnc); void iFEpLppp_32(x64emu_t *emu, uintptr_t fnc); @@ -249,12 +271,14 @@ void vFEpppp_32(x64emu_t *emu, uintptr_t fnc); void DFD_32(x64emu_t *emu, uintptr_t fnc); void DFDD_32(x64emu_t *emu, uintptr_t fnc); void DFDp_32(x64emu_t *emu, uintptr_t fnc); +void DFpBp_a_32(x64emu_t *emu, uintptr_t fnc); #endif #if !defined(HAVE_LD80BITS) void KFK_32(x64emu_t *emu, uintptr_t fnc); void KFKK_32(x64emu_t *emu, uintptr_t fnc); void KFKp_32(x64emu_t *emu, uintptr_t fnc); +void KFpBp_a_32(x64emu_t *emu, uintptr_t fnc); #endif void iFEvpV_32(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped32/wrappedlibc.c b/src/wrapped32/wrappedlibc.c index d9aac79d..52a8c408 100755 --- a/src/wrapped32/wrappedlibc.c +++ b/src/wrapped32/wrappedlibc.c @@ -798,20 +798,14 @@ EXPORT void *my32_div(void *result, int numerator, int denominator) { *(div_t *)result = div(numerator, denominator); return result; } - +#endif EXPORT int my32_snprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, void * b) { - #ifndef NOALIGN // need to align on arm myStackAlign32((const char*)fmt, b, emu->scratch); PREPARE_VALIST_32; - void* f = vsnprintf; - return ((iFpLpp_t)f)(buff, s, fmt, VARARGS_32); - #else - return vsnprintf((char*)buff, s, (char*)fmt, b); - #endif + return vsnprintf(buff, s, fmt, VARARGS_32); } EXPORT int my32___snprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, void * b) __attribute__((alias("my32_snprintf"))); -#endif EXPORT int my32___snprintf_chk(x64emu_t* emu, void* buff, size_t s, int f1, int f2, void * fmt, void * b) { (void)f1; (void)f2; @@ -946,22 +940,16 @@ EXPORT int my32___asprintf_chk(x64emu_t* emu, void* result_ptr, int flags, void* return vasprintf((char**)result_ptr, (char*)fmt, b); #endif } - +#endif EXPORT int my32_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); + myStackAlignW32((const char*)fmt, (uint32_t*)b, emu->scratch); PREPARE_VALIST_32; - void* f = vswprintf; - int r = ((iFpupp_t)f)(buff, s, fmt, VARARGS_32); - return r; - #else - void* f = vswprintf; - int r = ((iFpupp_t)f)(buff, s, fmt, (uint32_t*)b); + int r = vswprintf(buff, s, fmt, VARARGS_32); return r; - #endif } EXPORT int my32___vswprintf(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void * b, va_list V) __attribute__((alias("my32_vswprintf"))); +#if 0 EXPORT int my32___vswprintf_chk(x64emu_t* emu, void* buff, size_t s, int flags, size_t m, void * fmt, void * b, va_list V) { #ifndef NOALIGN // need to align on arm @@ -976,7 +964,18 @@ EXPORT int my32___vswprintf_chk(x64emu_t* emu, void* buff, size_t s, int flags, return r; #endif } +#endif +EXPORT int my32_vswscanf(x64emu_t* emu, void* buff, void* fmt, void* b) +{ + myStackAlignScanfW32((const char*)fmt, (uint32_t*)b, emu->scratch); + PREPARE_VALIST_32; + vswscanf(buff, fmt, VARARGS_32); +} + +EXPORT int my32__vswscanf(x64emu_t* emu, void* buff, void* fmt, void* b) __attribute__((alias("my32_vswscanf"))); +EXPORT int my32_swscanf(x64emu_t* emu, void* buff, void* fmt, void* b) __attribute__((alias("my32_vswscanf"))); +#if 0 EXPORT void my32_verr(x64emu_t* emu, int eval, void* fmt, void* b) { #ifndef NOALIGN myStackAlignW((const char*)fmt, (uint32_t*)b, emu->scratch); @@ -1015,21 +1014,15 @@ EXPORT int my32___swprintf_chk(x64emu_t* emu, void* s, uint32_t n, int32_t flag, return r; #endif } +#endif EXPORT int my32_swprintf(x64emu_t* emu, void* s, uint32_t n, void* fmt, void *b) { - #ifndef NOALIGN - myStackAlignW((const char*)fmt, b, emu->scratch); + myStackAlignW32((const char*)fmt, b, emu->scratch); PREPARE_VALIST_32; - void* f = vswprintf; - int r = ((iFpupp_t)f)(s, n, fmt, VARARGS_32); + int r = vswprintf(s, n, fmt, VARARGS_32); return r; - #else - void* f = vswprintf; - int r = ((iFpupp_t)f)(s, n, fmt, b); - return r; - #endif } - +#if 0 EXPORT void my32__ITM_addUserCommitAction(x64emu_t* emu, void* cb, uint32_t b, void* c) { // disabled for now... Are all this _ITM_ stuff really mendatory? @@ -2427,6 +2420,18 @@ EXPORT void* my32___ctype_tolower_loc(x64emu_t* emu) } return &emu->tolower; } +EXPORT void* my32___ctype_toupper_loc(x64emu_t* emu) +{ + const int** src =__ctype_toupper_loc(); + if((uintptr_t)src<0x100000000LL) + return src; + if(src != emu->ref_toupper) { + memcpy(emu->libctoupper, &((*src)[-128]), 384*sizeof(int)); + emu->ref_toupper = src; + emu->toupper = emu->libctoupper+128; + } + return &emu->toupper; +} // Backtrace stuff: TODO in 32bits diff --git a/src/wrapped32/wrappedlibc_private.h b/src/wrapped32/wrappedlibc_private.h index 702d398a..c995d249 100755 --- a/src/wrapped32/wrappedlibc_private.h +++ b/src/wrapped32/wrappedlibc_private.h @@ -101,7 +101,7 @@ GOWM(backtrace_symbols, pFEpi) GOW(bind, iFipu) // bindresvport //GOW(bindtextdomain, pFpp) -//GOW(bind_textdomain_codeset, pFpp) +GOW(bind_textdomain_codeset, pFpp) //GOW(brk, iFp) // __bsd_getpgrp // bsd_signal // Weak @@ -171,11 +171,11 @@ GO(ctime, pFrL_) GO(ctime_r, pFrL_p) //DATAM(__ctype_b, 4) GOM(__ctype_b_loc, pFEv) -//GOW(__ctype_get_mb_cur_max, LFv) +GOW(__ctype_get_mb_cur_max, LFv) //DATAM(__ctype_tolower, 4) GOM(__ctype_tolower_loc, pFEv) //DATAM(__ctype_toupper, 4) -//GO(__ctype_toupper_loc, pFv) +GOM(__ctype_toupper_loc, pFEv) // __curbrk // type B //GO(cuserid, pFp) GOM(__cxa_atexit, iFEppp) //%% @@ -198,8 +198,8 @@ DATAV(daylight, 4) // __default_sa_restorer_v2 // delete_module // des_setparity -//GOW(dgettext, pFpp) -//GO(__dgettext, pFpp) +GOW(dgettext, pFpp) +GO(__dgettext, pFpp) //GO(difftime, dFuu) //GO(dirfd, iFp) //GO(dirname, pFp) @@ -222,7 +222,7 @@ GOW(dup2, iFii) GO(__dup2, iFii) GO(dup3, iFiiO) //GOW(duplocale, pFp) -//GO(__duplocale, pFp) +GO(__duplocale, aFa) // dysize //GOW(eaccess, iFpi) // ecb_crypt @@ -367,7 +367,7 @@ GOM(__fork, iFEv) //%% // __fortify_fail GOW(fpathconf, iFii) //GO(__fpending, uFp) -//GOM(fprintf, iFEppV) //%% +GOM(fprintf, iFEppV) //%% GOM(__fprintf_chk, iFEhvpV) //%% // __fpu_control // type B //GO(__fpurge, vFp) @@ -375,7 +375,7 @@ GOW(fputc, iFih) //GO(fputc_unlocked, iFip) GOW(fputs, iFph) // Weak //GO(fputs_unlocked, iFpp) -//GO(fputwc, iFip) +GO(fputwc, iFih) //GO(fputwc_unlocked, iFip) //GO(fputws, iFpp) //GO(fputws_unlocked, iFpp) @@ -399,8 +399,8 @@ GO(freopen64, hFppH) // frexpl // Weak //GO2(fscanf, iFppV, vfscanf) //GO(fseek, iFpli) -//GO(fseeko, iFpli) -//GO(fseeko64, iFpIi) +GO(fseeko, iFhli) +GO(fseeko64, iFhIi) //GO(__fsetlocking, iFpi) //GO(fsetpos, iFpp) //GO(fsetpos64, iFpp) @@ -411,8 +411,8 @@ GOWM(fstatfs64, iFip) //%%,noE //GOW(fstatvfs64, iFip) // alignment? GOW(fsync, iFi) //GOW(ftell, lFp) -//GO(ftello, lFp) -//GO(ftello64, IFp) +GO(ftello, lFh) +GO(ftello64, IFh) //GO(ftime, iFp) //GO(ftok, iFpi) GOW(ftruncate, iFiu) @@ -453,7 +453,7 @@ GOM(getaddrinfo, iFEpppp) // getaliasent // getaliasent_r // get_avphys_pages // Weak -//GOW(getc, iFp) +GOW(getc, iFh) GOW(getchar, iFv) GO(getchar_unlocked, iFv) GOM(getcontext, iFEp) //%% @@ -605,7 +605,7 @@ GOW(getuid, uFv) // getutxid // getutxline // getw -//GO2(getwc, iFp, fgetwc) +GO2(getwc, iFh, fgetwc) GO(getwchar, iFv) GO(getwchar_unlocked, iFv) //GOW(getwc_unlocked, iFp) @@ -647,10 +647,10 @@ GO(grantpt, iFi) //GO(hstrerror, pFi) GO(htonl, uFu) GO(htons, uFu) -//GO(iconv, LFLpppp) +GO(iconv, LFLbp_bL_Bp_BL_) //GO(iconv_canonicalize, pFp) GO(iconv_close, iFL) -//GO(iconv_open, LFpp) +GO(iconv_open, pFpp) //GO(if_freenameindex, vFp) //GO(if_indextoname, pFup) //GO(if_nameindex, pFv) @@ -1063,12 +1063,12 @@ GOW(mallopt, iFii) // Weak //GO(mblen, iFpL) //GOW(mbrlen, LFpLp) //GO(__mbrlen, LFpLp) -//GOW(mbrtowc, LFppLp) -//GO(__mbrtowc, LFppLp) +GOW(mbrtowc, LFppLp) +GO(__mbrtowc, LFppLp) //GOW(mbsinit, iFp) -//GOW(mbsnrtowcs, LFppLLp) +GOW(mbsnrtowcs, LFpbp_LLp) // __mbsnrtowcs_chk -//GOW(mbsrtowcs, LFppLp) +GOW(mbsrtowcs, LFpbp_Lp) // __mbsrtowcs_chk //GO(mbstowcs, LFppL) // __mbstowcs_chk @@ -1150,7 +1150,7 @@ GO(nice, iFi) // _nl_default_dirname // type R // _nl_domain_bindings // type B //GO(nl_langinfo, pFu) -//GO(__nl_langinfo_l, pFup) +GO(__nl_langinfo_l, pFia) //GOW(nl_langinfo_l, pFup) //DATAB(_nl_msg_cat_cntr, 4) // type B // nrand48 @@ -1301,7 +1301,7 @@ GOW(puts, iFp) //GOW(pututline, pFp) // pututxline // putw -//GO(putwc, iFip) +GO(putwc, iFih) // putwchar GO(putwchar_unlocked, iFi) //GO(putwc_unlocked, iFip) @@ -1571,14 +1571,14 @@ GOW(sigsetmask, iFi) //GOW(sigwait, iFpp) //GOW(sigwaitinfo, iFpp) GOW(sleep, uFu) -//GOM(snprintf, iFEpLpV) //%% +GOM(snprintf, iFEpLpV) //%% GOM(__snprintf_chk, iFEpLiipV) //%% //GOM(__snprintf, iFEpLpV) //%% // sockatmark GOW(socket, iFiii) //GOW(socketpair, iFiiip) //GO(splice, iFipipuu) -//GOM(sprintf, iFEppV) //%% +GOM(sprintf, iFEppV) //%% GOM(__sprintf_chk, iFEpvvpV) //%% // sprofil // Weak GOW(srand, vFu) @@ -1621,7 +1621,7 @@ GO(strchr, pFpi) //GOW(strchrnul, pFpi) GO(strcmp, iFpp) //GO(strcoll, iFpp) -//GO(__strcoll_l, iFppp) +GO(__strcoll_l, iFppa) //GOW(strcoll_l, iFppp) GO(strcpy, pFpp) GO(__strcpy_chk, pFppL) @@ -1641,8 +1641,8 @@ GO(strerror, tFi) // strfmon_l // Weak // strfry GO(strftime, LFpLpriiiiiiiiilt_) -//GO(__strftime_l, LFpLppL) -//GOW(strftime_l, LFpLppL) +GO(__strftime_l, LFpLpriiiiiiiiilt_a) +GOW(strftime_l, LFpLpriiiiiiiiilt_a) GO(strlen, LFp) GOW(strncasecmp, iFppL) // __strncasecmp_l @@ -1674,11 +1674,11 @@ GO(strrchr, pFpi) GO(strstr, pFpp) GO(strtod, dFpBp_) //GO(__strtod_internal, dFppi) -//GO(__strtod_l, dFppp) -//GOW(strtod_l, dFppu) +GO(__strtod_l, dFppa) +GOW(strtod_l, dFppa) GO(strtof, fFpBp_) //GO(__strtof_internal, fFppp) -//GO(__strtof_l, fFppp) +GO(__strtof_l, fFppa) //GOW(strtof_l, fFppu) //GO(strtoimax, IFppi) //GO(strtok, pFpp) @@ -1689,13 +1689,13 @@ GO(strtol, lFpBp_i) #ifdef HAVE_LD80BITS //GO(strtold, DFpp) //GO(__strtold_internal, DFppi) -//GO(__strtold_l, DFppip) -//GOW(strtold_l, DFppu) +GO(__strtold_l, DFpBp_a) +GOW(strtold_l, DFpBp_a) #else //GO(strtold, KFpp) //GO2(__strtold_internal, KFppi, __strtod_internal) -//GO2(__strtold_l, KFppip, __strtod_l) -//GOW2(strtold_l, KFppu, strtod_l) +GO2(__strtold_l, KFpBp_a, __strtod_l) +GOW2(strtold_l, KFpBp_a, strtod_l) #endif //GO(__strtol_internal, lFppi) GO(strtoll, IFpBp_i) @@ -1707,7 +1707,7 @@ GO(strtoll, IFpBp_i) //GOW(strtoq, IFppi) // is that ok? //GO(strtoul, LFppi) //GO(__strtoul_internal, LFppii) -//GO(strtoull, UFppi) +GO(strtoull, UFpBp_i) //GO(__strtoul_l, uFppip) //GOW(strtoul_l, LFppip) //GO(__strtoull_internal, UFppii) @@ -1718,7 +1718,7 @@ GO(strtoll, IFpBp_i) //GOW(strverscmp, iFpp) // __strverscmp //GO(strxfrm, uFppu) -//GO(__strxfrm_l, uFppup) +GO(__strxfrm_l, LFppLa) //GO(strxfrm_l, uFppup) // stty // svcauthdes_stats // type B @@ -1753,9 +1753,9 @@ GO(strtoll, IFpBp_i) GOM(swapcontext, iFEpp) //%% // swapoff // Weak // swapon // Weak -//GOM(swprintf, iFEpupV) //%% +GOM(swprintf, iFEpupV) //%% //GOM(__swprintf_chk, iFEpuiupV) //%% -//GO2(swscanf, iFppV, vswscanf) // swscanf va_list is only pointer, no realign to do +GOM(swscanf, iFEppV) GOW(symlink, iFpp) //GO(symlinkat, iFpip) GO(sync, vFv) @@ -1823,11 +1823,11 @@ GO(toupper, iFi) // __towctrans_l // towctrans_l // Weak GO(towlower, iFi) -//GO(__towlower_l, iFip) -//GOW(towlower_l, iFip) -//GO(towupper, iFi) -//GO(__towupper_l, iFip) -//GOW(towupper_l, iFip) +GO(__towlower_l, iFia) +GOW(towlower_l, iFia) +GO(towupper, iFi) +GO(__towupper_l, iFia) +GOW(towupper_l, iFia) // tr_break //GOW(truncate, iFpu) //GO(truncate64, iFpU) @@ -1849,8 +1849,8 @@ GOW(umask, uFu) //GOW(umount2, iFpi) GOWM(uname, iFp) //%%,noE //GO(__underflow, iFp) -//GOW(ungetc, iFip) -//GO(ungetwc, iFip) +GOW(ungetc, iFih) +GO(ungetwc, iFih) GOW(unlink, iFp) //GO(unlinkat, iFipi) GO(unlockpt, iFi) @@ -1900,9 +1900,9 @@ GOM(__vsnprintf_chk, iFEpuvvppp) //%% //GOM(__vsprintf_chk, iFEpiLpp) //%% //GOM(vsscanf, iFEppp) //%% // __vsscanf // Weak -//GOWM(vswprintf, iFEpuppp) //%% +GOWM(vswprintf, iFEpuppp) //%% //GOWM(__vswprintf_chk, iFEpLiLppp) //%% -//GO(vswscanf, iFppp) +GOM(vswscanf, iFEppp) //GO(vsyslog, vFipp) //GO(__vsyslog_chk, vFiipp) // vtimes @@ -1924,7 +1924,7 @@ GOW(__waitpid, lFlpi) // __wcpcpy_chk //GOW(wcpncpy, pFpp) // __wcpncpy_chk -//GOW(wcrtomb, LFpip) +GOW(wcrtomb, LFpip) // __wcrtomb_chk //GOW(wcscasecmp, iFpp) // __wcscasecmp_l @@ -1933,28 +1933,28 @@ GOW(__waitpid, lFlpi) //GO(__wcscat_chk, pFppu) //GO(wcschr, pFpi) // wcschrnul // Weak -//GO(wcscmp, iFpp) -//GOW(wcscoll, iFpp) -//GO(__wcscoll_l, iFppp) -//GOW(wcscoll_l, iFppp) +GO(wcscmp, iFpp) +GOW(wcscoll, iFpp) +GO(__wcscoll_l, iFppa) +GOW(wcscoll_l, iFppa) GO(wcscpy, pFpp) -//GO(__wcscpy_chk, pFppu) +GO(__wcscpy_chk, pFppL) //GO(wcscspn, uFpp) GO(wcsdup, pFp) //GO(wcsftime, LFpLpp) -//GO(__wcsftime_l, LFpLppp) -//GOW(wcsftime_l, LFpLppp) +GO(__wcsftime_l, LFpLppa) +GOW(wcsftime_l, LFpLppa) GOW(wcslen, LFp) GOW(wcsncasecmp, iFppL) // __wcsncasecmp_l //GOW(wcsncasecmp_l, iFppup) -//GO(wcsncat, pFppu) +GO(wcsncat, pFppL) // __wcsncat_chk -//GO(wcsncmp, iFppu) -//GOW(wcsncpy, pFppu) -//GO(__wcsncpy_chk, pFppuu) -//GOW(wcsnlen, LFpL) -//GOW(wcsnrtombs, LFppLLp) +GO(wcsncmp, iFppL) +GOW(wcsncpy, pFppL) +GO(__wcsncpy_chk, pFppLL) +GOW(wcsnlen, LFpL) +GOW(wcsnrtombs, LFpBp_LLp) // __wcsnrtombs_chk //GO(wcspbrk, pFpp) //GO(wcsrchr, pFpi) @@ -1978,7 +1978,7 @@ GOW(wcsncasecmp, iFppL) // __wcstold_l // wcstold_l // Weak //GO(__wcstol_internal, iFppii) -//GO(wcstoll, IFppi) +GO(wcstoll, IFpBp_i) // __wcstol_l // wcstol_l // Weak // __wcstoll_internal @@ -1989,7 +1989,7 @@ GOW(wcsncasecmp, iFppL) // wcstoq // Weak //GO(wcstoul, iFppi) //GO(__wcstoul_internal, LFppii) -//GO(wcstoull, UFppi) +GO(wcstoull, UFpBp_i) // __wcstoul_l // wcstoul_l // Weak // __wcstoull_internal @@ -2001,7 +2001,7 @@ GOW(wcsncasecmp, iFppL) //GO(wcswidth, iFpu) //GO(wcsxfrm, uFppu) //GOW(wcsxfrm_l, uFppup) -//GO(__wcsxfrm_l, uFppup) +GO(__wcsxfrm_l, LFppLa) GO(wctob, iFi) //GO(wctomb, iFpi) //GO(__wctomb_chk, iFpuL) @@ -2012,7 +2012,7 @@ GO(wctob, iFi) GO(__wctype_l, uFpa) GOW(wctype_l, uFpa) //GO(wcwidth, iFu) -//GOW(wmemchr, pFpuL) +GOW(wmemchr, pFpuL) GO(wmemcmp, iFppL) GOW(wmemcpy, pFppL) GO(__wmemcpy_chk, pFppLL) @@ -2020,7 +2020,7 @@ GOW(wmemmove, pFppL) // __wmemmove_chk // wmempcpy // Weak // __wmempcpy_chk -//GO(wmemset, pFpuL) +GO(wmemset, pFpuL) // __wmemset_chk //GO(wordexp, iFppi) //GO(wordfree, vFp) |