The iPhone Wiki is no longer updated. Visit this article on The Apple Wiki for current information. |
Difference between revisions of "ROP"
m (Fixes typo and adds comma) |
|||
Line 13: | Line 13: | ||
return ((uintptr_t)ptr) - ((uintptr_t)kdata); |
return ((uintptr_t)ptr) - ((uintptr_t)kdata); |
||
} |
} |
||
− | Once you've figured out all your ROP gadgets |
+ | 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.