You should be able to use IDA to debug MIPS binaries. It's been a while for me, but I seem to recall IDA sometimes getting confused by the branch delay slot (the instruction following a jump/branch). If possible, set your breakpoint to whatever the jump target is rather than attempting to single step into the jalr
.
Alternatively, you might be getting bitten by data/instruction cache incoherency. Are you triggering a cache flush/invalidation prior to jumping into your shellcode? If not and if this is in Linux userspace, ropping into sleep() should do the trick. This is because your shellcode starts out as data and sits in the data cache until it is flushed to main memory. Only when that happens can it be fetched from main memory as instructions. A sleep() allows the kernel to briefly context switch to another process, which requires a cache flush.
To do that you need to:
- Stage a small sleep period (1 or 2 seconds should suffice) into
$a0
- Stage a return address into
$ra
- Stage the address of
sleep()
someplace, probably $s0
, where you can jr
to it
jr
to whatever reg holds address of sleep()
gdb-multiarch
. If you want to examine the effects / execution of your ROP chain gdb sounds like the right tool.