Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bad_query/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ struct ContentView: View {
func replace(source: URL) throws {
log.append("\nattempting replace mobilegestalt cache...")
let accessed = source.startAccessingSecurityScopedResource()
defer { if accessed { source.stopAccessingSecurityScopedResource() } }
if !accessed {
log.append("\nfailed to access replacement?")
throw NSError(domain: "sbhaxx", code: 2)
Expand Down
2 changes: 2 additions & 0 deletions bad_query/bad_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ void bad_query_release(int64_t handle) {
// I'm including it here because it's very useful in the context of this sandbox escape, which can't access parent directories (most of the time)
// This enumerates all directories in a given path, so you can, for example, get all container UUIDs, read their container metadata to get their bundle ID, and derive that entirely on-device without a computer
char *bad_query_list(char *path, int64_t max_inode) {
if (!path || !*path) return NULL;
if (max_inode <= 0 || max_inode > 0xFFFFFFFF) max_inode = 0xFFFFFFFF;
struct statfs sfs;
if (statfs(path, &sfs) != 0) return NULL;
fsid_t fsid = sfs.f_fsid;
Expand Down