forked from Mirrors/wine-wine
Add Mach-O (Darwin file format) support.
parent
5ef127a000
commit
89321f49bd
|
@ -145,6 +145,13 @@ enum binary_type MODULE_GetBinaryType( HANDLE hfile )
|
|||
unsigned char ignored[12];
|
||||
unsigned short type;
|
||||
} elf;
|
||||
struct
|
||||
{
|
||||
unsigned long magic;
|
||||
unsigned long cputype;
|
||||
unsigned long cpusubtype;
|
||||
unsigned long filetype;
|
||||
} macho;
|
||||
IMAGE_DOS_HEADER mz;
|
||||
} header;
|
||||
|
||||
|
@ -168,6 +175,16 @@ enum binary_type MODULE_GetBinaryType( HANDLE hfile )
|
|||
return BINARY_UNKNOWN;
|
||||
}
|
||||
|
||||
/* Mach-o File with Endian set to Big Endian or Little Endian*/
|
||||
if (header.macho.magic == 0xfeedface || header.macho.magic == 0xecafdeef)
|
||||
{
|
||||
switch(header.macho.filetype)
|
||||
{
|
||||
case 0x8: /* MH_BUNDLE */ return BINARY_UNIX_LIB;
|
||||
}
|
||||
return BINARY_UNKNOWN;
|
||||
}
|
||||
|
||||
/* Not ELF, try DOS */
|
||||
|
||||
if (header.mz.e_magic == IMAGE_DOS_SIGNATURE)
|
||||
|
|
Loading…
Reference in New Issue