]> git.saurik.com Git - cycript.git/blobdiff - Inject.cpp
Output a smaller representation of true and false.
[cycript.git] / Inject.cpp
index 95610d23466d425289c7acbd21baf676a55b9f3d..eb8535190c0fa3d88e636476851b56450a477271 100644 (file)
@@ -1,5 +1,5 @@
 /* Cycript - Optimizing JavaScript Compiler/Runtime
- * Copyright (C) 2009-2014  Jay Freeman (saurik)
+ * Copyright (C) 2009-2015  Jay Freeman (saurik)
 */
 
 /* GNU Affero General Public License, Version 3 {{{ */
@@ -28,6 +28,8 @@
 #include "Pooling.hpp"
 
 #if defined(__APPLE__) && (defined(__i386__) || defined(__x86_64__))
+#include <unistd.h>
+
 #include <sys/fcntl.h>
 #include <sys/mman.h>
 
@@ -65,7 +67,8 @@ void InjectLibrary(int pid, int argc, const char *argv[]) {
     off_t offset;
     _assert(csops(pid, CS_OPS_PIDOFFSET, &offset, sizeof(offset)) != -1);
 
-    char path[PATH_MAX];
+    // XXX: implement a safe version of this
+    char path[4096];
     int writ(proc_pidpath(pid, path, sizeof(path)));
     _assert(writ != 0);