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)); }
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)); }