Search code examples
iosgdbjailbreak

Using gdb to dump memory for jailbroken iOS app


I'm developing an app to be run on jailbroken devices and I'm a little stuck.

My app requires gdb to dump memory from an app. The problem I have is that creating or modifying files only works within code, when I try and run a command from shell, it won't run as root, and therefore won't let me write outside my sandbox (Which doesn't exist cause the app is for jailbroken devices).

So I have 2 theoretical solutions to my problem.

1) Find a way to run /bin/sh as root *preferred

2) If there's a way to dump memory to the terminal, I can grab with NSData and then create a file for it within my code. However I haven't seen away to do that.

Those are just the 2 ideas I came up with, let me know if this is possible, or if you know another way.

Thanks!


Solution

  • Any user can write in the /tmp directory....

    I just changed the location to dump memory to /tmp/file.bin and then I can move it however I want through code.