Advertisement
Madmouse

this arm code may JUST about fry your noodle lol

Oct 19th, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #define BKPT 0xde01
  2.  
  3. bool scan_for_breakpoints(void (*fun), int start, int depth) /// scans a section of a function for break points
  4. {
  5. int i;
  6. unsigned int inst;
  7. for(i=start-1;i<=depth;i+=2) /// count from offset start to depth
  8. {
  9. inst = (*(volatile unsigned int *)((unsigned int)fun + i) & 0xffff);
  10. //printf("instruction: %x\r\n",inst);
  11. if (inst == BKPT) /// if this is a break point
  12. return true; /// return true
  13. }
  14. return false;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement