diff --git a/bindings/gumjs/gumquickprocess.c b/bindings/gumjs/gumquickprocess.c index 7a5f87a8f6..82051f88ed 100644 --- a/bindings/gumjs/gumquickprocess.c +++ b/bindings/gumjs/gumquickprocess.c @@ -660,7 +660,7 @@ GUMJS_DEFINE_FUNCTION (gumjs_process_run_on_thread) stalker = gum_stalker_new (); - success = gum_stalker_run_on_thread_async (stalker, thread_id, + success = gum_stalker_run_on_thread (stalker, thread_id, gum_js_process_run_cb, &sync_ctx); _gum_quick_scope_resume (&scope); diff --git a/bindings/gumjs/gumv8process.cpp b/bindings/gumjs/gumv8process.cpp index 0b28cb2872..f449cec829 100644 --- a/bindings/gumjs/gumv8process.cpp +++ b/bindings/gumjs/gumv8process.cpp @@ -552,7 +552,7 @@ GUMJS_DEFINE_FUNCTION (gumjs_process_run_on_thread) sync_ctx.context = context; sync_ctx.user_func = Local::New (isolate, user_func); - success = gum_stalker_run_on_thread_async (stalker, thread_id, + success = gum_stalker_run_on_thread (stalker, thread_id, gum_js_process_run_cb, &sync_ctx); } diff --git a/gum/backend-arm/gumstalker-arm.c b/gum/backend-arm/gumstalker-arm.c index 3082698581..22bebd4ec3 100644 --- a/gum/backend-arm/gumstalker-arm.c +++ b/gum/backend-arm/gumstalker-arm.c @@ -714,7 +714,7 @@ static gboolean gum_is_exclusive_store_insn (const cs_insn * insn); static guint gum_count_bits_set (guint16 value); static guint gum_count_trailing_zeros (guint16 value); -static void gum_stalker_do_run_on_thread_async (GumThreadId thread_id, +static void gum_stalker_do_run_on_thread (GumThreadId thread_id, GumCpuContext * cpu_context, gpointer user_data); G_DEFINE_TYPE (GumStalker, gum_stalker, G_TYPE_OBJECT) @@ -6221,23 +6221,23 @@ gum_stalker_is_run_on_thread_supported (void) } gboolean -gum_stalker_run_on_thread_async (GumStalker * self, - GumThreadId thread_id, - GumStalkerRunOnThreadFunc func, - gpointer user_data) +gum_stalker_run_on_thread (GumStalker * self, + GumThreadId thread_id, + GumStalkerRunOnThreadFunc func, + gpointer user_data) { GumStalkerRunOnThreadCtx ctx; ctx.stalker = self; ctx.func = func; ctx.user_data = user_data; - return gum_process_modify_thread (thread_id, - gum_stalker_do_run_on_thread_async, &ctx, GUM_MODIFY_THREAD_FLAGS_NONE); + return gum_process_modify_thread (thread_id, gum_stalker_do_run_on_thread, + &ctx, GUM_MODIFY_THREAD_FLAGS_NONE); } static void -gum_stalker_do_run_on_thread_async (GumThreadId thread_id, - GumCpuContext * cpu_context, - gpointer user_data) +gum_stalker_do_run_on_thread (GumThreadId thread_id, + GumCpuContext * cpu_context, + gpointer user_data) { GumStalkerRunOnThreadCtx * run_ctx = (GumStalkerRunOnThreadCtx *) user_data; GumStalker * self = run_ctx->stalker; diff --git a/gum/backend-arm64/gumstalker-arm64.c b/gum/backend-arm64/gumstalker-arm64.c index 25868c784c..e63febbf2f 100644 --- a/gum/backend-arm64/gumstalker-arm64.c +++ b/gum/backend-arm64/gumstalker-arm64.c @@ -769,7 +769,7 @@ static gpointer gum_find_thread_exit_implementation (void); static gboolean gum_is_bl_imm (guint32 insn) G_GNUC_UNUSED; -static void gum_stalker_do_run_on_thread_async (GumThreadId thread_id, +static void gum_stalker_do_run_on_thread (GumThreadId thread_id, GumCpuContext * cpu_context, gpointer user_data); G_DEFINE_TYPE (GumStalker, gum_stalker, G_TYPE_OBJECT) @@ -5905,23 +5905,23 @@ gum_stalker_is_run_on_thread_supported (void) } gboolean -gum_stalker_run_on_thread_async (GumStalker * self, - GumThreadId thread_id, - GumStalkerRunOnThreadFunc func, - gpointer user_data) +gum_stalker_run_on_thread (GumStalker * self, + GumThreadId thread_id, + GumStalkerRunOnThreadFunc func, + gpointer user_data) { GumStalkerRunOnThreadCtx ctx; ctx.stalker = self; ctx.func = func; ctx.user_data = user_data; - return gum_process_modify_thread (thread_id, - gum_stalker_do_run_on_thread_async, &ctx, GUM_MODIFY_THREAD_FLAGS_NONE); + return gum_process_modify_thread (thread_id, gum_stalker_do_run_on_thread, + &ctx, GUM_MODIFY_THREAD_FLAGS_NONE); } static void -gum_stalker_do_run_on_thread_async (GumThreadId thread_id, - GumCpuContext * cpu_context, - gpointer user_data) +gum_stalker_do_run_on_thread (GumThreadId thread_id, + GumCpuContext * cpu_context, + gpointer user_data) { GumStalkerRunOnThreadCtx * run_ctx = (GumStalkerRunOnThreadCtx *) user_data; GumStalker * self = run_ctx->stalker; diff --git a/gum/backend-mips/gumstalker-mips.c b/gum/backend-mips/gumstalker-mips.c index b168286b94..7cf6e69b78 100644 --- a/gum/backend-mips/gumstalker-mips.c +++ b/gum/backend-mips/gumstalker-mips.c @@ -216,10 +216,10 @@ gum_stalker_is_run_on_thread_supported (void) } gboolean -gum_stalker_run_on_thread_async (GumStalker * self, - GumThreadId thread_id, - GumStalkerRunOnThreadFunc func, - gpointer user_data) +gum_stalker_run_on_thread (GumStalker * self, + GumThreadId thread_id, + GumStalkerRunOnThreadFunc func, + gpointer user_data) { return FALSE; } diff --git a/gum/backend-x86/gumstalker-x86.c b/gum/backend-x86/gumstalker-x86.c index 1d790ec26d..6801e39b68 100644 --- a/gum/backend-x86/gumstalker-x86.c +++ b/gum/backend-x86/gumstalker-x86.c @@ -874,7 +874,7 @@ static GumInterceptor * gum_exec_ctx_interceptor = NULL; # endif #endif -static void gum_stalker_do_run_on_thread_async (GumThreadId thread_id, +static void gum_stalker_do_run_on_thread (GumThreadId thread_id, GumCpuContext * cpu_context, gpointer user_data); gboolean @@ -6661,23 +6661,23 @@ gum_stalker_is_run_on_thread_supported (void) } gboolean -gum_stalker_run_on_thread_async (GumStalker * self, - GumThreadId thread_id, - GumStalkerRunOnThreadFunc func, - gpointer user_data) +gum_stalker_run_on_thread (GumStalker * self, + GumThreadId thread_id, + GumStalkerRunOnThreadFunc func, + gpointer user_data) { GumStalkerRunOnThreadCtx ctx; ctx.stalker = self; ctx.func = func; ctx.user_data = user_data; - return gum_process_modify_thread (thread_id, - gum_stalker_do_run_on_thread_async, &ctx, GUM_MODIFY_THREAD_FLAGS_NONE); + return gum_process_modify_thread (thread_id, gum_stalker_do_run_on_thread, + &ctx, GUM_MODIFY_THREAD_FLAGS_NONE); } static void -gum_stalker_do_run_on_thread_async (GumThreadId thread_id, - GumCpuContext * cpu_context, - gpointer user_data) +gum_stalker_do_run_on_thread (GumThreadId thread_id, + GumCpuContext * cpu_context, + gpointer user_data) { GumStalkerRunOnThreadCtx * run_ctx = (GumStalkerRunOnThreadCtx *) user_data; GumStalker * self = run_ctx->stalker; diff --git a/gum/gumstalker.c b/gum/gumstalker.c index 707a7e8bd2..306d6e408b 100644 --- a/gum/gumstalker.c +++ b/gum/gumstalker.c @@ -439,7 +439,7 @@ gum_stalker_run_on_thread_sync (GumStalker * self, if (gum_process_get_current_thread_id () == thread_id) { - return gum_stalker_run_on_thread_async (self, thread_id, func, user_data); + return gum_stalker_run_on_thread (self, thread_id, func, user_data); } else { @@ -450,7 +450,7 @@ gum_stalker_run_on_thread_sync (GumStalker * self, ctx.user_data = user_data; g_mutex_lock (&ctx.mutex); - if (!gum_stalker_run_on_thread_async (self, thread_id, + if (!gum_stalker_run_on_thread (self, thread_id, gum_stalker_do_run_on_thread_sync, &ctx)) { return FALSE; diff --git a/gum/gumstalker.h b/gum/gumstalker.h index 450888896e..2617b8a90c 100644 --- a/gum/gumstalker.h +++ b/gum/gumstalker.h @@ -279,7 +279,7 @@ GUM_API void gum_stalker_observer_switch_callback ( GUM_API gboolean gum_stalker_is_run_on_thread_supported (void); -GUM_API gboolean gum_stalker_run_on_thread_async (GumStalker * self, +GUM_API gboolean gum_stalker_run_on_thread (GumStalker * self, GumThreadId thread_id, GumStalkerRunOnThreadFunc func, gpointer user_data); GUM_API gboolean gum_stalker_run_on_thread_sync (GumStalker * self, diff --git a/tests/core/arch-arm/stalker-arm.c b/tests/core/arch-arm/stalker-arm.c index 8f1e9a5b47..7d3b2e42b8 100644 --- a/tests/core/arch-arm/stalker-arm.c +++ b/tests/core/arch-arm/stalker-arm.c @@ -128,9 +128,9 @@ TESTLIST_BEGIN (stalker) #endif TESTGROUP_BEGIN ("RunOnThread") TESTENTRY (run_on_thread_support) - TESTENTRY (run_on_thread_current_async) + TESTENTRY (run_on_thread_current) TESTENTRY (run_on_thread_current_sync) - TESTENTRY (run_on_thread_other_async) + TESTENTRY (run_on_thread_other) TESTENTRY (run_on_thread_other_sync) TESTGROUP_END () TESTLIST_END () @@ -3809,13 +3809,13 @@ TESTCASE (run_on_thread_support) g_assert_true (supported); } -TESTCASE (run_on_thread_current_async) +TESTCASE (run_on_thread_current) { GumThreadId thread_id = gum_process_get_current_thread_id (); RunOnThreadCtx ctx; gboolean success; - success = gum_stalker_run_on_thread_async (fixture->stalker, thread_id, + success = gum_stalker_run_on_thread (fixture->stalker, thread_id, run_on_thread, &ctx); #if defined (HAVE_ANDROID) @@ -3859,7 +3859,7 @@ run_on_thread (const GumCpuContext * cpu_context, gpointer user_data) ctx->thread_id = gum_process_get_current_thread_id (); } -TESTCASE (run_on_thread_other_async) +TESTCASE (run_on_thread_other) { GumThreadId this_id, other_id; volatile gboolean done = FALSE; @@ -3869,8 +3869,7 @@ TESTCASE (run_on_thread_other_async) this_id = gum_process_get_current_thread_id (); thread = create_sleeping_dummy_thread_sync (&done, &other_id); - gum_stalker_run_on_thread_async (fixture->stalker, other_id, run_on_thread, - &ctx); + gum_stalker_run_on_thread (fixture->stalker, other_id, run_on_thread, &ctx); done = TRUE; g_thread_join (thread); diff --git a/tests/core/arch-arm64/stalker-arm64.c b/tests/core/arch-arm64/stalker-arm64.c index b20e496895..196a9b2757 100644 --- a/tests/core/arch-arm64/stalker-arm64.c +++ b/tests/core/arch-arm64/stalker-arm64.c @@ -82,9 +82,9 @@ TESTLIST_BEGIN (stalker) #endif TESTGROUP_BEGIN ("RunOnThread") TESTENTRY (run_on_thread_support) - TESTENTRY (run_on_thread_current_async) + TESTENTRY (run_on_thread_current) TESTENTRY (run_on_thread_current_sync) - TESTENTRY (run_on_thread_other_async) + TESTENTRY (run_on_thread_other) TESTENTRY (run_on_thread_other_sync) TESTGROUP_END () TESTLIST_END () @@ -2427,13 +2427,13 @@ TESTCASE (run_on_thread_support) g_assert_true (supported); } -TESTCASE (run_on_thread_current_async) +TESTCASE (run_on_thread_current) { GumThreadId thread_id = gum_process_get_current_thread_id (); RunOnThreadCtx ctx; gboolean success; - success = gum_stalker_run_on_thread_async (fixture->stalker, thread_id, + success = gum_stalker_run_on_thread (fixture->stalker, thread_id, run_on_thread, &ctx); #if defined (HAVE_ANDROID) @@ -2477,7 +2477,7 @@ run_on_thread (const GumCpuContext * cpu_context, gpointer user_data) ctx->thread_id = gum_process_get_current_thread_id (); } -TESTCASE (run_on_thread_other_async) +TESTCASE (run_on_thread_other) { GumThreadId this_id, other_id; volatile gboolean done = FALSE; @@ -2487,8 +2487,7 @@ TESTCASE (run_on_thread_other_async) this_id = gum_process_get_current_thread_id (); thread = create_sleeping_dummy_thread_sync (&done, &other_id); - gum_stalker_run_on_thread_async (fixture->stalker, other_id, run_on_thread, - &ctx); + gum_stalker_run_on_thread (fixture->stalker, other_id, run_on_thread, &ctx); done = TRUE; g_thread_join (thread); diff --git a/tests/core/arch-x86/stalker-x86.c b/tests/core/arch-x86/stalker-x86.c index 5f97b7f2d9..4092cbdbfa 100644 --- a/tests/core/arch-x86/stalker-x86.c +++ b/tests/core/arch-x86/stalker-x86.c @@ -122,9 +122,9 @@ TESTLIST_BEGIN (stalker) #endif TESTGROUP_BEGIN ("RunOnThread") TESTENTRY (run_on_thread_support) - TESTENTRY (run_on_thread_current_async) + TESTENTRY (run_on_thread_current) TESTENTRY (run_on_thread_current_sync) - TESTENTRY (run_on_thread_other_async) + TESTENTRY (run_on_thread_other) TESTENTRY (run_on_thread_other_sync) TESTGROUP_END () TESTLIST_END () @@ -3518,13 +3518,13 @@ TESTCASE (run_on_thread_support) g_assert_true (supported); } -TESTCASE (run_on_thread_current_async) +TESTCASE (run_on_thread_current) { GumThreadId thread_id = gum_process_get_current_thread_id (); RunOnThreadCtx ctx; gboolean success; - success = gum_stalker_run_on_thread_async (fixture->stalker, thread_id, + success = gum_stalker_run_on_thread (fixture->stalker, thread_id, run_on_thread, &ctx); #if defined (HAVE_ANDROID) @@ -3568,7 +3568,7 @@ run_on_thread (const GumCpuContext * cpu_context, gpointer user_data) ctx->thread_id = gum_process_get_current_thread_id (); } -TESTCASE (run_on_thread_other_async) +TESTCASE (run_on_thread_other) { GumThreadId this_id, other_id; volatile gboolean done = FALSE; @@ -3578,8 +3578,7 @@ TESTCASE (run_on_thread_other_async) this_id = gum_process_get_current_thread_id (); thread = create_sleeping_dummy_thread_sync (&done, &other_id); - gum_stalker_run_on_thread_async (fixture->stalker, other_id, run_on_thread, - &ctx); + gum_stalker_run_on_thread (fixture->stalker, other_id, run_on_thread, &ctx); done = TRUE; g_thread_join (thread); diff --git a/tests/gumjs/script.c b/tests/gumjs/script.c index bf67366272..982da3343a 100644 --- a/tests/gumjs/script.c +++ b/tests/gumjs/script.c @@ -202,7 +202,7 @@ TESTLIST_BEGIN (script) TESTGROUP_BEGIN ("RunOnThread") TESTENTRY (process_can_run_on_thread_sync) - TESTENTRY (process_can_run_on_thread_async) + TESTENTRY (process_can_run_on_thread) TESTGROUP_END () TESTGROUP_BEGIN ("Module") @@ -5338,7 +5338,7 @@ TESTCASE (process_can_run_on_thread_sync) g_thread_join (thread); } -TESTCASE (process_can_run_on_thread_async) +TESTCASE (process_can_run_on_thread) { GThread * thread; GumThreadId thread_id;