Protect FAT Mach-O Files¶
Code Virtualizer cannot protect FAT Mach-O files directly. To protect a FAT Mach-O file, use the macOS lipo tool to extract each architecture, protect each extracted file separately, and then replace the original architectures with the protected ones.
Extract Architectures from a FAT File¶
Use lipo to extract each architecture from the FAT file.
The following example extracts the i386 and x86_64 architectures:
lipo "my_fat_file" -thin i386 -output "my_file_x86"
lipo "my_fat_file" -thin x86_64 -output "my_file_x64"
To display the architectures contained in a FAT file, run:
Protect Architectures¶
Protect each extracted architecture as a normal application:
Virtualizer.exe /protect my_project.tmd /inputfile "my_file_x86" /outputfile "my_file_x86"
Virtualizer.exe /protect my_project.tmd /inputfile "my_file_x64" /outputfile "my_file_x64"
Replace Architectures in the FAT File¶
After protecting the individual architectures, use lipo to replace the original architectures with the protected files:
lipo "my_fat_file" \
-replace i386 "my_file_x86" \
-replace x86_64 "my_file_x64" \
-output "my_fat_file_protected"
The resulting my_fat_file_protected file contains the protected architectures.
Once the FAT file has been rebuilt successfully, the individual architecture files are no longer required.