X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/f0360d516594a03fe430435884e47adefadc5e53..fcc64bb5f16c8061a961cd4f0329ebc8215addf6:/Application.mm diff --git a/Application.mm b/Application.mm index 4bee7e3..725e246 100644 --- a/Application.mm +++ b/Application.mm @@ -72,15 +72,13 @@ static void sigint(int) { longjmp(ctrlc_, 1); } -void Run(int socket, std::string &code, FILE *fout) { +void Run(int socket, const char *data, size_t size, FILE *fout) { CYPool pool; const char *json; if (socket == -1) - json = CYExecute(pool, code.c_str()); + json = CYExecute(pool, data); else { - const char *data(code.c_str()); - size_t size(code.size()); CYSendAll(socket, &size, sizeof(size)); CYSendAll(socket, data, size); CYRecvAll(socket, &size, sizeof(size)); @@ -101,6 +99,10 @@ void Run(int socket, std::string &code, FILE *fout) { } } +void Run(int socket, std::string &code, FILE *fout) { + Run(socket, code.c_str(), code.size(), fout); +} + static void Console(int socket) { bool bypass(false); bool debug(false); @@ -245,7 +247,7 @@ int main(int argc, char *argv[]) { case -1: goto getopt; case '?': - fprintf(stderr, "usage: cycript [-p ] [