The iPhone Wiki is no longer updated. Visit this article on The Apple Wiki for current information. |
Difference between revisions of "ROP"
(explained it but need more examples) |
|||
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 thta's your payload and that's how you will |
Revision as of 15:59, 10 April 2015
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 thta's your payload and that's how you will exploit whatever vulnerability you found.