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

func_call gadget in mips #114

Open
yamazaki15 opened this issue Jul 1, 2024 · 1 comment
Open

func_call gadget in mips #114

yamazaki15 opened this issue Jul 1, 2024 · 1 comment
Labels

Comments

@yamazaki15
Copy link

Question

I'm looking for a func_call gadget in my mips binary. Using ropper tool I've found this valid gadget:

move    $a1, $s1
jalr    $s3
move    $a2, $s0
lw $ra, 0x48($sp)
lw $s1, 0x48+var_24($sp)
lw $s0, 0x48+var_28($sp)
jr $ra
addiu $sp, 0x48

Using this gadget I can jump to any function (I've control over s3 from previous gadget) with 2 args.

However, when I try to use anrop, it truncates the gadget to the first 3 instructions:

move    $a1, $s1
jalr    $s3
move    $a2, $s0

and therefore fails to find a valid func_call gadget.
I guess that it happens because angr terminates the block after the jalr instruction...
Any ideas on how to fix this?

Thanks!

@Kyle-Kyle
Copy link
Collaborator

Hi. Sorry for the late response. Due to some issues, I wasn't able to contribute to open-source projects in the past few months. So I wasn't able to respond.

I think this is an issue about the support of multi control-flow hijacking (in ROPGadget's term, multibr). Currently, we don't have any plans to support that yet, unfortunately. But this is definitely one of the TODOs in the future.

Also, it doesn't seem that this longer gadget provides the ability to call functions (you need to control a0 and a1 to call with 2 args, not a1 & a2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants