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

Function inlineHook

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

Source from the content-addressed store, hash-verified

368}
369
370enum ele7en_status inlineHook(uint32_t target_addr) {
371 int i;
372 struct inlineHookItem *item;
373
374 item = NULL;
375 for (i = 0; i < info.size; ++i) {
376 if (info.item[i].target_addr == target_addr) {
377 item = &info.item[i];
378 break;
379 }
380 }
381
382 if (item == NULL) {
383 return ELE7EN_ERROR_NOT_REGISTERED;
384 }
385
386 if (item->status == REGISTERED) {
387 pid_t pid;
388
389 pid = freeze(item, ACTION_ENABLE);
390
391 doInlineHook(item);
392
393 unFreeze(pid);
394
395 return ELE7EN_OK;
396 } else if (item->status == HOOKED) {
397 return ELE7EN_ERROR_ALREADY_HOOKED;
398 } else {
399 return ELE7EN_ERROR_UNKNOWN;
400 }
401}
402
403void inlineHookAll() {
404 pid_t pid;

Callers 1

Calls 3

freezeFunction · 0.85
doInlineHookFunction · 0.85
unFreezeFunction · 0.85

Tested by

no test coverage detected