0

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!

4
  • I assume you're trying to run shell commands programmatically, from your app. If you're trying to get around the problem with system() calls not running as root, even if your app runs as root, here's one workaround for that
    – Nate
    Feb 6, 2013 at 23:29
  • i'd rather not have a dependency like that...even if it is a very popular app. Is there any place at all the user who is running the commands can write?
    – SpyMachine
    Feb 7, 2013 at 5:20
  • First, you're stuck, and now you don't want to depend on one of the most widely used (and free) jailbreak apps? Boy, we got picky in a hurry, didn't we?
    – Nate
    Feb 7, 2013 at 21:48
  • I didn't mean any disrespect, I just was hoping there was another way to do it. It definitely seems like it would solve my problem, but I just want to make sure there isn't another way I can do it.
    – SpyMachine
    Feb 8, 2013 at 16:59

1 Answer 1

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.