internal static void Read(PEReader buff, TableRow[] files) { for (int i=0; i < files.Length; i++) { uint flags = buff.ReadUInt32(); if (flags == HasMetaData) files[i] = new ModuleFile(buff.GetString(),buff.GetBlob()); else files[i] = new ResourceFile(buff.GetString(),buff.GetBlob()); } }
internal ModuleFile GetFileDesc(string name) { if (tables[(int)MDTable.File] == null) return null; for (int i=0; i < tables[(int)MDTable.File].Length; i++) { FileRef fr = (FileRef)tables[(int)MDTable.File][i]; if (fr.Name() == name) { if (fr is ModuleFile) return (ModuleFile)fr; fr = new ModuleFile(fr.Name(),fr.GetHash()); tables[(int)MDTable.File][i] = fr; return (ModuleFile)fr; } } return null; }
internal ModuleRef(ModuleFile file) : base(file.Name()) { modFile = file; tabIx = MDTable.ModuleRef; }
internal override sealed void Resolve(PEReader buff) { modFile = buff.GetFileDesc(name); if (modFile != null) modFile.fileModule = this; }
/*-------------------- Constructors ---------------------------------*/ internal ModuleRef(string name, bool entryPoint, byte[] hashValue) : base(name) { modFile = new ModuleFile(name,hashValue,entryPoint); ismscorlib = name.ToLower() == "mscorlib.dll"; tabIx = MDTable.ModuleRef; }