aboutsummaryrefslogtreecommitdiff
path: root/lib/hook-functions.c
diff options
context:
space:
mode:
authorcomex2015-02-08 23:45:24 -0500
committercomex2015-02-08 23:45:24 -0500
commiteb93cee2a22cde812ccd6b9bd418d36185c058f5 (patch)
tree43a22ccf021a1513dba3a9c99f7b81822fe950fa /lib/hook-functions.c
parentformatting (diff)
downloadsubstitute-eb93cee2a22cde812ccd6b9bd418d36185c058f5.tar.gz
Refactor disassembly so x86 works, and add x86 transform-dis.
This patch is a monolithic mess, because I was too lazy to do the refactor first (that would require some stash fun, since I wasn't actually sure before doing x86 transform-dis what would be needed). Anyway, the resulting code should be cleaner - less duplication. This breaks ARM/ARM64.
Diffstat (limited to '')
-rw-r--r--lib/hook-functions.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/hook-functions.c b/lib/hook-functions.c
index e0516cb..953683b 100644
--- a/lib/hook-functions.c
+++ b/lib/hook-functions.c
@@ -5,7 +5,7 @@
#include "transform-dis.h"
#include "execmem.h"
#include "stop-other-threads.h"
-#include TARGET_JUMP_PATCH_HDR
+#include stringify(TARGET_DIR/jump-patch.h)
struct hook_internal {
int offset_by_pcdiff[MAX_JUMP_PATCH_SIZE + 1];
@@ -168,7 +168,7 @@ int substitute_hook_functions(const struct substitute_function_hook *hooks,
&hi->trampoline_page, arch)))
goto end;
- uintptr_t pc_patch_end = pc_patch_start + patch_size;
+ uint_tptr pc_patch_end = pc_patch_start + patch_size;
/* Generate the rewritten start of the function for the outro
* trampoline (complaining if any bad instructions are found)
* (on arm64, this modifies regs_possibly_written, which is used by the