Blob
1 typedef struct Macho Macho;2 typedef struct MachoCmd MachoCmd;4 enum5 {6 MachoCpuVax = 1,7 MachoCpu68000 = 6,8 MachoCpu386 = 7,9 MachoCpuMips = 8,10 MachoCpu98000 = 10,11 MachoCpuHppa = 11,12 MachoCpuArm = 12,13 MachoCpu88000 = 13,14 MachoCpuSparc = 14,15 MachoCpu860 = 15,16 MachoCpuAlpha = 16,17 MachoCpuPower = 18,19 MachoCmdSegment = 1,20 MachoCmdSymtab = 2,21 MachoCmdSymseg = 3,22 MachoCmdThread = 4,24 MachoFileObject = 1,25 MachoFileExecutable = 2,26 MachoFileFvmlib = 3,27 MachoFileCore = 4,28 MachoFilePreload = 529 };31 struct MachoCmd32 {33 int type;34 ulong off;35 ulong size;36 struct {37 char name[16+1];38 ulong vmaddr;39 ulong vmsize;40 ulong fileoff;41 ulong filesz;42 ulong maxprot;43 ulong initprot;44 ulong nsect;45 ulong flags;46 } seg;47 struct {48 ulong symoff;49 ulong nsyms;50 ulong stroff;51 ulong strsize;52 } sym;53 };55 struct Macho56 {57 int fd;58 uint cputype;59 uint subcputype;60 ulong filetype;61 ulong flags;62 MachoCmd *cmd;63 uint ncmd;64 u32int (*e4)(uchar*);65 int (*coreregs)(Macho*, uchar**);66 };68 Macho *machoopen(char*);69 Macho *machoinit(int);70 void machoclose(Macho*);71 int coreregsmachopower(Macho*, uchar**);