0

The class & method are public & static, so I can call the method but not override it! The program is already compiled & I have no access to the source code, so I cannot edit it. And I cannot add something to the library. (Just have access to the .NETFramework 4.0)

The program loads up your .cs file(s) and lets you override a method called pulse which is like a main method, the pulse method gets called over and over again during run time. So you can call your own written code with that method.

The method I need intercept/log will get called when a certain condition is met and will then get called over and over again (every few seconds) until the final condition is met. The parameter will not change (from first call until final condition) I just need to find out with what parameter value the method gets called, nothing more :)

How can I save the parameter entry value when the method I want to log/intercept gets called?

Thanks for your answers!

  • 1
    I tried to understand what you're asking for but failed. You might want to consider rephrasing your question more clearly to get some answers. – Avish Jul 20 '12 at 20:56
  • You can do something similar to this in PostSharp - see http://stackoverflow.com/questions/3196865/postsharp-on-assemblies-i-dont-have-source-for. You could also look at the code in your assembly usin ILSpy - http://wiki.sharpdevelop.net/ILSpy.ashx See also: http://stackoverflow.com/questions/25803/how-do-i-intercept-a-method-call-in-c – dash Jul 20 '12 at 21:01
  • What do you want to do different than the answers in http://stackoverflow.com/questions/11561184/finding-out-parameter-values-of-method-call-static-class-which-i-do-not-own provided? – Peter Ritchie Jul 21 '12 at 00:56
  • http://stackoverflow.com/questions/25803/how-do-i-intercept-a-method-call-in-c – sawbeanraz Jun 29 '16 at 09:48

0 Answers0