execute binary without shell

Discussion in 'iOS Development' started by gojohnnyboi, Jan 30, 2009.

  1. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    i need to execute the "reboot" binary that i have in the root directory of my ramdisk, without a shell. execv() is not working.
  2. Chris Hansen

    Chris Hansen Banned

    Joined:
    Dec 3, 2008
    Messages:
    241
    Likes Received:
    0
    Is this for the 2G jailbreak your experimenting with?
  3. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    yes, this is basically the last step. again i say that nothing will be released by me. this is for my own personal use.
  4. Chris Hansen

    Chris Hansen Banned

    Joined:
    Dec 3, 2008
    Messages:
    241
    Likes Received:
    0
    I understand. That's not a problem. I know this is the last step.
  5. andydam123

    andydam123 Member

    Joined:
    Aug 11, 2008
    Messages:
    447
    Likes Received:
    0
    Use NSTask.

    Put this in the h file
    Code:
    #include "NSTask.h"
    This is how you use it
    Code:
    //make it first
    NSTask *someTask;
    //init it
    someTask = [[NSTask alloc] init];
    [someTask setLaunchPath:@"/path/to/reboot"];
    [someTask launch];
    [someTask waitUntilExit];
    
    So... can you tell me how you make a payload?
  6. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    that's the same as using system(), and i believe NSTask doesn't even exist on iphone. and no i cannot.
  7. Cyanidepoison

    Cyanidepoison Active Member

    Joined:
    Jan 18, 2008
    Messages:
    1,076
    Likes Received:
    2
    Are you giving it the correct number of args?

    I'm pretty sure execv takes 3, the path, options, and NULL to terminate, so the program can have a complete argc and argv.
  8. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    that's execve i believe. tried that also.

Share This Page