示例#1
0
        /// <summary>
        /// Creates the ident.
        /// </summary>
        /// <param name="identClass">The ident class.</param>
        /// <param name="data">The data.</param>
        ///
        public void CreateIdent(IdentClass identClass, IdentData data)
        {
            // Store magic number
            Ident[0] = MagicNumber[0];
            Ident[1] = MagicNumber[1];
            Ident[2] = MagicNumber[2];
            Ident[3] = MagicNumber[3];

            // Store class
            Ident[4] = (byte)identClass;

            // Store data flags
            Ident[5] = (byte)data;

            // Version has to be current, otherwise the file won't load
            Ident[6] = (byte)Version.Current;
            Version  = Version.Current;

            Ident[7] = 0x00;

            for (int i = 8; i < 16; ++i)
            {
                Ident[i] = 0x00;
            }
        }
示例#2
0
        public ElfHeaderIdent(IdentClass identClass, IdentData data)
        {
            _ident = new byte[16];

            // Store magic number
            _ident[0] = MagicNumber[0];
            _ident[1] = MagicNumber[1];
            _ident[2] = MagicNumber[2];
            _ident[3] = MagicNumber[3];

            // Store class
            _ident[4] = (byte)identClass;

            // Store data flags
            _ident[5] = (byte)data;

            // Version has to be current, otherwise the file won't load
            _ident[6] = (byte)Version.Current;

            _ident[7] = 0x00;

            for (int i = 8; i < 16; ++i)
            {
                _ident[i] = 0x00;
            }
        }
示例#3
0
        /// <summary>
        /// Creates the ident.
        /// </summary>
        /// <param name="identClass">The ident class.</param>
        /// <param name="data">The data.</param>
        /// <param name="padding">The padding.</param>
        public void CreateIdent(IdentClass identClass, IdentData data, byte[] padding)
        {
            // Store magic number
            Ident[0] = MagicNumber[0];
            Ident[1] = MagicNumber[1];
            Ident[2] = MagicNumber[2];
            Ident[3] = MagicNumber[3];

            // Store class
            Ident[4] = (byte)identClass;

            // Store data flags
            Ident[5] = (byte)data;

            // Version has to be current, otherwise the file won't load
            Ident[6] = (byte)Version.Current;
            Version = Version.Current;

            // Set padding byte to
            Ident[7] = 0x07;

            for (int i = 8; i < 16; ++i)
                Ident[i] = 0x00;
        }