public Type ParseFieldSignature(uint offset, TypeDefinition declaringType) { CheckDisposed(); var blob = ReadBlob(offset); return(SignatureParser.ParseFieldSignature(blob, declaringType)); }
public static uint ParseLength(IReadOnlyList<byte> blob, out int bytesRead) { using (var parser = new SignatureParser(blob)) { var ret = parser.ReadUInt(); bytesRead = parser.m_readCount; return ret; } }
public static uint ParseLength(IReadOnlyList <byte> blob, out int bytesRead) { using (var parser = new SignatureParser(blob)) { var ret = parser.ReadUInt(); bytesRead = parser.m_readCount; return(ret); } }
public IReadOnlyList <byte> ReadBlob(uint offset) { CheckDisposed(); if (BlobStream == null || offset > BlobStream->Size) { throw new ArgumentOutOfRangeException("offset", "Invalid blog offset."); } var pBlob = ((byte *)m_metadataRoot + BlobStream->Offset) + offset; var bufferWrapper = new BufferWrapper(pBlob, (int)(BlobStream->Size - offset)); int bytesRead; var length = SignatureParser.ParseLength(bufferWrapper, out bytesRead); if (length > checked (BlobStream->Size - offset - bytesRead.AssumeGTE(0))) { throw new InvalidOperationException("Blob has invalid size"); } return(new BufferWrapper(pBlob + bytesRead, (int)length)); }
public String ReadUserString(uint offset) { if (UserStringsStream == null || offset > UserStringsStream->Size) { throw new ArgumentOutOfRangeException("offset", "Invalid blog offset."); } var pBlob = ((byte *)m_metadataRoot + UserStringsStream->Offset) + offset; var bufferWrapper = new BufferWrapper(pBlob, (int)(BlobStream->Size - offset)); int bytesRead; var length = SignatureParser.ParseLength(bufferWrapper, out bytesRead); if (length > checked (UserStringsStream->Size - offset - bytesRead.AssumeGTE(0))) { throw new InvalidOperationException("String has invalid size"); } if (length == 0) { return(""); } var pStr = (char *)(pBlob + bytesRead); return(new string(pStr, 0, NativePlatform.Default.WcsLen(pStr, (int)length / 2))); }
public static Method ParseMethodSignature(IReadOnlyList<byte> signature, MethodDefinition targetMethod) { using (var parser = new SignatureParser(signature, targetMethod)) { return parser.ParseMethodSignature(); } }
public static MarshalInfo ParseMarshalDescriptor(IReadOnlyList<byte> signature) { using (var parser = new SignatureParser(signature)) { return parser.ParseMashalDescriptor(); } }
public static Type ParseFieldSignature(IReadOnlyList<byte> signature, TypeDefinition declaringType) { using (var parser = new SignatureParser(signature, declaringType)) { return parser.ParseFieldSignature(); } }
public static MarshalInfo ParseMarshalDescriptor(IReadOnlyList <byte> signature) { using (var parser = new SignatureParser(signature)) { return(parser.ParseMashalDescriptor()); } }
public static Method ParseMethodSignature(IReadOnlyList <byte> signature, MethodDefinition targetMethod) { using (var parser = new SignatureParser(signature, targetMethod)) { return(parser.ParseMethodSignature()); } }
public static Type ParseFieldSignature(IReadOnlyList <byte> signature, TypeDefinition declaringType) { using (var parser = new SignatureParser(signature, declaringType)) { return(parser.ParseFieldSignature()); } }