コード例 #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 プロジェクト: xuchuansheng/GenXSource
		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));

		}