diff options
| author | Yang Liu <liuyang22@iscas.ac.cn> | 2025-06-13 15:01:10 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-13 09:01:10 +0200 |
| commit | abe3e1c4f853bec4d93aa8d31d45d83313108f7f (patch) | |
| tree | f3cde1d5b6cc6d6f29d15acd5a9bbd5073f95240 | |
| parent | ffbb0a400e3d6005a4d568f15fa591e30f942159 (diff) | |
| download | box64-abe3e1c4f853bec4d93aa8d31d45d83313108f7f.tar.gz box64-abe3e1c4f853bec4d93aa8d31d45d83313108f7f.zip | |
[WRAPPER] Wrapped a few more functions in gio2 and libresolv (#2737)
* [WRAPPER] Wrapped a few more functions in gio2 and libresolv * fix static build * fix fix
| -rw-r--r-- | src/emu/x64printer.c | 2 | ||||
| -rw-r--r-- | src/wrapped/generated/functions_list.txt | 1 | ||||
| -rw-r--r-- | src/wrapped/generated/wrapper.c | 2 | ||||
| -rw-r--r-- | src/wrapped/generated/wrapper.h | 1 | ||||
| -rw-r--r-- | src/wrapped/wrappedgio2_private.h | 1 | ||||
| -rw-r--r-- | src/wrapped/wrappedlibresolv_private.h | 12 |
6 files changed, 17 insertions, 2 deletions
diff --git a/src/emu/x64printer.c b/src/emu/x64printer.c index 54c28746..65664426 100644 --- a/src/emu/x64printer.c +++ b/src/emu/x64printer.c @@ -6003,6 +6003,8 @@ void x64Print(x64emu_t* emu, char* buff, size_t buffsz, const char* func, int ti snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIi32 ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } else if (w == iFpiLLdduudd) { snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIu64 ", %" PRIu64 ", %" PRIf ", %" PRIf ", %" PRIu32 ", %" PRIu32 ", %" PRIf ", %" PRIf ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, emu->xmm[0].d[0], emu->xmm[1].d[0], (uint32_t)R_R8, (uint32_t)R_R9, emu->xmm[2].d[0], emu->xmm[3].d[0]); + } else if (w == iFpipiipippi) { + snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIi32 ", %" PRIp ", %" PRIi32 ", %" PRIp ", %" PRIp ", %" PRIi32 ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } else if (w == iFpCuWCCCCup) { snprintf(buff, buffsz, "%04d|%p: Calling %s(%" PRIp ", %" PRIu8 ", %" PRIu32 ", %" PRIu16 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu32 ", %" PRIp ")", tid, *(void**)(R_RSP), func, (void*)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint16_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9, *(uint8_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } else if (w == iFpuuLiuiiLL) { diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt index 82046e80..79d2ea99 100644 --- a/src/wrapped/generated/functions_list.txt +++ b/src/wrapped/generated/functions_list.txt @@ -3269,6 +3269,7 @@ #() iFpiiLiiipip #() iFpiLLiiipip #() iFpiLLdduudd +#() iFpipiipippi #() iFpCuWCCCCup #() iFpuuLiuiiLL #() iFpLLpiiuuii diff --git a/src/wrapped/generated/wrapper.c b/src/wrapped/generated/wrapper.c index b72e2e39..25890534 100644 --- a/src/wrapped/generated/wrapper.c +++ b/src/wrapped/generated/wrapper.c @@ -3296,6 +3296,7 @@ typedef int32_t (*iFuiiiuuiiip_t)(uint32_t, int32_t, int32_t, int32_t, uint32_t, typedef int32_t (*iFpiiLiiipip_t)(void*, int32_t, int32_t, uintptr_t, int32_t, int32_t, int32_t, void*, int32_t, void*); typedef int32_t (*iFpiLLiiipip_t)(void*, int32_t, uintptr_t, uintptr_t, int32_t, int32_t, int32_t, void*, int32_t, void*); typedef int32_t (*iFpiLLdduudd_t)(void*, int32_t, uintptr_t, uintptr_t, double, double, uint32_t, uint32_t, double, double); +typedef int32_t (*iFpipiipippi_t)(void*, int32_t, void*, int32_t, int32_t, void*, int32_t, void*, void*, int32_t); typedef int32_t (*iFpCuWCCCCup_t)(void*, uint8_t, uint32_t, uint16_t, uint8_t, uint8_t, uint8_t, uint8_t, uint32_t, void*); typedef int32_t (*iFpuuLiuiiLL_t)(void*, uint32_t, uint32_t, uintptr_t, int32_t, uint32_t, int32_t, int32_t, uintptr_t, uintptr_t); typedef int32_t (*iFpLLpiiuuii_t)(void*, uintptr_t, uintptr_t, void*, int32_t, int32_t, uint32_t, uint32_t, int32_t, int32_t); @@ -6830,6 +6831,7 @@ void iFuiiiuuiiip(x64emu_t *emu, uintptr_t fcn) { iFuiiiuuiiip_t fn = (iFuiiiuui void iFpiiLiiipip(x64emu_t *emu, uintptr_t fcn) { iFpiiLiiipip_t fn = (iFpiiLiiipip_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (int32_t)R_RSI, (int32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } void iFpiLLiiipip(x64emu_t *emu, uintptr_t fcn) { iFpiLLiiipip_t fn = (iFpiLLiiipip_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } void iFpiLLdduudd(x64emu_t *emu, uintptr_t fcn) { iFpiLLdduudd_t fn = (iFpiLLdduudd_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (int32_t)R_RSI, (uintptr_t)R_RDX, (uintptr_t)R_RCX, emu->xmm[0].d[0], emu->xmm[1].d[0], (uint32_t)R_R8, (uint32_t)R_R9, emu->xmm[2].d[0], emu->xmm[3].d[0]); } +void iFpipiipippi(x64emu_t *emu, uintptr_t fcn) { iFpipiipippi_t fn = (iFpipiipippi_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (int32_t)R_RCX, (int32_t)R_R8, (void*)R_R9, *(int32_t*)(R_RSP + 8), *(void**)(R_RSP + 16), *(void**)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } void iFpCuWCCCCup(x64emu_t *emu, uintptr_t fcn) { iFpCuWCCCCup_t fn = (iFpCuWCCCCup_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint8_t)R_RSI, (uint32_t)R_RDX, (uint16_t)R_RCX, (uint8_t)R_R8, (uint8_t)R_R9, *(uint8_t*)(R_RSP + 8), *(uint8_t*)(R_RSP + 16), *(uint32_t*)(R_RSP + 24), *(void**)(R_RSP + 32)); } void iFpuuLiuiiLL(x64emu_t *emu, uintptr_t fcn) { iFpuuLiuiiLL_t fn = (iFpuuLiuiiLL_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uintptr_t)R_RCX, (int32_t)R_R8, (uint32_t)R_R9, *(int32_t*)(R_RSP + 8), *(int32_t*)(R_RSP + 16), *(uintptr_t*)(R_RSP + 24), *(uintptr_t*)(R_RSP + 32)); } void iFpLLpiiuuii(x64emu_t *emu, uintptr_t fcn) { iFpLLpiiuuii_t fn = (iFpLLpiiuuii_t)fcn; R_RAX=(uint32_t)fn((void*)R_RDI, (uintptr_t)R_RSI, (uintptr_t)R_RDX, (void*)R_RCX, (int32_t)R_R8, (int32_t)R_R9, *(uint32_t*)(R_RSP + 8), *(uint32_t*)(R_RSP + 16), *(int32_t*)(R_RSP + 24), *(int32_t*)(R_RSP + 32)); } diff --git a/src/wrapped/generated/wrapper.h b/src/wrapped/generated/wrapper.h index 35e105c9..c782cb40 100644 --- a/src/wrapped/generated/wrapper.h +++ b/src/wrapped/generated/wrapper.h @@ -3306,6 +3306,7 @@ void iFuiiiuuiiip(x64emu_t *emu, uintptr_t fnc); void iFpiiLiiipip(x64emu_t *emu, uintptr_t fnc); void iFpiLLiiipip(x64emu_t *emu, uintptr_t fnc); void iFpiLLdduudd(x64emu_t *emu, uintptr_t fnc); +void iFpipiipippi(x64emu_t *emu, uintptr_t fnc); void iFpCuWCCCCup(x64emu_t *emu, uintptr_t fnc); void iFpuuLiuiiLL(x64emu_t *emu, uintptr_t fnc); void iFpLLpiiuuii(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped/wrappedgio2_private.h b/src/wrapped/wrappedgio2_private.h index f516745c..647da334 100644 --- a/src/wrapped/wrappedgio2_private.h +++ b/src/wrapped/wrappedgio2_private.h @@ -1146,6 +1146,7 @@ GO(g_network_monitor_can_reach_finish, iFppp) GO(g_network_monitor_get_connectivity, iFp) GO(g_network_monitor_get_default, pFv) GO(g_network_monitor_get_network_available, iFp) +GO(g_network_monitor_get_network_metered, iFp) GO(g_network_monitor_get_type, LFv) GO(g_network_service_get_domain, pFp) GO(g_network_service_get_protocol, pFp) diff --git a/src/wrapped/wrappedlibresolv_private.h b/src/wrapped/wrappedlibresolv_private.h index 8890e6e5..d660353a 100644 --- a/src/wrapped/wrappedlibresolv_private.h +++ b/src/wrapped/wrappedlibresolv_private.h @@ -84,11 +84,19 @@ GO(__res_mailok, iFp) GO(__res_mkquery, iFipiipippi) GOW(res_mkquery, iFipiipippi) GO(__res_nameinquery, iFpiipp) -//GO(__res_nmkquery, +#ifdef STATICBUILD +//GO(__res_nmkquery, +#else +GO(__res_nmkquery, iFpipiipippi) +#endif GO(__res_nquery, iFppiipi) //GO(__res_nquerydomain, GO(__res_nsearch, iFppiipi) -//GO(__res_nsend, +#ifdef STATICBUILD +//GO(__res_nsend, +#else +GO(__res_nsend, iFppipi) +#endif //DATA(_res_opcodes, 4) GO(__res_ownok, iFp) GO(__res_queriesmatch, iFpppp) |