static gpointer do_init (gpointer data) { cs_opt_mem gum_cs_mem_callbacks = { gum_capstone_malloc, gum_capstone_calloc, gum_capstone_realloc, gum_capstone_free, gum_vsnprintf }; gum_memory_init (); #if GLIB_CHECK_VERSION (2, 46, 0) glib_init (); gio_init (); #endif cs_option (0, CS_OPT_MEM, GPOINTER_TO_SIZE (&gum_cs_mem_callbacks)); _gum_tls_init (); _gum_interceptor_init (); _gum_tls_realize (); return NULL; }
static gpointer do_init (gpointer data) { GumFeatureFlags features = (GumFeatureFlags) GPOINTER_TO_INT (data); cs_opt_mem gum_cs_mem_callbacks = { gum_capstone_malloc, gum_capstone_calloc, gum_capstone_realloc, gum_capstone_free, gum_vsnprintf }; (void) features; page_size = gum_query_page_size (); gum_memory_init (); #if GLIB_CHECK_VERSION (2, 42, 0) glib_init (); gio_init (); #endif cs_option (0, CS_OPT_MEM, GPOINTER_TO_SIZE (&gum_cs_mem_callbacks)); #ifdef HAVE_SYMBOL_BACKEND if ((features & GUM_FEATURE_SYMBOL_LOOKUP) != 0) _gum_symbol_util_init (); #endif _gum_interceptor_init (); return NULL; }
static void init () { #if GLIB_CHECK_VERSION (2, 46, 0) glib_init (); gio_init (); #endif gum_init (); }
void frida_server_environment_init (void) { g_assertion_set_handler (frida_server_on_assert_failure, NULL); g_log_set_default_handler (frida_server_on_log_message, NULL); g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); gio_init (); gum_init (); }
void frida_init (void) { static gsize frida_initialized = FALSE; #if GLIB_CHECK_VERSION (2, 46, 0) glib_init (); gio_init (); #endif frida_error_quark (); /* Initialize early so GDBus will pick it up */ if (g_once_init_enter (&frida_initialized)) { main_context = g_main_context_ref (g_main_context_default ()); main_loop = g_main_loop_new (main_context, FALSE); main_thread = g_thread_new ("frida-main-loop", run_main_loop, NULL); g_once_init_leave (&frida_initialized, TRUE); } }
void frida_agent_environment_init (void) { GMemVTable mem_vtable = { gum_malloc, gum_realloc, gum_free, gum_calloc, gum_malloc, gum_realloc }; #if defined (G_OS_WIN32) && DEBUG_HEAP_LEAKS int tmp_flag; /*_CrtSetBreakAlloc (1337);*/ _CrtSetReportMode (_CRT_ERROR, _CRTDBG_MODE_FILE); _CrtSetReportFile (_CRT_ERROR, _CRTDBG_FILE_STDERR); tmp_flag = _CrtSetDbgFlag (_CRTDBG_REPORT_FLAG); tmp_flag |= _CRTDBG_ALLOC_MEM_DF; tmp_flag |= _CRTDBG_LEAK_CHECK_DF; tmp_flag &= ~_CRTDBG_CHECK_CRT_DF; _CrtSetDbgFlag (tmp_flag); #endif gum_memory_init (); g_mem_set_vtable (&mem_vtable); #if DEBUG_HEAP_LEAKS g_setenv ("G_SLICE", "always-malloc", TRUE); #endif glib_init (); g_log_set_default_handler (frida_agent_on_log_message, NULL); g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); gio_init (); gum_init (); }
void frida_init (void) { static gsize frida_initialized = FALSE; g_thread_set_garbage_handler (frida_on_pending_garbage, NULL); glib_init (); gio_init (); gum_init (); frida_error_quark (); /* Initialize early so GDBus will pick it up */ if (g_once_init_enter (&frida_initialized)) { g_set_prgname ("frida"); main_context = g_main_context_ref (g_main_context_default ()); main_loop = g_main_loop_new (main_context, FALSE); main_thread = g_thread_new ("frida-main-loop", run_main_loop, NULL); g_once_init_leave (&frida_initialized, TRUE); } }
static void gum_do_init (void) { cs_opt_mem gum_cs_mem_callbacks = { gum_cs_malloc, gum_cs_calloc, gum_cs_realloc, gum_cs_free, (cs_vsnprintf_t) gum_vsnprintf }; gum_memory_init (); glib_init (); gobject_init (); gio_init (); cs_option (0, CS_OPT_MEM, GPOINTER_TO_SIZE (&gum_cs_mem_callbacks)); _gum_tls_init (); _gum_interceptor_init (); _gum_tls_realize (); }
static gnome_vfs_init_function gnome_vfs_init; static gnome_vfs_mime_type_from_name_function gnome_vfs_mime_type_from_name; #include "sun_nio_fs_GnomeFileTypeDetector.h" JNIEXPORT jboolean JNICALL Java_sun_nio_fs_GnomeFileTypeDetector_initializeGio (JNIEnv* env, jclass this) { jboolean ret; #ifdef USE_SYSTEM_GIO ret = JNI_TRUE; #else ret = gio_init(); #endif // If there was an error initializing GIO, return false immediately if (ret == JNI_FALSE) { return ret; } g_type_init (); return ret; } JNIEXPORT jbyteArray JNICALL Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGio (JNIEnv* env, jclass this, jlong pathAddress)