diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-09-21 20:50:52 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-09-21 20:50:52 +0200 |
| commit | 7e4af27ba761b2feb2ba444f85f7889b9de4c2a6 (patch) | |
| tree | b80bd2362839bebcd3a94387fccdf437b1297ddd /src | |
| parent | 06bbf93bf876c107ff41593a75fe6fa8a6d6a779 (diff) | |
| download | box64-7e4af27ba761b2feb2ba444f85f7889b9de4c2a6.tar.gz box64-7e4af27ba761b2feb2ba444f85f7889b9de4c2a6.zip | |
More work on gtk and nss3+friends
Diffstat (limited to 'src')
33 files changed, 455 insertions, 49 deletions
diff --git a/src/dynarec/arm64_next.S b/src/dynarec/arm64_next.S index 48aefc17..5e890137 100755 --- a/src/dynarec/arm64_next.S +++ b/src/dynarec/arm64_next.S @@ -18,9 +18,10 @@ arm64_next: stp x12, x13, [sp, (8 * 4)] stp x14, x15, [sp, (8 * 6)] stp x16, x17, [sp, (8 * 8)] - str x18, [sp, (8 * 10)] + stp x18, x27, [sp, (8 * 10)] // also save x27(rip) to allow change in LinkNext mov x2, lr // "from" is in lr, so put in x2 + add x3, sp, 8*11 // x3 is address to change rip // call the function bl LinkNext // preserve return value @@ -31,7 +32,7 @@ arm64_next: ldp x12, x13, [sp, (8 * 4)] ldp x14, x15, [sp, (8 * 6)] ldp x16, x17, [sp, (8 * 8)] - ldr x18, [sp, (8 * 10)] + ldp x18, x27, [sp, (8 * 10)] add sp, sp, (8 * 12) // return offset is jump address br x3 diff --git a/src/dynarec/dynarec.c b/src/dynarec/dynarec.c index 5f4e94bd..976070ab 100755 --- a/src/dynarec/dynarec.c +++ b/src/dynarec/dynarec.c @@ -33,7 +33,7 @@ void arm64_epilog_fast() EXPORTDYN; #ifdef DYNAREC uintptr_t getX64Address(dynablock_t* db, uintptr_t arm_addr); -void* LinkNext(x64emu_t* emu, uintptr_t addr, void* x2) +void* LinkNext(x64emu_t* emu, uintptr_t addr, void* x2, uintptr_t* x3) { #ifdef HAVE_TRACE if(!addr) { @@ -48,7 +48,9 @@ void* LinkNext(x64emu_t* emu, uintptr_t addr, void* x2) // no block, let link table as is... if(hasAlternate((void*)addr)) { printf_log(LOG_INFO, "Jmp address has alternate: %p", (void*)addr); - addr = (uintptr_t)getAlternate((void*)addr); + addr = (uintptr_t)getAlternate((void*)addr); // set new address + R_RIP = addr; // but also new RIP! + *x3 = addr; // and the RIP in x27 register printf_log(LOG_INFO, " -> %p\n", (void*)addr); block = DBGetBlock(emu, addr, 1, ¤t); } diff --git a/src/include/gtkclass.h b/src/include/gtkclass.h index 9a8a512d..d70cb34b 100755 --- a/src/include/gtkclass.h +++ b/src/include/gtkclass.h @@ -9,9 +9,23 @@ typedef struct box64context_s box64context_t; typedef struct bridge_s bridge_t; +typedef struct my_GValue_s +{ + size_t g_type; + union { + int v_int; + int64_t v_int64; + uint64_t v_uint64; + float v_float; + double v_double; + void* v_pointer; + } data[2]; +} my_GValue_t; + + typedef struct my_GObjectClass_s { - int g_type_class; + size_t g_type_class; void* construct_properties; void* (*constructor) (int type, uint32_t n_construct_properties, void* construct_properties); void (*set_property) (void* object, uint32_t property_id, void* value, void* pspec); diff --git a/src/library_list.h b/src/library_list.h index 6bbdc53e..72cd16de 100755 --- a/src/library_list.h +++ b/src/library_list.h @@ -167,6 +167,9 @@ GO("libnss3.so", nss3) GO("libnssutil3.so", nssutil3) GO("libsmime3.so", smime3) GO("libnspr4.so", nspr4) +GO("libplds4.so", plds4) +GO("libplc4.so", plc4) +GO("libssl3.so", ssl3) GO("libselinux.so.1", selinux) GO("libsecret-1.so.0", secret1) diff --git a/src/libtools/myalign.c b/src/libtools/myalign.c index 3c6f6b3f..81bca493 100755 --- a/src/libtools/myalign.c +++ b/src/libtools/myalign.c @@ -804,7 +804,7 @@ void AlignSemidDs(void *dest, const void* source) uintptr_t getVArgs(x64emu_t* emu, int pos, uintptr_t* b, int N) { - if((pos+N)>6) + if((pos+N)>5) return b[pos+N-6]; return emu->regs[regs_abi[pos+N]].q[0]; } \ No newline at end of file diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt index ad5d80ae..abea9103 100644 --- a/src/wrapped/generated/functions_list.txt +++ b/src/wrapped/generated/functions_list.txt @@ -627,6 +627,8 @@ #() iFEupp #() iFEpii #() iFEpip +#() iFEpiV +#() iFEpiA #() iFEpLi #() iFEpLp #() iFEppi @@ -1929,6 +1931,10 @@ wrappeddbus: - dbus_connection_remove_filter - dbus_timeout_set_data - dbus_watch_set_data +- iFpiV: + - dbus_message_append_args +- iFpiA: + - dbus_message_append_args_valist - vFpppp: - dbus_connection_set_dispatch_status_function - dbus_connection_set_wakeup_main_function @@ -2301,9 +2307,11 @@ wrappedgtkx112: - gtk_list_store_set - gtk_message_dialog_format_secondary_markup - gtk_message_dialog_format_secondary_text + - gtk_tree_model_get - gtk_widget_style_get - vFppA: - gtk_list_store_set_valist + - gtk_tree_model_get_valist - gtk_widget_style_get_valist - uFupp: - gtk_timeout_add @@ -2946,6 +2954,8 @@ wrappedpango: - pango_attribute_init wrappedpangocairo: wrappedpangoft2: +wrappedplc4: +wrappedplds4: wrappedpng16: - vFpp: - png_set_read_user_transform_fn @@ -3345,6 +3355,7 @@ wrappedsmpeg2: - SMPEG_setdisplay - pFppii: - SMPEG_new_rwops +wrappedssl3: wrappedtcmallocminimal: - iFpL: - munmap diff --git a/src/wrapped/generated/wrappeddbustypes.h b/src/wrapped/generated/wrappeddbustypes.h index e388111d..d55ef6e0 100644 --- a/src/wrapped/generated/wrappeddbustypes.h +++ b/src/wrapped/generated/wrappeddbustypes.h @@ -12,6 +12,8 @@ #endif typedef void (*vFppp_t)(void*, void*, void*); +typedef int64_t (*iFpiV_t)(void*, int64_t, ...); +typedef int64_t (*iFpiA_t)(void*, int64_t, va_list); typedef void (*vFpppp_t)(void*, void*, void*, void*); typedef int64_t (*iFpipp_t)(void*, int64_t, void*, void*); typedef int64_t (*iFppip_t)(void*, void*, int64_t, void*); @@ -24,6 +26,8 @@ typedef int64_t (*iFpppppp_t)(void*, void*, void*, void*, void*, void*); GO(dbus_connection_remove_filter, vFppp_t) \ GO(dbus_timeout_set_data, vFppp_t) \ GO(dbus_watch_set_data, vFppp_t) \ + GO(dbus_message_append_args, iFpiV_t) \ + GO(dbus_message_append_args_valist, iFpiA_t) \ GO(dbus_connection_set_dispatch_status_function, vFpppp_t) \ GO(dbus_connection_set_wakeup_main_function, vFpppp_t) \ GO(dbus_connection_set_data, iFpipp_t) \ diff --git a/src/wrapped/generated/wrappedgtkx112types.h b/src/wrapped/generated/wrappedgtkx112types.h index eca206ce..bb05d866 100644 --- a/src/wrapped/generated/wrappedgtkx112types.h +++ b/src/wrapped/generated/wrappedgtkx112types.h @@ -61,8 +61,10 @@ typedef void* (*pFpipppppppi_t)(void*, int64_t, void*, void*, void*, void*, void GO(gtk_list_store_set, vFppV_t) \ GO(gtk_message_dialog_format_secondary_markup, vFppV_t) \ GO(gtk_message_dialog_format_secondary_text, vFppV_t) \ + GO(gtk_tree_model_get, vFppV_t) \ GO(gtk_widget_style_get, vFppV_t) \ GO(gtk_list_store_set_valist, vFppA_t) \ + GO(gtk_tree_model_get_valist, vFppA_t) \ GO(gtk_widget_style_get_valist, vFppA_t) \ GO(gtk_timeout_add, uFupp_t) \ GO(gtk_list_store_insert_with_values, vFppiV_t) \ diff --git a/src/wrapped/generated/wrappedplc4defs.h b/src/wrapped/generated/wrappedplc4defs.h new file mode 100644 index 00000000..3a6d22a8 --- /dev/null +++ b/src/wrapped/generated/wrappedplc4defs.h @@ -0,0 +1,8 @@ +/******************************************************************* + * File automatically generated by rebuild_wrappers.py (v2.1.0.16) * + *******************************************************************/ +#ifndef __wrappedplc4DEFS_H_ +#define __wrappedplc4DEFS_H_ + + +#endif // __wrappedplc4DEFS_H_ diff --git a/src/wrapped/generated/wrappedplc4types.h b/src/wrapped/generated/wrappedplc4types.h new file mode 100644 index 00000000..f6193b28 --- /dev/null +++ b/src/wrapped/generated/wrappedplc4types.h @@ -0,0 +1,17 @@ +/******************************************************************* + * File automatically generated by rebuild_wrappers.py (v2.1.0.16) * + *******************************************************************/ +#ifndef __wrappedplc4TYPES_H_ +#define __wrappedplc4TYPES_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + + +#define SUPER() ADDED_FUNCTIONS() + +#endif // __wrappedplc4TYPES_H_ diff --git a/src/wrapped/generated/wrappedplc4undefs.h b/src/wrapped/generated/wrappedplc4undefs.h new file mode 100644 index 00000000..7ebd330d --- /dev/null +++ b/src/wrapped/generated/wrappedplc4undefs.h @@ -0,0 +1,8 @@ +/******************************************************************* + * File automatically generated by rebuild_wrappers.py (v2.1.0.16) * + *******************************************************************/ +#ifndef __wrappedplc4UNDEFS_H_ +#define __wrappedplc4UNDEFS_H_ + + +#endif // __wrappedplc4UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedplds4defs.h b/src/wrapped/generated/wrappedplds4defs.h new file mode 100644 index 00000000..86877e73 --- /dev/null +++ b/src/wrapped/generated/wrappedplds4defs.h @@ -0,0 +1,8 @@ +/******************************************************************* + * File automatically generated by rebuild_wrappers.py (v2.1.0.16) * + *******************************************************************/ +#ifndef __wrappedplds4DEFS_H_ +#define __wrappedplds4DEFS_H_ + + +#endif // __wrappedplds4DEFS_H_ diff --git a/src/wrapped/generated/wrappedplds4types.h b/src/wrapped/generated/wrappedplds4types.h new file mode 100644 index 00000000..cb5c66b1 --- /dev/null +++ b/src/wrapped/generated/wrappedplds4types.h @@ -0,0 +1,17 @@ +/******************************************************************* + * File automatically generated by rebuild_wrappers.py (v2.1.0.16) * + *******************************************************************/ +#ifndef __wrappedplds4TYPES_H_ +#define __wrappedplds4TYPES_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + + +#define SUPER() ADDED_FUNCTIONS() + +#endif // __wrappedplds4TYPES_H_ diff --git a/src/wrapped/generated/wrappedplds4undefs.h b/src/wrapped/generated/wrappedplds4undefs.h new file mode 100644 index 00000000..5ed9f7cf --- /dev/null +++ b/src/wrapped/generated/wrappedplds4undefs.h @@ -0,0 +1,8 @@ +/******************************************************************* + * File automatically generated by rebuild_wrappers.py (v2.1.0.16) * + *******************************************************************/ +#ifndef __wrappedplds4UNDEFS_H_ +#define __wrappedplds4UNDEFS_H_ + + +#endif // __wrappedplds4UNDEFS_H_ diff --git a/src/wrapped/generated/wrappedssl3defs.h b/src/wrapped/generated/wrappedssl3defs.h new file mode 100644 index 00000000..88b17390 --- /dev/null +++ b/src/wrapped/generated/wrappedssl3defs.h @@ -0,0 +1,8 @@ +/******************************************************************* + * File automatically generated by rebuild_wrappers.py (v2.1.0.16) * + *******************************************************************/ +#ifndef __wrappedssl3DEFS_H_ +#define __wrappedssl3DEFS_H_ + + +#endif // __wrappedssl3DEFS_H_ diff --git a/src/wrapped/generated/wrappedssl3types.h b/src/wrapped/generated/wrappedssl3types.h new file mode 100644 index 00000000..11e58f22 --- /dev/null +++ b/src/wrapped/generated/wrappedssl3types.h @@ -0,0 +1,17 @@ +/******************************************************************* + * File automatically generated by rebuild_wrappers.py (v2.1.0.16) * + *******************************************************************/ +#ifndef __wrappedssl3TYPES_H_ +#define __wrappedssl3TYPES_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + + +#define SUPER() ADDED_FUNCTIONS() + +#endif // __wrappedssl3TYPES_H_ diff --git a/src/wrapped/generated/wrappedssl3undefs.h b/src/wrapped/generated/wrappedssl3undefs.h new file mode 100644 index 00000000..b35a4342 --- /dev/null +++ b/src/wrapped/generated/wrappedssl3undefs.h @@ -0,0 +1,8 @@ +/******************************************************************* + * File automatically generated by rebuild_wrappers.py (v2.1.0.16) * + *******************************************************************/ +#ifndef __wrappedssl3UNDEFS_H_ +#define __wrappedssl3UNDEFS_H_ + + +#endif // __wrappedssl3UNDEFS_H_ diff --git a/src/wrapped/generated/wrapper.c b/src/wrapped/generated/wrapper.c index 1886745a..5d6f985e 100644 --- a/src/wrapped/generated/wrapper.c +++ b/src/wrapped/generated/wrapper.c @@ -661,6 +661,8 @@ typedef int64_t (*iFEipV_t)(x64emu_t*, int64_t, void*, void*); typedef int64_t (*iFEupp_t)(x64emu_t*, uint64_t, void*, void*); typedef int64_t (*iFEpii_t)(x64emu_t*, void*, int64_t, int64_t); typedef int64_t (*iFEpip_t)(x64emu_t*, void*, int64_t, void*); +typedef int64_t (*iFEpiV_t)(x64emu_t*, void*, int64_t, void*); +typedef int64_t (*iFEpiA_t)(x64emu_t*, void*, int64_t, void*); typedef int64_t (*iFEpLi_t)(x64emu_t*, void*, uintptr_t, int64_t); typedef int64_t (*iFEpLp_t)(x64emu_t*, void*, uintptr_t, void*); typedef int64_t (*iFEppi_t)(x64emu_t*, void*, void*, int64_t); @@ -2540,6 +2542,8 @@ void iFEipV(x64emu_t *emu, uintptr_t fcn) { iFEipV_t fn = (iFEipV_t)fcn; R_RAX=( void iFEupp(x64emu_t *emu, uintptr_t fcn) { iFEupp_t fn = (iFEupp_t)fcn; R_RAX=(int64_t)fn(emu, (uint64_t)R_RDI, (void*)R_RSI, (void*)R_RDX); } void iFEpii(x64emu_t *emu, uintptr_t fcn) { iFEpii_t fn = (iFEpii_t)fcn; R_RAX=(int64_t)fn(emu, (void*)R_RDI, (int64_t)R_RSI, (int64_t)R_RDX); } void iFEpip(x64emu_t *emu, uintptr_t fcn) { iFEpip_t fn = (iFEpip_t)fcn; R_RAX=(int64_t)fn(emu, (void*)R_RDI, (int64_t)R_RSI, (void*)R_RDX); } +void iFEpiV(x64emu_t *emu, uintptr_t fcn) { iFEpiV_t fn = (iFEpiV_t)fcn; R_RAX=(int64_t)fn(emu, (void*)R_RDI, (int64_t)R_RSI, (void*)(R_RSP + 8)); } +void iFEpiA(x64emu_t *emu, uintptr_t fcn) { iFEpiA_t fn = (iFEpiA_t)fcn; R_RAX=(int64_t)fn(emu, (void*)R_RDI, (int64_t)R_RSI, (void*)R_RDX); } void iFEpLi(x64emu_t *emu, uintptr_t fcn) { iFEpLi_t fn = (iFEpLi_t)fcn; R_RAX=(int64_t)fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (int64_t)R_RDX); } void iFEpLp(x64emu_t *emu, uintptr_t fcn) { iFEpLp_t fn = (iFEpLp_t)fcn; R_RAX=(int64_t)fn(emu, (void*)R_RDI, (uintptr_t)R_RSI, (void*)R_RDX); } void iFEppi(x64emu_t *emu, uintptr_t fcn) { iFEppi_t fn = (iFEppi_t)fcn; R_RAX=(int64_t)fn(emu, (void*)R_RDI, (void*)R_RSI, (int64_t)R_RDX); } diff --git a/src/wrapped/generated/wrapper.h b/src/wrapped/generated/wrapper.h index 64df1c33..4b9fda9a 100644 --- a/src/wrapped/generated/wrapper.h +++ b/src/wrapped/generated/wrapper.h @@ -660,6 +660,8 @@ void iFEipV(x64emu_t *emu, uintptr_t fnc); void iFEupp(x64emu_t *emu, uintptr_t fnc); void iFEpii(x64emu_t *emu, uintptr_t fnc); void iFEpip(x64emu_t *emu, uintptr_t fnc); +void iFEpiV(x64emu_t *emu, uintptr_t fnc); +void iFEpiA(x64emu_t *emu, uintptr_t fnc); void iFEpLi(x64emu_t *emu, uintptr_t fnc); void iFEpLp(x64emu_t *emu, uintptr_t fnc); void iFEppi(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped/wrappeddbus.c b/src/wrapped/wrappeddbus.c index 9599894d..56f1c054 100755 --- a/src/wrapped/wrappeddbus.c +++ b/src/wrapped/wrappeddbus.c @@ -424,6 +424,23 @@ EXPORT int my_dbus_message_get_args(x64emu_t* emu, void* message, void* e, int a return my->dbus_message_get_args_valist(message, e, arg, VARARGS); } +EXPORT int my_dbus_message_append_args_valist(x64emu_t* emu, void* message, int arg, x64_va_list_t b) +{ + (void)emu; + dbus_my_t *my = (dbus_my_t*)my_lib->priv.w.p2; + CONVERT_VALIST(b); + return my->dbus_message_append_args_valist(message, arg, VARARGS); +} + +EXPORT int my_dbus_message_append_args(x64emu_t* emu, void* message, int arg, uint64_t* V) +{ + (void)emu; + dbus_my_t *my = (dbus_my_t*)my_lib->priv.w.p2; + + CREATE_VALIST_FROM_VAARG(V, emu->scratch, 2); + return my->dbus_message_append_args_valist(message, arg, VARARGS); +} + EXPORT int my_dbus_message_set_data(x64emu_t* emu, void* message, int32_t slot, void* data, void* free_func) { (void)emu; diff --git a/src/wrapped/wrappeddbus_private.h b/src/wrapped/wrappeddbus_private.h index 1b4fa60d..9fd851b7 100755 --- a/src/wrapped/wrappeddbus_private.h +++ b/src/wrapped/wrappeddbus_private.h @@ -93,8 +93,8 @@ GO(dbus_get_version, vFppp) GO(dbus_malloc, pFL) GO(dbus_malloc0, pFL) GO(dbus_message_allocate_data_slot, iFp) -//GO2(dbus_message_append_args, iFpiV, dbus_message_append_args_valist) -//GO(dbus_message_append_args_valist, iFpip) +GOM(dbus_message_append_args, iFEpiV) +GOM(dbus_message_append_args_valist, iFEpiA) GO(dbus_message_copy, pFp) GO(dbus_message_demarshal, pFpip) GO(dbus_message_demarshal_bytes_needed, iFpi) diff --git a/src/wrapped/wrappedglib2.c b/src/wrapped/wrappedglib2.c index 42b038da..a163bb23 100755 --- a/src/wrapped/wrappedglib2.c +++ b/src/wrapped/wrappedglib2.c @@ -791,21 +791,21 @@ EXPORT void* my_g_markup_printf_escaped(x64emu_t *emu, void* fmt, void* b) { } -EXPORT void my_g_datalist_id_set_data_full(x64emu_t* emu, void* datalist, uint32_t key, void* data, void* freecb) +EXPORT void my_g_datalist_id_set_data_full(x64emu_t* emu, void* datalist, uintptr_t key, void* data, void* freecb) { glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2; void* fc = findFreeFct(freecb); my->g_datalist_id_set_data_full(datalist, key, data, fc); } -EXPORT void* my_g_datalist_id_dup_data(x64emu_t* emu, void* datalist, uint32_t key, void* dupcb, void* data) +EXPORT void* my_g_datalist_id_dup_data(x64emu_t* emu, void* datalist, uintptr_t key, void* dupcb, void* data) { glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2; void* cc = findDuplicateFct(dupcb); return my->g_datalist_id_dup_data(datalist, key, cc, data); } -EXPORT int my_g_datalist_id_replace_data(x64emu_t* emu, void* datalist, uint32_t key, void* oldval, void* newval, void* oldfree, void* newfree) +EXPORT int my_g_datalist_id_replace_data(x64emu_t* emu, void* datalist, uintptr_t key, void* oldval, void* newval, void* oldfree, void* newfree) { glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2; void* oldfc = findFreeFct(oldfree); @@ -813,7 +813,7 @@ EXPORT int my_g_datalist_id_replace_data(x64emu_t* emu, void* datalist, uint32_t return my->g_datalist_id_replace_data(datalist, key, oldval, newval, oldfc, newfc); } -EXPORT void* my_g_variant_new_from_data(x64emu_t* emu, void* type, void* data, uint32_t size, int trusted, void* freecb, void* datacb) +EXPORT void* my_g_variant_new_from_data(x64emu_t* emu, void* type, void* data, size_t size, int trusted, void* freecb, void* datacb) { glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2; void* fc = findFreeFct(freecb); @@ -916,7 +916,7 @@ EXPORT void my_g_printerr(x64emu_t* emu, void* fmt, void* b) free(buf); } -EXPORT void* my_g_source_new(x64emu_t* emu, my_GSourceFuncs_t* source_funcs, uint32_t struct_size) +EXPORT void* my_g_source_new(x64emu_t* emu, my_GSourceFuncs_t* source_funcs, size_t struct_size) { glib2_my_t *my = (glib2_my_t*)my_lib->priv.w.p2; diff --git a/src/wrapped/wrappedgobject2.c b/src/wrapped/wrappedgobject2.c index fb43f836..42ff5099 100755 --- a/src/wrapped/wrappedgobject2.c +++ b/src/wrapped/wrappedgobject2.c @@ -404,7 +404,7 @@ typedef struct my_GParamSpecTypeInfo_s { uint16_t instance_size; uint16_t n_preallocs; void (*instance_init) (void* pspec); - int value_type; + size_t value_type; void (*finalize) (void* pspec); void (*value_set_default)(void* pspec, void* value); int (*value_validate) (void* pspec, void* value); @@ -666,7 +666,7 @@ EXPORT size_t my_g_type_register_fundamental(x64emu_t* emu, size_t parent, void* return my->g_type_register_fundamental(parent, name, findFreeGTypeInfo(info, parent), finfo, flags); } -EXPORT void my_g_value_register_transform_func(x64emu_t* emu, int src, int dst, void* f) +EXPORT void my_g_value_register_transform_func(x64emu_t* emu, size_t src, size_t dst, void* f) { gobject2_my_t *my = (gobject2_my_t*)my_lib->priv.w.p2; diff --git a/src/wrapped/wrappedgtkx112.c b/src/wrapped/wrappedgtkx112.c index 06db13c1..6be9e538 100755 --- a/src/wrapped/wrappedgtkx112.c +++ b/src/wrapped/wrappedgtkx112.c @@ -38,6 +38,7 @@ typedef void* (*pFpp_t)(void*, void*); typedef void* (*pFpi_t)(void*, int); typedef void* (*pFpL_t)(void*, size_t); typedef void (*vFpp_t)(void*, void*); +typedef void (*vFppi_t)(void*, void*, int); typedef void* (*pFppi_t)(void*, void*, int32_t); typedef void (*vFppA_t)(void*, void*, va_list); typedef int32_t (*iFppp_t)(void*, void*, void*); @@ -136,6 +137,8 @@ typedef void* (*pFpipppppppi_t)(void*, int, void*, void*, void*, void*, GO(gtk_list_store_insert_with_valuesv, vFppippi_t) \ GO(gtk_list_store_newv, pFip_t) \ GO(gtk_tree_store_newv, pFip_t) \ + GO(gtk_list_store_insert, vFppi_t) \ + GO(gtk_tree_model_get_valist, vFppA_t) \ @@ -1168,22 +1171,12 @@ EXPORT void my_gtk_list_store_insert_with_values(x64emu_t* emu, void* store, voi library_t * lib = GetLibInternal(libname); gtkx112_my_t *my = (gtkx112_my_t*)lib->priv.w.p2; - int n = 0; - // find the number of args - while((int)getVArgs(emu, 3, b, n*2)!=-1) - ++n; - int* columns = (int*)malloc(sizeof(int)*(n+1)); - void** values = (void**)malloc(sizeof(void*)*(n+1)); - for (int i=0; i<n; ++i) { - columns[i] = *(int*)getVArgs(emu, 3, b, i*2-2); - values[i] = (void*)getVArgs(emu, 3, b, i*2-2+1); - } - columns[n] = -1; - values[n] = NULL; + CREATE_VALIST_FROM_VAARG(b, emu->scratch, 3); + // not 100% exact, but better than nothing + my->gtk_list_store_insert(store, iter, pos); + my->gtk_list_store_set_valist(store, iter, VARARGS); - my->gtk_list_store_insert_with_valuesv(store, iter, pos, columns, values, n); - free(columns); - free(values); + //can't use gtk_list_store_insert_with_valuesv because that one use array or GValue, instead of brute value } EXPORT void* my_gtk_list_store_new(x64emu_t* emu, int n, uintptr_t* b) @@ -1208,6 +1201,24 @@ EXPORT void* my_gtk_tree_store_new(x64emu_t* emu, int n, uintptr_t* b) return my->gtk_tree_store_newv(n, a); } +EXPORT void my_gtk_tree_model_get_valist(x64emu_t* emu, void* tree, void* iter, x64_va_list_t V) +{ + library_t * lib = GetLibInternal(libname); + gtkx112_my_t *my = (gtkx112_my_t*)lib->priv.w.p2; + + CONVERT_VALIST(V); + my->gtk_tree_model_get_valist(tree, iter, VARARGS); +} + +EXPORT void my_gtk_tree_model_get(x64emu_t* emu, void* tree, void* iter, uintptr_t* b) +{ + library_t * lib = GetLibInternal(libname); + gtkx112_my_t *my = (gtkx112_my_t*)lib->priv.w.p2; + + CREATE_VALIST_FROM_VAARG(b, emu->scratch, 2); + my->gtk_tree_model_get_valist(tree, iter, VARARGS); +} + #define PRE_INIT \ if(box64_nogtk) \ return -1; diff --git a/src/wrapped/wrappedgtkx112_private.h b/src/wrapped/wrappedgtkx112_private.h index 571866b3..dbb5b53a 100755 --- a/src/wrapped/wrappedgtkx112_private.h +++ b/src/wrapped/wrappedgtkx112_private.h @@ -3285,7 +3285,7 @@ GO(gtk_tree_model_filter_get_type, LFv) //GO(gtk_tree_model_filter_set_visible_func, GO(gtk_tree_model_flags_get_type, LFv) GOM(gtk_tree_model_foreach, vFEppp) -//GO2(gtk_tree_model_get, vFppV, gtk_tree_model_get_valist) +GOM(gtk_tree_model_get, vFEppV) GO(gtk_tree_model_get_column_type, iFpi) GO(gtk_tree_model_get_flags, iFp) GO(gtk_tree_model_get_iter, iFppp) @@ -3295,7 +3295,7 @@ GO(gtk_tree_model_get_n_columns, iFp) GO(gtk_tree_model_get_path, pFpp) GO(gtk_tree_model_get_string_from_iter, pFpp) GO(gtk_tree_model_get_type, LFv) -//GO(gtk_tree_model_get_valist, vFppp) +GOM(gtk_tree_model_get_valist, vFEppA) GO(gtk_tree_model_get_value, vFppip) GO(gtk_tree_model_iter_children, iFppp) GO(gtk_tree_model_iter_has_child, iFpp) diff --git a/src/wrapped/wrappednspr4_private.h b/src/wrapped/wrappednspr4_private.h index 9ef4f7dc..ebea6961 100755 --- a/src/wrapped/wrappednspr4_private.h +++ b/src/wrapped/wrappednspr4_private.h @@ -42,7 +42,7 @@ //GO(PR_Cleanup, //GO(PR_ClearInterrupt, //GO(PR_ClearThreadGCAble, -//GO(PR_Close, +GO(PR_Close, iFp) //GO(PR_CloseDir, //GO(PR_CloseFileMap, //GO(PR_CloseSemaphore, @@ -150,7 +150,7 @@ //GO(PR_GetDirectorySepartor, //GO(PR_GetEnv, //GO(PR_GetEnvSecure, -//GO(PR_GetError, +GO(PR_GetError, iFv) //GO(PR_GetErrorText, //GO(PR_GetErrorTextLength, //GO(PR_GetFileInfo, @@ -214,12 +214,12 @@ //GO(PR_ImportFile, //GO(PR_ImportFileMapFromString, //GO(PR_ImportPipe, -//GO(PR_ImportTCPSocket, +GO(PR_ImportTCPSocket, pFi) //GO(PR_ImportUDPSocket, //GO(PR_IncrementCounter, GO(PR_Init, vFiii) //GO(PR_Initialize, -//GO(PR_Initialized, +GO(PR_Initialized, iFv) //GO(PR_InitializeNetAddr, //GO(PR_Interrupt, //GO(PR_IntervalNow, @@ -267,7 +267,7 @@ GO(PR_Init, vFiii) //GO(PR_NotifyAll, //GO(PR_NotifyAllCondVar, //GO(PR_NotifyCondVar, -//GO(PR_Now, +GO(PR_Now, pFv) //GO(PR_ntohl, //GO(PR_ntohll, //GO(PR_ntohs, @@ -304,7 +304,7 @@ GO(PR_Init, vFiii) //GO(PR_QueueJob_Read, //GO(PR_QueueJob_Timer, //GO(PR_QueueJob_Write, -//GO(PR_Read, +GO(PR_Read, iFppi) //GO(PR_ReadDir, //GO(PR_Realloc, //GO(PR_RecordTraceEntries, @@ -340,7 +340,7 @@ GO(PR_Init, vFiii) //GO(PR_SetLogFile, //GO(PR_SetNetAddr, //GO(PR_SetPollableEvent, -//GO(PR_SetSocketOption, +GO(PR_SetSocketOption, iFpp) //GO(PR_SetStdioRedirect, //GO(PR_SetSysfdTableSize, //GO(PR_SetThreadAffinityMask, @@ -395,7 +395,7 @@ GO(PR_Init, vFiii) //GO(PR_WaitRecvReady, //GO(PR_WaitSem, //GO(PR_WaitSemaphore, -//GO(PR_Write, +GO(PR_Write, iFppi) //GO(PR_Writev, //GO(PR_Yield, //GO(PT_FPrintStats, diff --git a/src/wrapped/wrappednss3_private.h b/src/wrapped/wrappednss3_private.h index a4793d7d..0a9d1618 100755 --- a/src/wrapped/wrappednss3_private.h +++ b/src/wrapped/wrappednss3_private.h @@ -149,7 +149,7 @@ //GO(CERT_GenTime2FormattedAscii, //GO(CERT_GetAVATag, //GO(CERT_GetCertChainFromCert, -//GO(CERT_GetCertEmailAddress, +GO(CERT_GetCertEmailAddress, pFp) //GO(CERT_GetCertificateDer, //GO(CERT_GetCertificateNames, //GO(CERT_GetCertificateRequestExtensions, @@ -160,21 +160,21 @@ //GO(CERT_GetCertNicknames, //GO(CERT_GetCertTimes, //GO(CERT_GetCertTrust, -//GO(CERT_GetCertUid, +GO(CERT_GetCertUid, pFp) //GO(CERT_GetClassicOCSPDisabledPolicy, //GO(CERT_GetClassicOCSPEnabledHardFailurePolicy, //GO(CERT_GetClassicOCSPEnabledSoftFailurePolicy, -//GO(CERT_GetCommonName, +GO(CERT_GetCommonName, pFp) //GO(CERT_GetConstrainedCertificateNames, -//GO(CERT_GetCountryName, +GO(CERT_GetCountryName, pFp) //GO(CERT_GetDBContentVersion, //GO(CERT_GetDefaultCertDB, -//GO(CERT_GetDomainComponentName, +GO(CERT_GetDomainComponentName, pFp) //GO(CERT_GetEncodedOCSPResponse, //GO(CERT_GetFirstEmailAddress, //GO(CERT_GetGeneralNameTypeFromString, //GO(CERT_GetImposedNameConstraints, -//GO(CERT_GetLocalityName, +GO(CERT_GetLocalityName, pFp) //GO(CERT_GetNextEmailAddress, //GO(CERT_GetNextGeneralName, //GO(CERT_GetNextNameConstraint, @@ -182,14 +182,14 @@ //GO(CERT_GetOCSPResponseStatus, //GO(CERT_GetOCSPStatusForCertID, //GO(CERT_GetOidString, -//GO(CERT_GetOrgName, -//GO(CERT_GetOrgUnitName, +GO(CERT_GetOrgName, pFp) +GO(CERT_GetOrgUnitName, pFp) //GO(CERT_GetPKIXVerifyNistRevocationPolicy, //GO(CERT_GetPrevGeneralName, //GO(CERT_GetPrevNameConstraint, //GO(CERT_GetSlopTime, //GO(CERT_GetSSLCACerts, -//GO(CERT_GetStateName, +GO(CERT_GetStateName, pFp) //GO(CERT_GetSubjectNameDigest, //GO(CERT_GetSubjectPublicKeyDigest, //GO(CERT_GetUsePKIXForValidation, diff --git a/src/wrapped/wrappedplc4.c b/src/wrapped/wrappedplc4.c new file mode 100755 index 00000000..1f6e7797 --- /dev/null +++ b/src/wrapped/wrappedplc4.c @@ -0,0 +1,18 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include <dlfcn.h> + +#include "wrappedlibs.h" + +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" + +const char* plc4Name = "libplc4.so"; +#define LIBNAME plc4 + +#include "wrappedlib_init.h" + diff --git a/src/wrapped/wrappedplc4_private.h b/src/wrapped/wrappedplc4_private.h new file mode 100755 index 00000000..ae4adeec --- /dev/null +++ b/src/wrapped/wrappedplc4_private.h @@ -0,0 +1,44 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh.... +#endif + +//GO(PL_Base64Decode, +//GO(PL_Base64Encode, +//GO(PL_CreateLongOptState, +//GO(PL_CreateOptState, +//GO(PL_DestroyOptState, +//GO(PL_FPrintError, +//GO(PL_GetNextOpt, +//GO(PL_PrintError, +//GO(PL_strcasecmp, +//GO(PL_strcaserstr, +//GO(PL_strcasestr, +//GO(PL_strcat, +//GO(PL_strcatn, +//GO(PL_strchr, +//GO(PL_strcmp, +//GO(PL_strcpy, +//GO(PL_strdup, +//GO(PL_strfree, +//GO(PL_strlen, +//GO(PL_strncasecmp, +//GO(PL_strncaserstr, +//GO(PL_strncasestr, +//GO(PL_strncat, +//GO(PL_strnchr, +//GO(PL_strncmp, +//GO(PL_strncpy, +//GO(PL_strncpyz, +//GO(PL_strndup, +//GO(PL_strnlen, +//GO(PL_strnpbrk, +//GO(PL_strnprbrk, +//GO(PL_strnrchr, +//GO(PL_strnrstr, +//GO(PL_strnstr, +//GO(PL_strpbrk, +//GO(PL_strprbrk, +//GO(PL_strrchr, +//GO(PL_strrstr, +//GO(PL_strstr, +//GO(PL_strtok_r, \ No newline at end of file diff --git a/src/wrapped/wrappedplds4.c b/src/wrapped/wrappedplds4.c new file mode 100755 index 00000000..f3a94af3 --- /dev/null +++ b/src/wrapped/wrappedplds4.c @@ -0,0 +1,18 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include <dlfcn.h> + +#include "wrappedlibs.h" + +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" + +const char* plds4Name = "libplds4.so"; +#define LIBNAME plds4 + +#include "wrappedlib_init.h" + diff --git a/src/wrapped/wrappedplds4_private.h b/src/wrapped/wrappedplds4_private.h new file mode 100755 index 00000000..ccf0049c --- /dev/null +++ b/src/wrapped/wrappedplds4_private.h @@ -0,0 +1,29 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh.... +#endif + +//GO(PL_ArenaAllocate, +//GO(PL_ArenaFinish, +//GO(PL_ArenaGrow, +//GO(PL_ArenaRelease, +//GO(PL_ClearArenaPool, +//GO(PL_CompactArenaPool, +//GO(PL_CompareStrings, +//GO(PL_CompareValues, +//GO(PL_FinishArenaPool, +//GO(PL_FreeArenaPool, +//GO(PL_HashString, +//GO(PL_HashTableAdd, +//GO(PL_HashTableDestroy, +//GO(PL_HashTableDump, +//GO(PL_HashTableEnumerateEntries, +//GO(PL_HashTableLookup, +//GO(PL_HashTableLookupConst, +//GO(PL_HashTableRawAdd, +//GO(PL_HashTableRawLookup, +//GO(PL_HashTableRawLookupConst, +//GO(PL_HashTableRawRemove, +//GO(PL_HashTableRemove, +//GO(PL_InitArenaPool, +//GO(PL_NewHashTable, +//GO(PL_SizeOfArenaPoolExcludingPool, \ No newline at end of file diff --git a/src/wrapped/wrappedssl3.c b/src/wrapped/wrappedssl3.c new file mode 100755 index 00000000..45bf1a0a --- /dev/null +++ b/src/wrapped/wrappedssl3.c @@ -0,0 +1,18 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include <dlfcn.h> + +#include "wrappedlibs.h" + +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" + +const char* ssl3Name = "libssl3.so"; +#define LIBNAME ssl3 + +#include "wrappedlib_init.h" + diff --git a/src/wrapped/wrappedssl3_private.h b/src/wrapped/wrappedssl3_private.h new file mode 100755 index 00000000..174b4c1c --- /dev/null +++ b/src/wrapped/wrappedssl3_private.h @@ -0,0 +1,109 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh.... +#endif + +//GO(DTLS_GetHandshakeTimeout, +//GO(DTLS_ImportFD, +//GO(NSS_CmpCertChainWCANames, +//GO(NSS_FindCertKEAType, +//GO(NSS_GetClientAuthData, +//GO(NSS_SetDomesticPolicy, +//GO(NSS_SetExportPolicy, +//GO(NSS_SetFrancePolicy, +//GO(NSSSSL_GetVersion, +//GO(NSSSSL_VersionCheck, +//GO(SSL_AlertReceivedCallback, +//GO(SSL_AlertSentCallback, +//GO(SSL_AuthCertificate, +//GO(SSL_AuthCertificateComplete, +//GO(SSL_AuthCertificateHook, +//GO(SSL_BadCertHook, +//GO(SSL_CanBypass, +//GO(SSL_CertDBHandleSet, +//GO(SSL_CipherPolicyGet, +//GO(SSL_CipherPolicySet, +//GO(SSL_CipherPrefGet, +//GO(SSL_CipherPrefGetDefault, +//GO(SSL_CipherPrefSet, +//GO(SSL_CipherPrefSetDefault, +//GO(SSL_ClearSessionCache, +//GO(SSL_ConfigMPServerSIDCache, +//GO(SSL_ConfigSecureServer, +//GO(SSL_ConfigSecureServerWithCertChain, +//GO(SSL_ConfigServerCert, +//GO(SSL_ConfigServerSessionIDCache, +//GO(SSL_ConfigServerSessionIDCacheWithOpt, +//GO(SSL_DataPending, +//GO(SSL_DHEGroupPrefSet, +//GO(SSL_EnableWeakDHEPrimeGroup, +//GO(SSL_ExportEarlyKeyingMaterial, +//GO(SSL_ExportKeyingMaterial, +//GO(SSL_ForceHandshake, +//GO(SSL_ForceHandshakeWithTimeout, +//GO(SSL_GetChannelInfo, +//GO(SSL_GetCipherSuiteInfo, +//GO(SSL_GetClientAuthDataHook, +//GO(SSL_GetExperimentalAPI, +//GO(SSL_GetImplementedCiphers, +//GO(SSL_GetMaxServerCacheLocks, +//GO(SSL_GetNegotiatedHostInfo, +//GO(SSL_GetNextProto, +//GO(SSL_GetNumImplementedCiphers, +//GO(SSL_GetPreliminaryChannelInfo, +//GO(SSL_GetSessionID, +//GO(SSL_GetSRTPCipher, +//GO(SSL_GetStatistics, +//GO(SSL_HandshakeCallback, +//GO(SSL_HandshakeNegotiatedExtension, +//GO(SSL_ImportFD, +//GO(SSL_InheritMPServerSIDCache, +//GO(SSL_InvalidateSession, +//GO(SSL_LocalCertificate, +//GO(SSL_NamedGroupConfig, +//GO(SSL_OptionGet, +//GO(SSL_OptionGetDefault, +//GO(SSL_OptionSet, +//GO(SSL_OptionSetDefault, +//GO(SSL_PeerCertificate, +//GO(SSL_PeerCertificateChain, +//GO(SSL_PeerSignedCertTimestamps, +//GO(SSL_PeerStapledOCSPResponses, +//GO(SSL_PreencryptedFileToStream, +//GO(SSL_PreencryptedStreamToFile, +//GO(SSL_RecommendedCanFalseStart, +//GO(SSL_ReconfigFD, +//GO(SSL_ReHandshake, +//GO(SSL_ReHandshakeWithTimeout, +//GO(SSL_ResetHandshake, +//GO(SSL_RestartHandshakeAfterCertReq, +//GO(SSL_RestartHandshakeAfterServerCert, +//GO(SSL_RevealCert, +//GO(SSL_RevealPinArg, +//GO(SSL_RevealURL, +//GO(SSL_SecurityStatus, +//GO(SSL_SendAdditionalKeyShares, +//GO(SSL_SetCanFalseStartCallback, +//GO(SSL_SetDowngradeCheckVersion, +//GO(SSL_SetMaxServerCacheLocks, +//GO(SSL_SetNextProtoCallback, +//GO(SSL_SetNextProtoNego, +//GO(SSL_SetPKCS11PinArg, +//GO(SSL_SetSessionTicketKeyPair, +//GO(SSL_SetSignedCertTimestamps, +//GO(SSL_SetSockPeerID, +//GO(SSL_SetSRTPCiphers, +//GO(SSL_SetStapledOCSPResponses, +//GO(SSL_SetTrustAnchors, +//GO(SSL_SetURL, +//GO(SSL_ShutdownServerSessionIDCache, +//GO(SSL_SignatureMaxCount, +//GO(SSL_SignaturePrefGet, +//GO(SSL_SignaturePrefSet, +//GO(SSL_SignatureSchemePrefGet, +//GO(SSL_SignatureSchemePrefSet, +//GO(SSL_SNISocketConfigHook, +//GO(SSL_VersionRangeGet, +//GO(SSL_VersionRangeGetDefault, +//GO(SSL_VersionRangeGetSupported, +//GO(SSL_VersionRangeSet, +//GO(SSL_VersionRangeSetDefault, \ No newline at end of file |