OR, how to identify type of file if file
fails.
Apple took away the ability to copy Voice Memos from iPhone/iPad, so I went to copy them from the backups. in the process, I found (apparently) 206 DOS executables in the backups for our four devices:
WGroleau@MBP Backup % cd ~/Library/Application\ Support/MobileSync/Backup
WGroleau@MBP Backup % for DIR in */*; do
for> ls $DIR | while read FILE; do
for pipe while> file $DIR/$FILE
for pipe while> done
for> done | grep DOS | wc
206 969 23052
WGroleau@MBP Backup % for DIR in */*; do
ls $DIR | while read FILE; do
file $DIR/$FILE
done
done | grep DOS | head -5
82573a47f0a7b4620a1fc329c82d491f757061be/01/01517218144e305b8b2c106e15a6d8c509aba424: DOS executable (COM)
82573a47f0a7b4620a1fc329c82d491f757061be/04/0443be5ce51f5a301d9550bf33fba30a853018b5: DOS executable (COM)
82573a47f0a7b4620a1fc329c82d491f757061be/04/046e86e4d02071edbff719985af4dd46229baeee: COM executable for DOS
82573a47f0a7b4620a1fc329c82d491f757061be/06/068cad52bad02939797677eaa77f5c7968d70118: DOS executable (COM)
82573a47f0a7b4620a1fc329c82d491f757061be/06/06e0b47ffe010ecea71c5cf9f2f3fd259b4c417d: DOS executable (COM)
WGroleau@MBP Backup %
If file
has mis-identified them, is there any way to correctly identify them? What might be in 206 different files that causes file
to identify all of them as .COM (but in two different ways)?
In older versions of macOS, the original file name could be determined using SQLite¹ in the backup. But that is obfuscated and/or encrypted² in Ventura. There are a lot of plist files in the backup. Maybe the original name is hidden in one of them. But most are binary, so it would take a heck of a long time to find it if it is there.
¹https://apple.stackexchange.com/a/429490/65467
²https://apple.stackexchange.com/a/456963/65467
for DIR in */*
. What is the value of$DIR
for these files?find ~/Library/Application\ Support/MobileSync/Backup -type f -exec file {} \; | grep DOS
to get that output.