Adding write to log using Reflection

201 Views Asked by At

I'm trying to use Reflexil to log a string in an existing method in a dll I haven't got the source code to. The problem is, I can add a method that uses System.IO because I'm trying to add it to a dll that didn't use file writing before and can't add references.

Is there some log writing command that is accessible through System.dll I can use?

1

There are 1 best solutions below

2
On BEST ANSWER

This is a partial solution to the problem

I modified the original constructor to a normal method Created a new constructor and matched the signature then called the new method with the addition of the logging code

For now this compiles, but for some reason the exe crashes the second it starts