예제 #1
0
        public Relocations(BinaryReader reader, MModule mod)
        {
            uint start, end;

            if (mod.ModHeaders.OSHeaders.PEHeader.DataDirs[5].Rva == 0)
            {
                return;
            }

            start = mod.ModHeaders.Rva2Offset(mod.ModHeaders.OSHeaders.PEHeader.DataDirs[5].Rva);
            end   = start + mod.ModHeaders.OSHeaders.PEHeader.DataDirs[5].Size;

            //fill in Region props
            Start  = start;
            Length = end - start;

            reader.BaseStream.Position = start;

            RelocationBlock block;
            ArrayList       arr = new ArrayList();

            while (reader.BaseStream.Position < end)
            {
                block = new RelocationBlock(reader);
                arr.Add(block);
            }

            _blox = (RelocationBlock[])arr.ToArray(typeof(RelocationBlock));
        }
예제 #2
0
파일: Headers.cs 프로젝트: Kinect123/ex360e
        public Relocations(BinaryReader reader, MModule mod)
        {
            uint start, end;

            if (mod.ModHeaders.OSHeaders.PEHeader.DataDirs[5].Rva == 0)
            {
                return;
            }

            start = mod.ModHeaders.Rva2Offset(mod.ModHeaders.OSHeaders.PEHeader.DataDirs[5].Rva);
            end = start + mod.ModHeaders.OSHeaders.PEHeader.DataDirs[5].Size;

            //fill in Region props
            Start = start;
            Length = end - start;

            reader.BaseStream.Position = start;

            RelocationBlock block;
            ArrayList arr = new ArrayList();

            while (reader.BaseStream.Position < end)
            {
                block = new RelocationBlock(reader);
                arr.Add(block);
            }

            _blox = (RelocationBlock[]) arr.ToArray(typeof (RelocationBlock));
        }