Exemplo n.º 1
0
        public IMethod ReadMethodRef()
        {
            var babelMethodRef = new MethodRefReader(this).Read();

            var method = GetMethodRef(babelMethodRef);

            if (method == null)
            {
                throw new ApplicationException($"Could not find method '{Utils.RemoveNewlines(babelMethodRef.Name)}' in type '{Utils.RemoveNewlines(babelMethodRef.DeclaringType)}'");
            }

            var git = babelMethodRef.DeclaringType.ToGenericInstSig();

            if (git == null)
            {
                return(method);
            }

            var mr = new MemberRefUser(module, method.Name, method.MethodSig.Clone(), babelMethodRef.DeclaringType.ToTypeDefOrRef());

            return(module.UpdateRowId(mr));
        }
Exemplo n.º 2
0
 public MethodDefReader(ImageReader imageReader)
 {
     bmd              = new BabelMethodDef();
     methodRefReader  = new MethodRefReader(imageReader, bmd);
     methodBodyReader = new MethodBodyReader(imageReader);
 }
Exemplo n.º 3
0
		public IMethod ReadMethodRef() {
			var babelMethodRef = new MethodRefReader(this, reader).Read();

			var method = GetMethodRef(babelMethodRef);
			if (method == null) {
				throw new ApplicationException(string.Format("Could not find method '{0}' in type '{1}'",
							Utils.RemoveNewlines(babelMethodRef.Name),
							Utils.RemoveNewlines(babelMethodRef.DeclaringType)));
			}

			var git = babelMethodRef.DeclaringType.ToGenericInstSig();
			if (git == null)
				return method;

			var mr = new MemberRefUser(module, method.Name, method.MethodSig.Clone(), babelMethodRef.DeclaringType.ToTypeDefOrRef());
			return module.UpdateRowId(mr);
		}
Exemplo n.º 4
0
 public MethodDefReader(ImageReader imageReader, IBinaryReader reader)
 {
     this.bmd              = new BabelMethodDef();
     this.methodRefReader  = new MethodRefReader(imageReader, reader, bmd);
     this.methodBodyReader = new MethodBodyReader(imageReader, reader);
 }
		public MethodDefReader(ImageReader imageReader, IBinaryReader reader) {
			this.bmd = new BabelMethodDef();
			this.methodRefReader = new MethodRefReader(imageReader, reader, bmd);
			this.methodBodyReader = new MethodBodyReader(imageReader, reader);
		}