Q
Q
qwerz1232015-01-14 12:26:16
.NET
qwerz123, 2015-01-14 12:26:16

How to change one line in an already compiled .exe C# file?

Hello!
There is already compiled .exe C# file. It needs to change a single line.
Need instead:

{
    return (bool).......;
}

do:
{
    return true;
}

Has anyone already encountered this? Any thoughts?
Regards
Additional:
Thank you all for your replies. Unfortunately, after decompilation, the code cannot be compiled back (I'm talking about DotPeek or Reflector).
Also, it did not work out after ildasm -> ilasm.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
Q
qwerz123, 2015-05-17
@qwerz123

The question was asked a long time ago. Got it figured out a long time ago. I'll answer in case others need it. Nothing helped except .Net Reflector and its plugin - Reflexil. Open the program with a reflector and either rewrite the entire method (if possible), or change the CIL codes.

A
Alexander Taratin, 2015-01-14
@Taraflex

msdn.microsoft.com/en-us/library/f7dy01k1(v=vs.110...
msdn.microsoft.com/en-us/library/496e4ekx(v=vs.110...

P
Puma Thailand, 2015-01-14
@opium

Decompile the code and change the line. Compile code

O
Oxoron, 2015-01-23
@Oxoron

Is it necessary to change the whole method? If you really need it, you can use the Extension methods. You can try to inherit the class and override the method.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question