Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit f6571047c11c5c05628d02d344fe99c215e5ee75 @posixninja committed May 21, 2010
@@ -0,0 +1,9 @@
+all: dl
+%.o: %.c thread.h afc.h
+ gcc -std=gnu99 -m32 -c -o $@ $<
+
+dl: spirit.o afc.o
+ gcc -m32 -g -o spirit spirit.o afc.o -limobiledevice -lplist -lcrypto
+
+clean:
+ rm -rf spirit *.o *.dSYM
51 afc.c
@@ -0,0 +1,51 @@
+#include <stdio.h>
+#include <libimobiledevice/afc.h>
+#include "afc.h"
+
+void afc_iter_dir(afc_client_t afc, const char* path, afc_iter_callback callback) {
+ //struct afc_directory *dir;
+ //char *dirent;
+
+ //if(AFCDirectoryOpen(conn, path, &dir)) return;
+
+ //for (;;) {
+ //_assertZero(AFCDirectoryRead(conn, dir, &dirent));
+ //if (!dirent) break;
+ //if (strcmp(dirent, ".") == 0 || strcmp(dirent, "..") == 0) continue;
+
+ //callback(conn, path, dirent);
+ //}
+}
+
+void afc_create_directory(afc_client_t afc, const char* path) {
+ afc_make_directory(afc, path);
+}
+
+void list_callback(afc_client_t afc, char* path, char* dirent) {
+ printf("DEBUG: %s", dirent);
+}
+
+void afc_list_files(afc_client_t afc, const char* path) {
+ afc_iter_dir(afc, path, (afc_iter_callback) list_callback);
+}
+
+void remove_callback(afc_client_t afc, const char* path, const char* dirent) {
+ char subdir[255];
+ snprintf(subdir, 255, "%s/%s", path, dirent);
+ afc_remove_all(afc, subdir);
+
+ printf("DEBUG: Deleted %s/%s", path, dirent);
+}
+
+void afc_remove_all(afc_client_t afc, const char* path) {
+ //int ret = AFCRemovePath(conn, path);
+ afc_error_t afc_error = afc_remove_path(afc, path);
+ if(afc_error == AFC_E_SUCCESS || afc_error == AFC_E_OBJECT_NOT_FOUND) {
+ return;
+ }
+
+ afc_iter_dir(afc, path, (afc_iter_callback) remove_callback);
+
+ printf("DEBUG: Deleting %s (error=%d)", path, afc_error);
+ afc_remove_path(afc, path);
+}
7 afc.h
@@ -0,0 +1,7 @@
+#include <libimobiledevice/afc.h>
+
+typedef void (*afc_iter_callback) (afc_client_t afc, const char*, const char*);
+void afc_iter_dir(afc_client_t afc, const char* path, afc_iter_callback callback);
+void afc_remove_all(afc_client_t afc, const char* path);
+void afc_create_directory(afc_client_t afc, const char* path);
+void afc_list_files(afc_client_t afc, const char* path);
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>iPad1,1_3.2</key>
+ <string>igor/2dcde0a77381d24b7c02ac0cf7f714434c4ccdcf.dylib</string>
+ <key>iPhone1,1_3.1.2</key>
+ <string>igor/3e404d11fcbd5486d3be2dd86ce21316e1854842.dylib</string>
+ <key>iPhone1,1_3.1.3</key>
+ <string>igor/74227c0021c5e12effb5bd3175eb469a8df0622e.dylib</string>
+ <key>iPhone1,2_3.1.2</key>
+ <string>igor/3e404d11fcbd5486d3be2dd86ce21316e1854842.dylib</string>
+ <key>iPhone1,2_3.1.3</key>
+ <string>igor/74227c0021c5e12effb5bd3175eb469a8df0622e.dylib</string>
+ <key>iPhone2,1_3.1.2</key>
+ <string>igor/b735701843456754988021d128c2671ee36d1b04.dylib</string>
+ <key>iPhone2,1_3.1.3</key>
+ <string>igor/b735701843456754988021d128c2671ee36d1b04.dylib</string>
+ <key>iPod1,1_3.1.2</key>
+ <string>igor/3e404d11fcbd5486d3be2dd86ce21316e1854842.dylib</string>
+ <key>iPod1,1_3.1.3</key>
+ <string>igor/74227c0021c5e12effb5bd3175eb469a8df0622e.dylib</string>
+ <key>iPod2,1_3.1.2</key>
+ <string>igor/3e404d11fcbd5486d3be2dd86ce21316e1854842.dylib</string>
+ <key>iPod2,1_3.1.3</key>
+ <string>igor/74227c0021c5e12effb5bd3175eb469a8df0622e.dylib</string>
+ <key>iPod3,1_3.1.2</key>
+ <string>igor/f6c17e934ba0ad477812de0b7cb019396d259d93.dylib</string>
+ <key>iPod3,1_3.1.3</key>
+ <string>igor/f6c17e934ba0ad477812de0b7cb019396d259d93.dylib</string>
+</dict>
+</plist>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>com.apple.SpringBoard</key>
+ <dict>
+ <key>Disabled</key>
+ <true/>
+ </dict>
+
+ <key>com.apple.tcpdump.server</key>
+ <dict>
+ <key>KeepAlive</key>
+ <true/>
+ <key>Label</key>
+ <string>com.apple.tcpdump.server</string>
+ <key>ProgramArguments</key>
+ <array>
+ <string>/sbin/launchd</string>
+ </array>
+ <key>RunAtLoad</key>
+ <true/>
+ <key>LaunchOnlyOnce</key>
+ <true/>
+ <key>UserName</key>
+ <string>root</string>
+ <key>EnvironmentVariables</key>
+ <dict>
+ <key>DYLD_INSERT_LIBRARIES</key>
+ <string>/var/mobile/Media/spirit/one.dylib</string>
+ </dict>
+ </dict>
+</dict>
+</plist>
+
BIN spirit
Binary file not shown.
Oops, something went wrong.

0 comments on commit f657104

Please sign in to comment.