Skip to content

Instantly share code, notes, and snippets.

@iarchiveml
iarchiveml / resize_apfs.c
Last active May 10, 2023 17:54
Resize an APFS container on an iOS device
// clang -o resize_apfs -Wall -Wextra -Wpedantic -Werror -Wl,-U,_mh_execute_header,-e,_main -Xlinker APFS.tbd resize_apfs.c
// Tested on iOS 10 and 15, won't work on iOS 12
#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>
typedef int (*apfs_resize_container_t)(const char *, unsigned long long);
typedef const char *(*apfs_get_error_string_t)(int);
int main(int argc, char *argv[]) {