コード例 #1
0
        private FunctionPointerType /*?*/ GetStandAloneMethodSignature(
            uint standAloneMethodToken
            )
        {
            StandAloneSigRow sigRow = this.PEFileToObjectModel.PEFileReader.StandAloneSigTable[standAloneMethodToken & TokenTypeIds.RIDMask];
            uint             signatureBlobOffset = sigRow.Signature;
            //  TODO: error checking offset in range
            MemoryBlock signatureMemoryBlock = this.PEFileToObjectModel.PEFileReader.BlobStream.GetMemoryBlockAt(signatureBlobOffset);
            //  TODO: Error checking enough space in signature memoryBlock.
            MemoryReader memoryReader = new MemoryReader(signatureMemoryBlock);
            //  TODO: Check if this is really field signature there.
            StandAloneMethodSignatureConverter standAloneSigConv = new StandAloneMethodSignatureConverter(this.PEFileToObjectModel, this.MethodDefinition, memoryReader);

            if (standAloneSigConv.ReturnTypeReference == null)
            {
                return(null);
            }
            return
                (new FunctionPointerType(
                     this.PEFileToObjectModel,
                     0xFFFFFFFF,
                     (CallingConvention)standAloneSigConv.FirstByte,
                     standAloneSigConv.ReturnCustomModifiers,
                     standAloneSigConv.IsReturnByReference,
                     standAloneSigConv.ReturnTypeReference,
                     standAloneSigConv.RequiredParameters,
                     standAloneSigConv.VarArgParameters
                     ));
        }
コード例 #2
0
 FunctionPointerType/*?*/ GetStandAloneMethodSignature(uint standAloneMethodToken) {
   StandAloneSigRow sigRow = this.PEFileToObjectModel.PEFileReader.StandAloneSigTable[standAloneMethodToken & TokenTypeIds.RIDMask];
   uint signatureBlobOffset = sigRow.Signature;
   //  TODO: error checking offset in range
   MemoryBlock signatureMemoryBlock = this.PEFileToObjectModel.PEFileReader.BlobStream.GetMemoryBlockAt(signatureBlobOffset);
   //  TODO: Error checking enough space in signature memoryBlock.
   MemoryReader memoryReader = new MemoryReader(signatureMemoryBlock);
   //  TODO: Check if this is really field signature there.
   StandAloneMethodSignatureConverter standAloneSigConv = new StandAloneMethodSignatureConverter(this.PEFileToObjectModel, this.MethodDefinition, memoryReader);
   if (standAloneSigConv.ReturnTypeReference == null) return null;
   return new FunctionPointerType((CallingConvention)standAloneSigConv.FirstByte, standAloneSigConv.IsReturnByReference, standAloneSigConv.ReturnTypeReference,
     standAloneSigConv.ReturnCustomModifiers, standAloneSigConv.RequiredParameters, standAloneSigConv.VarArgParameters, this.PEFileToObjectModel.InternFactory);
 }