]> git.saurik.com Git - ldid.git/commitdiff
Make ldid workaround the stupid inode issue. v1.0.610
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 20 May 2009 06:35:14 +0000 (06:35 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 20 May 2009 06:35:14 +0000 (06:35 +0000)
ldid.cpp

index 334fd1f2098ddbaddcda59ef592d05fa28cce8a3..16824d579939ee32f6fd83a8cc79034796ca90dd 100644 (file)
--- a/ldid.cpp
+++ b/ldid.cpp
@@ -780,6 +780,22 @@ int main(int argc, const char *argv[]) {
             memset(blob + offset, 0, size - offset);
         }
 
+        if (flag_S) {
+            uint8_t *top = reinterpret_cast<uint8_t *>(framework.GetBase());
+            size_t size = framework.GetSize();
+
+            char *copy;
+            asprintf(&copy, "%s.%s.cp", dir, base);
+            FILE *file = fopen(copy, "w+");
+            size_t writ = fwrite(top, 1, size, file);
+            _assert(writ == size);
+            fclose(file);
+
+            _syscall(unlink(temp));
+            free(temp);
+            temp = copy;
+        }
+
         if (temp) {
             struct stat info;
             _syscall(stat(path, &info));