diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2025-01-23 10:09:58 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2025-01-23 10:09:58 +0100 |
| commit | ad5b5ea6171ff5999587f60a7c1f6588c65557f7 (patch) | |
| tree | 18d581a7bae11bd009f59a012e7ac2b0ee292021 /src | |
| parent | b439817467cc122e51e155c60ce611aaf3a86671 (diff) | |
| download | box64-ad5b5ea6171ff5999587f60a7c1f6588c65557f7.tar.gz box64-ad5b5ea6171ff5999587f60a7c1f6588c65557f7.zip | |
[WRAPPER] Reworked libcap wrapping with new wrapperhelper
Diffstat (limited to 'src')
| -rw-r--r-- | src/wrapped/generated/functions_list.txt | 2 | ||||
| -rw-r--r-- | src/wrapped/generated/wrapper.c | 8 | ||||
| -rw-r--r-- | src/wrapped/generated/wrapper.h | 2 | ||||
| -rw-r--r-- | src/wrapped/wrappedcap_private.h | 110 |
4 files changed, 67 insertions, 55 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt index e2babcb2..ee262fed 100644 --- a/src/wrapped/generated/functions_list.txt +++ b/src/wrapped/generated/functions_list.txt @@ -712,6 +712,7 @@ #() lFpLp #() lFppi #() lFppu +#() lFppl #() lFppL #() lFppp #() lFppS @@ -1122,6 +1123,7 @@ #() iFpWpp #() iFpuwp #() iFpuii +#() iFpuiu #() iFpuiL #() iFpuip #() iFpuWp diff --git a/src/wrapped/generated/wrapper.c b/src/wrapped/generated/wrapper.c index 858a6b4e..2ac88587 100644 --- a/src/wrapped/generated/wrapper.c +++ b/src/wrapped/generated/wrapper.c @@ -744,6 +744,7 @@ typedef intptr_t (*lFpLL_t)(void*, uintptr_t, uintptr_t); typedef intptr_t (*lFpLp_t)(void*, uintptr_t, void*); typedef intptr_t (*lFppi_t)(void*, void*, int32_t); typedef intptr_t (*lFppu_t)(void*, void*, uint32_t); +typedef intptr_t (*lFppl_t)(void*, void*, intptr_t); typedef intptr_t (*lFppL_t)(void*, void*, uintptr_t); typedef intptr_t (*lFppp_t)(void*, void*, void*); typedef intptr_t (*lFppS_t)(void*, void*, void*); @@ -1153,6 +1154,7 @@ typedef int32_t (*iFpWWu_t)(void*, uint16_t, uint16_t, uint32_t); typedef int32_t (*iFpWpp_t)(void*, uint16_t, void*, void*); typedef int32_t (*iFpuwp_t)(void*, uint32_t, int16_t, void*); typedef int32_t (*iFpuii_t)(void*, uint32_t, int32_t, int32_t); +typedef int32_t (*iFpuiu_t)(void*, uint32_t, int32_t, uint32_t); typedef int32_t (*iFpuiL_t)(void*, uint32_t, int32_t, uintptr_t); typedef int32_t (*iFpuip_t)(void*, uint32_t, int32_t, void*); typedef int32_t (*iFpuWp_t)(void*, uint32_t, uint16_t, void*); @@ -4196,6 +4198,7 @@ void lFpLL(x64emu_t *emu, uintptr_t fcn) { lFpLL_t fn = (lFpLL_t)fcn; R_RAX=(int void lFpLp(x64emu_t *emu, uintptr_t fcn) { lFpLp_t fn = (lFpLp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); } void lFppi(x64emu_t *emu, uintptr_t fcn) { lFppi_t fn = (lFppi_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (int32_t)R_RDX); } void lFppu(x64emu_t *emu, uintptr_t fcn) { lFppu_t fn = (lFppu_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (uint32_t)R_RDX); } +void lFppl(x64emu_t *emu, uintptr_t fcn) { lFppl_t fn = (lFppl_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (intptr_t)R_RDX); } void lFppL(x64emu_t *emu, uintptr_t fcn) { lFppL_t fn = (lFppL_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (uintptr_t)R_RDX); } void lFppp(x64emu_t *emu, uintptr_t fcn) { lFppp_t fn = (lFppp_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, (void*)R_RDX); } void lFppS(x64emu_t *emu, uintptr_t fcn) { lFppS_t fn = (lFppS_t)fcn; R_RAX=(intptr_t)fn((void*)R_RDI, (void*)R_RSI, io_convert((void*)R_RDX)); } @@ -4605,6 +4608,7 @@ void iFpWWu(x64emu_t *emu, uintptr_t fcn) { iFpWWu_t fn = (iFpWWu_t)fcn; R_RAX=( void iFpWpp(x64emu_t *emu, uintptr_t fcn) { iFpWpp_t fn = (iFpWpp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint16_t)R_RSI, (void*)R_RDX, (void*)R_RCX); } void iFpuwp(x64emu_t *emu, uintptr_t fcn) { iFpuwp_t fn = (iFpuwp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int16_t)R_RDX, (void*)R_RCX); } void iFpuii(x64emu_t *emu, uintptr_t fcn) { iFpuii_t fn = (iFpuii_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (int32_t)R_RCX); } +void iFpuiu(x64emu_t *emu, uintptr_t fcn) { iFpuiu_t fn = (iFpuiu_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uint32_t)R_RCX); } void iFpuiL(x64emu_t *emu, uintptr_t fcn) { iFpuiL_t fn = (iFpuiL_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX); } void iFpuip(x64emu_t *emu, uintptr_t fcn) { iFpuip_t fn = (iFpuip_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (int32_t)R_RDX, (void*)R_RCX); } void iFpuWp(x64emu_t *emu, uintptr_t fcn) { iFpuWp_t fn = (iFpuWp_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint16_t)R_RDX, (void*)R_RCX); } @@ -7537,6 +7541,7 @@ int isSimpleWrapper(wrapper_t fun) { if (fun == &lFpLp) return 1; if (fun == &lFppi) return 1; if (fun == &lFppu) return 1; + if (fun == &lFppl) return 1; if (fun == &lFppL) return 1; if (fun == &lFppp) return 1; if (fun == &LFipL) return 1; @@ -7856,6 +7861,7 @@ int isSimpleWrapper(wrapper_t fun) { if (fun == &iFpWpp) return 1; if (fun == &iFpuwp) return 1; if (fun == &iFpuii) return 1; + if (fun == &iFpuiu) return 1; if (fun == &iFpuiL) return 1; if (fun == &iFpuip) return 1; if (fun == &iFpuWp) return 1; @@ -9552,6 +9558,7 @@ int isSimpleWrapper(wrapper_t fun) { if (fun == &lFpLp) return 1; if (fun == &lFppi) return 65; if (fun == &lFppu) return 65; + if (fun == &lFppl) return 1; if (fun == &lFppL) return 1; if (fun == &lFppp) return 1; if (fun == &LFipL) return 17; @@ -9871,6 +9878,7 @@ int isSimpleWrapper(wrapper_t fun) { if (fun == &iFpWpp) return 1; if (fun == &iFpuwp) return 97; if (fun == &iFpuii) return 225; + if (fun == &iFpuiu) return 225; if (fun == &iFpuiL) return 97; if (fun == &iFpuip) return 97; if (fun == &iFpuWp) return 33; diff --git a/src/wrapped/generated/wrapper.h b/src/wrapped/generated/wrapper.h index 80932056..a02c6ac6 100644 --- a/src/wrapped/generated/wrapper.h +++ b/src/wrapped/generated/wrapper.h @@ -749,6 +749,7 @@ void lFpLL(x64emu_t *emu, uintptr_t fnc); void lFpLp(x64emu_t *emu, uintptr_t fnc); void lFppi(x64emu_t *emu, uintptr_t fnc); void lFppu(x64emu_t *emu, uintptr_t fnc); +void lFppl(x64emu_t *emu, uintptr_t fnc); void lFppL(x64emu_t *emu, uintptr_t fnc); void lFppp(x64emu_t *emu, uintptr_t fnc); void lFppS(x64emu_t *emu, uintptr_t fnc); @@ -1159,6 +1160,7 @@ void iFpWWu(x64emu_t *emu, uintptr_t fnc); void iFpWpp(x64emu_t *emu, uintptr_t fnc); void iFpuwp(x64emu_t *emu, uintptr_t fnc); void iFpuii(x64emu_t *emu, uintptr_t fnc); +void iFpuiu(x64emu_t *emu, uintptr_t fnc); void iFpuiL(x64emu_t *emu, uintptr_t fnc); void iFpuip(x64emu_t *emu, uintptr_t fnc); void iFpuWp(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped/wrappedcap_private.h b/src/wrapped/wrappedcap_private.h index a09c9393..c27c5313 100644 --- a/src/wrapped/wrappedcap_private.h +++ b/src/wrapped/wrappedcap_private.h @@ -1,62 +1,62 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error Meh.... +#error Meh... #endif -//GO(cap_clear, -//GO(cap_clear_flag, -//GO(cap_compare, -//GO(cap_copy_ext, -//GO(cap_copy_int, -//GO(cap_drop_bound, -//GO(cap_dup, +GO(cap_clear, iFp) +GO(cap_clear_flag, iFpu) +GO(cap_compare, iFpp) +GO(cap_copy_ext, lFppl) +GO(cap_copy_int, pFp) +GO(cap_drop_bound, iFi) +GO(cap_dup, pFp) GO(cap_free, iFp) -//GO(cap_from_name, -//GO(cap_from_text, -//GO(cap_get_ambient, -//GO(cap_get_bound, -//GO(cap_get_fd, -//GO(cap_get_file, -//GO(cap_get_flag, -//GO(cap_get_mode, -//GO(cap_get_nsowner, -//GO(capgetp, -//GO(cap_get_pid, -GO(cap_get_proc, pFi) -//GO(cap_get_secbits, -//GO(cap_iab_fill, -//GO(cap_iab_from_text, -//GO(cap_iab_get_proc, -//GO(cap_iab_get_vector, -//GO(cap_iab_init, -//GO(cap_iab_set_proc, -//GO(cap_iab_set_vector, -//GO(cap_iab_to_text, -//GO(cap_init, -//GO(cap_launch, -//GO(cap_launcher_callback, -//GO(cap_launcher_set_chroot, -//GO(cap_launcher_setgroups, -//GO(cap_launcher_set_iab, -//GO(cap_launcher_set_mode, -//GO(cap_launcher_setuid, -//GO(cap_max_bits, -//GO(cap_mode_name, -//GO(cap_new_launcher, -//GO(cap_reset_ambient, -//GO(cap_set_ambient, -//GO(cap_set_fd, -//GO(cap_set_file, -GO(cap_set_flag, iFpiipi) -//GO(cap_setgroups, -//GO(cap_set_mode, -//GO(cap_set_nsowner, -//GO(capsetp, +GO(cap_from_name, iFpp) +GO(cap_from_text, pFp) +GO(cap_get_ambient, iFi) +GO(cap_get_bound, iFi) +GO(cap_get_fd, pFi) +GO(cap_get_file, pFp) +GO(cap_get_flag, iFpiup) +GO(cap_get_mode, uFv) +GO(cap_get_nsowner, uFp) +GO(capgetp, iFip) +GO(cap_get_pid, pFi) +GO(cap_get_proc, pFv) +GO(cap_get_secbits, uFv) +GO(cap_iab_fill, iFpupu) +GO(cap_iab_from_text, pFp) +GO(cap_iab_get_proc, pFv) +GO(cap_iab_get_vector, uFpui) +GO(cap_iab_init, pFv) +GO(cap_iab_set_proc, iFp) +GO(cap_iab_set_vector, iFpuiu) +GO(cap_iab_to_text, pFp) +GO(cap_init, pFv) +GO(cap_launch, iFpp) +//GOM(cap_launcher_callback, iFEpp) +GO(cap_launcher_set_chroot, iFpp) +GO(cap_launcher_setgroups, iFpuip) +GO(cap_launcher_set_iab, pFpp) +GO(cap_launcher_set_mode, iFpu) +GO(cap_launcher_setuid, iFpu) +GO(cap_max_bits, iFv) +GO(cap_mode_name, pFu) +GO(cap_new_launcher, pFppp) +GO(cap_reset_ambient, iFv) +GO(cap_set_ambient, iFiu) +GO(cap_set_fd, iFip) +GO(cap_set_file, iFpp) +GO(cap_set_flag, iFpuipu) +GO(cap_setgroups, iFuLp) +GO(cap_set_mode, iFu) +GO(cap_set_nsowner, iFpu) +GO(capsetp, iFip) GO(cap_set_proc, iFp) -//GO(cap_set_secbits, -//GO(cap_set_syscall, -//GO(cap_setuid, -//GO(cap_size, -//GO(cap_to_name, -//GO(cap_to_text, +GO(cap_set_secbits, iFu) +//GOM(cap_set_syscall, vFEpp) +GO(cap_setuid, iFu) +GO(cap_size, lFp) +GO(cap_to_name, pFi) +GO(cap_to_text, pFpp) //GO(_libcap_strdup, //GOW(psx_load_syscalls, |