From: Jay Freeman (saurik) Date: Wed, 20 May 2009 06:35:14 +0000 (+0000) Subject: Make ldid workaround the stupid inode issue. X-Git-Tag: v1.0.610^0 X-Git-Url: https://git.saurik.com/ldid.git/commitdiff_plain/122621c5586e9859fea83fa8abce68ceefb353d9 Make ldid workaround the stupid inode issue. --- diff --git a/ldid.cpp b/ldid.cpp index 334fd1f..16824d5 100644 --- 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(framework.GetBase()); + size_t size = framework.GetSize(); + + char *copy; + asprintf(©, "%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));