Difference between revisions of "ROP"

From The iPhone Wiki
Jump to: navigation, search
(explained it but need more examples)
 
m (Fixes typo and adds comma)
 
(One intermediate revision by one other user not shown)
Line 11: Line 11:
 
if(!ptr)
 
if(!ptr)
 
return 0;
 
return 0;
  +
return ((uintptr_t)ptr) - ((uintptr_t)kdata);
 
return ((uintptr_t)ptr) - ((uintptr_t)kdata);
 
 
}
 
}
Once you've figured out all your ROP gadgets thta's your payload and that's how you will
+
Once you've figured out all your ROP gadgets, that's your payload and that's how you will
 
exploit whatever vulnerability you found.
 
exploit whatever vulnerability you found.

Latest revision as of 16:30, 10 June 2021

ROP is a form of exploitation where you search for gadgets in memory (instructions bascially) and use memory's own code instead of using your code. In evasi0n, this ROP gadget is used

 STR R1, [R2];BX LR

So evasi0n looks for that in memory using memmem(), here's the function in planetbeing's patchfinder.

 int32_t find_str_r1_r2_bx_lr(uint32_t region, uint8_t* kdata, size_t ksize)
 {
   const uint8_t search[] = {0x11, 0x60, 0x70, 0x47};
   void* ptr = memmem(kdata, ksize, search, sizeof(search)) + 1;
   if(!ptr)
       return 0;
      return ((uintptr_t)ptr) - ((uintptr_t)kdata);
 }

Once you've figured out all your ROP gadgets, that's your payload and that's how you will exploit whatever vulnerability you found.