예제 #1
0
 /// <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;
 }
예제 #2
0
 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;
 }
예제 #3
0
 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;
     }
 }
예제 #4
0
 public void AddPInvokeInfo(ModuleRef scope, string methName,
     PInvokeAttr callAttr)
 {
     pinvokeImpl = new ImplMap((ushort)callAttr, this, methName, scope);
     methFlags |= PInvokeImpl;
 }
예제 #5
0
 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;
 }
예제 #6
0
 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);
 }
예제 #7
0
 /*-------------------- 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 "));
 }
예제 #8
0
파일: PEFile.cs 프로젝트: dbremner/perwapi
 /// <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));
 }
예제 #9
0
 public void AddPInvokeInfo(ModuleRef scope, string methName,
                            PInvokeAttr callAttr)
 {
     pinvokeImpl = new ImplMap((ushort)callAttr, this, methName, scope);
     methFlags  |= PInvokeImpl;
 }