]> git.saurik.com Git - winterboard.git/commitdiff
Add some commented out code to debug open() calls. v0.9.3906
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 20 Sep 2012 22:11:03 +0000 (22:11 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 20 Sep 2012 22:11:03 +0000 (22:11 +0000)
Library.mm

index 7b5a2b0f52a9edfd95ec00595208892c8c37e0fe..fb485cb611dee0f6890eedb5a0da6ceff3fbdfb7 100644 (file)
@@ -2141,6 +2141,25 @@ static void SBInitialize() {
         English_ = [[NSDictionary alloc] initWithContentsOfFile:@"/System/Library/CoreServices/SpringBoard.app/English.lproj/LocalizedApplicationNames.strings"];
 }
 
+/*MSHook(int, open, const char *path, int oflag, mode_t mode) {
+    int fd(_open(path, oflag, mode));
+
+    static bool no(false);
+    if (no) return fd;
+    no = true;
+
+    if (strstr(path, "/icon") != NULL)
+        MSHookProcess(-1, "");
+
+    if (fd == -1 && errno == EFAULT)
+        NSLog(@"open(%p, %#x, %#o) = %d\n", path, oflag, mode, fd);
+    else
+        NSLog(@"open(\"%s\", %#x, %#o) = %d\n", path, oflag, mode, fd);
+
+    no = false;
+    return fd;
+}*/
+
 MSInitialize {
     $objc_setAssociatedObject = reinterpret_cast<void (*)(id, void *, id value, objc_AssociationPolicy)>(dlsym(RTLD_DEFAULT, "objc_setAssociatedObject"));
     $objc_getAssociatedObject = reinterpret_cast<id (*)(id, void *)>(dlsym(RTLD_DEFAULT, "objc_getAssociatedObject"));
@@ -2292,6 +2311,8 @@ MSInitialize {
     }
     // }}}
 
+    //MSHookFunction(reinterpret_cast<int (*)(const char *, int, mode_t)>(&open), MSHake(open));
+
     if (UIDebug_ && ![Manager_ fileExistsAtPath:@"/tmp/UIImages"]) {
         NSError *error(nil);
         if (![Manager_ createDirectoryAtPath:@"/tmp/UIImages" withIntermediateDirectories:NO attributes:[NSDictionary dictionaryWithObjectsAndKeys: