From 110a00a19f5ddce5c4f5e1d0bced54580d3e8e63 Mon Sep 17 00:00:00 2001 From: d Date: Sat, 1 Apr 2017 03:47:42 +0800 Subject: [PATCH] make sure new code run in arm mode --- inject-arm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inject-arm.c b/inject-arm.c index c97a306..01c2d8b 100644 --- a/inject-arm.c +++ b/inject-arm.c @@ -244,6 +244,9 @@ int main(int argc, char** argv) // refers to the next instruction rather than the current instruction. regs.uregs[15] = addr - 4; + // clear T bit, because new code may in ARM mode + regs.uregs[16] = regs.uregs[16] & 0xffffffdf; + // pass arguments to my function injectSharedLibrary() by loading them // into the right registers. see comments in injectSharedLibrary() for // more details.