diff options
-rw-r--r-- | util/ldid.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/util/ldid.cpp b/util/ldid.cpp index 334fd1f20..16824d579 100644 --- a/util/ldid.cpp +++ b/util/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(©, "%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)); |