Bundle 结构

通常 .app 扩展名结尾

利用 右键 Show Package Contents 显示包内容

通用二进制格式

fat binary

其 胖二进制 头部结构

#define FAT_MAGIC 0xcafebabe
#define FAT_CIGAM 0xbebafeca

struct fat_header {
	uint32_t magic;
	uint32_t nfat_arch;  // 指名通用二进制包含多少个 Mach-O 文件
};

再 fat_header 之后 是 fat_arch 结构体

struct fat_arch {
	cpu_type_t   cputype;          // cpu 类型 mach/machine.h 中
	cpu_subtype_t  cpusubtype;     // cpu 子类型
	uint32_t   offset;             // 相对于当前文件开头的偏移值
	uint32_t   size;               // 数据大小
	uint32_t   align;              // 内存的对其边界 2的次方
	
}

Mach-O 简介

Untitled