Пример #1
0
        public MachObjectFile(byte[] buffer, int offset, int length)
        {
            Header  = new MachHeader(buffer, offset);
            offset += Header.Length;
            for (int index = 0; index < Header.NumberOfLoadCommands; index++)
            {
                LoadCommand command = LoadCommand.ReadCommand(buffer, offset);
                LoadCommands.Add(command);
                offset += (int)command.CommandSize;
            }
            int dataLength = (int)(length - Header.Length - Header.SizeOfLoadCommands);

            DataOffset = (int)(Header.Length + Header.SizeOfLoadCommands);
            Data       = ByteReader.ReadBytes(buffer, offset, dataLength);
        }
Пример #2
0
 public static bool IsMachObjectFile(byte[] buffer, int offset)
 {
     return(MachHeader.IsMachHeader(buffer, offset));
 }