コード例 #1
0
ファイル: ELFSections.cs プロジェクト: zrbruce/FlingOS
        public override int Read(FileStream stream)
        {
            relocations.Empty();

            int              bytesRead = base.Read(stream);
            uint             offset    = 0;
            RelocationAddend currRelocation;

            while (offset < bytesRead)
            {
                currRelocation = new RelocationAddend();

                currRelocation.Offset = (byte *)ByteConverter.ToUInt32(data, offset + 0);
                currRelocation.Info   = ByteConverter.ToUInt32(data, offset + 4);
                currRelocation.Addend = (short)ByteConverter.ToUInt16(data, offset + 8);

                relocations.Add(currRelocation);

                offset += header.EntrySize;
            }

            return(relocations.Count);
        }
コード例 #2
0
ファイル: ELFSections.cs プロジェクト: rmhasan/FlingOS
        public override int Read(FileStream stream)
        {
            relocations.Empty();

            int bytesRead = base.Read(stream);
            uint offset = 0;
            RelocationAddend currRelocation;
            while (offset < bytesRead)
            {
                currRelocation = new RelocationAddend();

                currRelocation.Offset = (byte*)ByteConverter.ToUInt32(data, offset + 0);
                currRelocation.Info = ByteConverter.ToUInt32(data, offset + 4);
                currRelocation.Addend = (short)ByteConverter.ToUInt16(data, offset + 8);

                relocations.Add(currRelocation);

                offset += header.EntrySize;
            }

            return relocations.Count;
        }