aboutsummaryrefslogtreecommitdiff
path: root/lib/substitute.h
diff options
context:
space:
mode:
authorcomex2015-02-18 02:22:36 -0500
committercomex2015-02-18 02:22:36 -0500
commit7c26a1964d2d2e54f87d9c42735f6c99b546abd4 (patch)
treef50838e492aa101a4d87e6ef01d1dc2611f32f97 /lib/substitute.h
parentmore fixes (diff)
downloadsubstitute-7c26a1964d2d2e54f87d9c42735f6c99b546abd4.tar.gz
Fix hook-function:
- Thread stoppage is now complemented by sigaction to catch injected threads (sigaction is not used exclusively because the rest of the program could be trying to use sigaction itself in the meantime - this is a real thing, ask Dolphin) - mprotect is no longer used due to max_protection possibly getting in the way; instead, a copy is created and mapped onto the original.
Diffstat (limited to '')
-rw-r--r--lib/substitute.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/substitute.h b/lib/substitute.h
index 8764bcf..2045c3d 100644
--- a/lib/substitute.h
+++ b/lib/substitute.h
@@ -37,9 +37,8 @@ enum {
/* out of memory */
SUBSTITUTE_ERR_OOM,
- /* substitute_hook_functions: mmap or mprotect failure other than ENOMEM
- * (preserved in errno on return)
- * substitute_hook_functions: vm_region failure (errno = 0)
+ /* substitute_hook_functions: mmap, mprotect, vm_copy, or
+ * vm_remap failure
* substitute_hook_objc_message: vm_remap failure
* Most likely to come up with substitute_hook_functions if the kernel is
* preventing pages from being marked executable. */
@@ -48,7 +47,7 @@ enum {
/* substitute_hook_functions: not on the main thread (so stopping all other
* threads would be unsafe, as concurrent attempts to do the same from
* other threads would result in deadlock), and you did not pass
- * SUBSTITUTE_DONT_STOP_THREADS */
+ * SUBSTITUTE_NO_THREAD_SAFETY */
SUBSTITUTE_ERR_NOT_ON_MAIN_THREAD,
/* substitute_hook_functions: when trying to patch the PC of other threads
@@ -86,7 +85,7 @@ const char *substitute_strerror(int err);
/* substitute_hook_functions options */
enum {
- SUBSTITUTE_DONT_STOP_THREADS = 1,
+ SUBSTITUTE_NO_THREAD_SAFETY = 1,
};
/* TODO doc */