Commit 89321f49 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont Committed by Alexandre Julliard

Add Mach-O (Darwin file format) support.

parent 5ef127a0
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment