diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2024-09-14 11:37:22 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2024-09-14 11:37:22 +0200 |
| commit | 2e1b58a876d1760e83565d18e8845d9997adcfbf (patch) | |
| tree | 474d698e4dcd77a666845eb93bf7d5e6734acf56 /src | |
| parent | de7baa0b410185710411f38d51bb29cbc0ebd92a (diff) | |
| download | box64-2e1b58a876d1760e83565d18e8845d9997adcfbf.tar.gz box64-2e1b58a876d1760e83565d18e8845d9997adcfbf.zip | |
[BOX32] Added a few libc 32biyts wrapped functions
Diffstat (limited to 'src')
| -rw-r--r-- | src/wrapped32/generated/functions_list.txt | 2 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrapper32.c | 5 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrapper32.h | 2 | ||||
| -rwxr-xr-x | src/wrapped32/wrappedlibc_private.h | 6 |
4 files changed, 12 insertions, 3 deletions
diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt index aef27d63..1d5bfd38 100644 --- a/src/wrapped32/generated/functions_list.txt +++ b/src/wrapped32/generated/functions_list.txt @@ -24,6 +24,7 @@ #() iFS -> iFS #() IFf -> IFf #() IFd -> IFd +#() IFp -> IFp #() IFS -> IFS #() CFu -> CFu #() CFU -> CFU @@ -41,6 +42,7 @@ #() fFf -> fFf #() dFv -> dFv #() dFd -> dFd +#() dFp -> dFp #() lFi -> lFi #() lFu -> lFu #() lFp -> lFp diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c index 44269eb8..fdb0fdcc 100644 --- a/src/wrapped32/generated/wrapper32.c +++ b/src/wrapped32/generated/wrapper32.c @@ -111,6 +111,7 @@ typedef int32_t (*iFh_t)(uintptr_t); typedef int32_t (*iFS_t)(void*); typedef int64_t (*IFf_t)(float); typedef int64_t (*IFd_t)(double); +typedef int64_t (*IFp_t)(void*); typedef int64_t (*IFS_t)(void*); typedef uint8_t (*CFu_t)(uint32_t); typedef uint8_t (*CFU_t)(uint64_t); @@ -128,6 +129,7 @@ typedef uint64_t (*UFs_t)(void*); typedef float (*fFf_t)(float); typedef double (*dFv_t)(void); typedef double (*dFd_t)(double); +typedef double (*dFp_t)(void*); typedef intptr_t (*lFi_t)(int32_t); typedef intptr_t (*lFu_t)(uint32_t); typedef intptr_t (*lFp_t)(void*); @@ -957,6 +959,7 @@ void iFh_32(x64emu_t *emu, uintptr_t fcn) { iFh_t fn = (iFh_t)fcn; R_EAX = fn(fr void iFS_32(x64emu_t *emu, uintptr_t fcn) { iFS_t fn = (iFS_t)fcn; R_EAX = fn(io_convert32(from_ptriv(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 IFp_32(x64emu_t *emu, uintptr_t fcn) { IFp_t fn = (IFp_t)fcn; ui64_t r; r.i = fn(from_ptriv(R_ESP + 4)); R_EAX = r.d[0]; R_EDX = r.d[1]; } void IFS_32(x64emu_t *emu, uintptr_t fcn) { IFS_t fn = (IFS_t)fcn; ui64_t r; r.i = fn(io_convert32(from_ptriv(R_ESP + 4))); R_EAX = r.d[0]; R_EDX = r.d[1]; } void CFu_32(x64emu_t *emu, uintptr_t fcn) { CFu_t fn = (CFu_t)fcn; R_EAX = (unsigned char)fn(from_ptri(uint32_t, R_ESP + 4)); } void CFU_32(x64emu_t *emu, uintptr_t fcn) { CFU_t fn = (CFU_t)fcn; R_EAX = (unsigned char)fn(from_ptri(uint64_t, R_ESP + 4)); } @@ -974,6 +977,7 @@ void UFs_32(x64emu_t *emu, uintptr_t fcn) { UFs_t fn = (UFs_t)fcn; ui64_t r; r.u void fFf_32(x64emu_t *emu, uintptr_t fcn) { fFf_t fn = (fFf_t)fcn; float fl = fn(from_ptri(float, R_ESP + 4)); fpu_do_push(emu); ST0val = fl; } void dFv_32(x64emu_t *emu, uintptr_t fcn) { dFv_t fn = (dFv_t)fcn; double db = fn(); fpu_do_push(emu); ST0val = db; } 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 dFp_32(x64emu_t *emu, uintptr_t fcn) { dFp_t fn = (dFp_t)fcn; double db = fn(from_ptriv(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 lFu_32(x64emu_t *emu, uintptr_t fcn) { lFu_t fn = (lFu_t)fcn; R_EAX = to_long(fn(from_ptri(uint32_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))); } @@ -1791,6 +1795,7 @@ int isRetX87Wrapper32(wrapper_t fun) { if (fun == &fFf_32) return 1; if (fun == &dFv_32) return 1; if (fun == &dFd_32) return 1; + if (fun == &dFp_32) return 1; if (fun == &fFif_32) return 1; if (fun == &fFfi_32) return 1; if (fun == &fFff_32) return 1; diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h index 330ff09d..c28315f2 100644 --- a/src/wrapped32/generated/wrapper32.h +++ b/src/wrapped32/generated/wrapper32.h @@ -64,6 +64,7 @@ void iFh_32(x64emu_t *emu, uintptr_t fnc); void iFS_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 IFp_32(x64emu_t *emu, uintptr_t fnc); void IFS_32(x64emu_t *emu, uintptr_t fnc); void CFu_32(x64emu_t *emu, uintptr_t fnc); void CFU_32(x64emu_t *emu, uintptr_t fnc); @@ -81,6 +82,7 @@ void UFs_32(x64emu_t *emu, uintptr_t fnc); void fFf_32(x64emu_t *emu, uintptr_t fnc); void dFv_32(x64emu_t *emu, uintptr_t fnc); void dFd_32(x64emu_t *emu, uintptr_t fnc); +void dFp_32(x64emu_t *emu, uintptr_t fnc); void lFi_32(x64emu_t *emu, uintptr_t fnc); void lFu_32(x64emu_t *emu, uintptr_t fnc); void lFp_32(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped32/wrappedlibc_private.h b/src/wrapped32/wrappedlibc_private.h index 297f647f..0e52f679 100755 --- a/src/wrapped32/wrappedlibc_private.h +++ b/src/wrapped32/wrappedlibc_private.h @@ -80,10 +80,10 @@ GOW(asctime_r, pFriiiiiiiiilt_p) // __assert GO(__assert_fail, vFppip) //GO(__assert_perror_fail, vFipup) -//GO(atof, dFp) -//GO(atoi, iFp) +GO(atof, dFp) +GO(atoi, iFp) //GO(atol, lFp) -//GO(atoll, IFp) +GO(atoll, IFp) // authdes_create // authdes_getucred // authdes_pk_create |