/// <summary> /// Make a ModuleRef for this Module. /// </summary> /// <returns>ModuleRef for this Module</returns> public ModuleRef MakeRefOf(/*bool hasEntryPoint, byte[] hashValue*/) { if (refOf == null) { refOf = new ModuleRef(name/*,hasEntryPoint,hashValue*/); refOf.defOf = this; }/* else { // fix this if (hasEntryPoint) refOf.SetEntryPoint(); refOf.SetHash(hashValue); }*/ return refOf; }
internal static ModuleRef ReadModuleRef(PEReader buff) { buff.ReadZeros(2); string name = buff.GetString(); uint junk = buff.GetGUIDIx(); junk = buff.GetGUIDIx(); junk = buff.GetGUIDIx(); ModuleRef mRef = new ModuleRef(new ModuleFile(name, null)); mRef.ReadAsDef(); return mRef; }
internal static void Read(PEReader buff, TableRow[] mods, bool resolve) { Contract.Requires(buff != null); Contract.Requires(mods != null); for (int i = 0; i < mods.Length; i++) { string name = buff.GetString(); ModuleRef mRef = new ModuleRef(name); if (resolve) mRef.modFile = buff.GetFileDesc(name); mods[i] = mRef; } }
public void AddPInvokeInfo(ModuleRef scope, string methName, PInvokeAttr callAttr) { pinvokeImpl = new ImplMap((ushort)callAttr, this, methName, scope); methFlags |= PInvokeImpl; }
public static ModuleRef MakeModuleRef(string name, bool entryPoint, byte[] hashValue) { Contract.Requires(name != null); Contract.Requires(hashValue != null); ModuleRef mRef = new ModuleRef(name, entryPoint, hashValue); return mRef; }
internal override void Resolve(PEReader buff) { meth = (MethodDef)buff.GetCodedElement(CIx.MemberForwarded, memForIndex); importScope = (ModuleRef)buff.GetElement(MDTable.ModuleRef, scopeIx); if (meth != null) meth.AddPInvokeInfo(this); }
/*-------------------- Constructors ---------------------------------*/ internal ImplMap(ushort flag, MethodDef implMeth, [CanBeNull] string iName, ModuleRef mScope) { flags = flag; meth = implMeth; importName = iName; importScope = mScope; tabIx = MDTable.ImplMap; if (iName == null) flags |= NoMangle; //throw(new NotYetImplementedException("PInvoke ")); }
/// <summary> /// Add a managed resource from another module in this assembly. /// </summary> /// <param name="resName">The name of the resource</param> /// <param name="assem">The assembly where the resource is</param> /// <param name="isPublic">Access for the resource</param> public void AddExternalManagedResource(string resName, ModuleRef mod, uint offset, bool isPublic) { Contract.Requires(resName != null); Contract.Requires(mod != null); resources.Add(new ManifestResource(this, resName, mod.modFile, offset, isPublic)); }