Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. //unsigned long kallsyms_lookup_name(const char *name)
  2. static unsigned long __attribute__((naked)) call_kallsyms_lookup_name(const char *name)
  3. {
  4. //this is to ensure that r4 is used
  5. register unsigned long* dest asm ("r4");
  6. asm volatile("ldr r4,=%[dest]" : : [dest] "X" (&kallsyms_lookup_name_address) : "r4");
  7. //just change the pc value to the address, so it returns to previous caller
  8. asm volatile("mov pc, r4");
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement