Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LDM / LDMDB JOP gadgets for ARM Thumb2 #207

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

face0xff
Copy link
Contributor

Currently, ROPgadget does not include any pattern to detect LDM gadgets in Thumb mode for ARM. Such gadgets can be very useful for JOP in arm32 targets, and Thumb mode vastly increases their availability. LDM gadgets in Thumb2 (32-bit encoding) can also act as nice stack pivots, for instance:

ldm.w r8!, {r0, r1, r2, r3, r4, r5, r6, r7, r8, sb, fp, sp, lr, pc}

On the elf-ARMv7-ls test binary, running ROPgadget with --thumb, the number of gadgets found increases from 131 to 2387, and the number of ldm.w gadgets (--only ldm.w) increases from 0 to 29.

@SweetVishnya
Copy link
Collaborator

Hi! Thank you for the patch! Could you also update the tests, please?

@SweetVishnya SweetVishnya merged commit b3463a9 into JonathanSalwan:master Jan 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants