Closed ViRb3 closed 7 years ago
Example?
Say I want to find a call to System.Console Read
.
I create an instruction to find like in your example project:
Instruction.Create(OpCodes.Call, p.BuildMemberRef("System", "Console", "Read", Patcher.MemberRefType.Static)),
BuildMemberRef()
does this:
return new MemberRefUser(_module, "Read",
MethodSig.CreateStatic(_module.CorLibTypes.Void, _module.CorLibTypes.String),
typeRef);
So it creates a MemberRef with signature like this:
Parameters: String
Returns: Void
But the real signature is:
Parameters: None
Returns: String
Thus, I'm pretty confident it will fail in finding it. I don't have access to a VS environment so I haven't tested anything, I may be wrong.
Thanks for the report, I will look into it ASAP!
this should be fixed with #13 since BuildMemberRef
is supported only for Console.WriteLine()
and similar signature methods
Isn't this going to fail to match the original members with a different signature?