MCPcopy Create free account
hub / github.com/WrBug/dumpDex / doProcessThreadPC

Function doProcessThreadPC

app/src/main/cpp/inlineHook.c:93–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93static bool doProcessThreadPC(struct inlineHookItem *item, struct pt_regs *regs, int action) {
94 int offset;
95 int i;
96
97 switch (action) {
98 case ACTION_ENABLE:
99 offset = regs->ARM_pc - CLEAR_BIT0(item->target_addr);
100 for (i = 0; i < item->count; ++i) {
101 if (offset == item->orig_boundaries[i]) {
102 regs->ARM_pc = (uint32_t) item->trampoline_instructions +
103 item->trampoline_boundaries[i];
104 return true;
105 }
106 }
107 break;
108 case ACTION_DISABLE:
109 offset = regs->ARM_pc - (int) item->trampoline_instructions;
110 for (i = 0; i < item->count; ++i) {
111 if (offset == item->trampoline_boundaries[i]) {
112 regs->ARM_pc = CLEAR_BIT0(item->target_addr) + item->orig_boundaries[i];
113 return true;
114 }
115 }
116 break;
117 }
118
119 return false;
120}
121
122static void processThreadPC(pid_t tid, struct inlineHookItem *item, int action) {
123 struct pt_regs regs;

Callers 1

processThreadPCFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected