H
H
h1_0ne2019-01-10 17:34:35
C++ / C#
h1_0ne, 2019-01-10 17:34:35

How to open dll file as text in c#?

You need to open the dll file as text, edit it and save it back. After opening by standard means, it reads only the first two letters MZ, and then puts a question mark in a triangle, although there is a lot of everything after mz. How to do it, for example, using the same notepad++, but through c#? Or is there a more convenient way/library?
5c3757a81042c393196097.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Peter, 2019-01-10
@petermzg

dll is an executable file, that is, it contains binary code. This code was generated by the .net platform compiler.
If no protection measures have been applied to the code, then you can restore the C# code using utilities that can work with IL code. For example ".NET Reflector"

A
Alexander Ananiev, 2019-01-10
@SaNNy32

In order to read the contents of a dll file, it must be opened as a binary file, not as a text file. The resulting byte array can already be interpreted as text in the desired encoding.

M
MrDywar Pichugin, 2019-01-11
@Dywar

The easiest and most convenient way, if there are a lot of changes or they are not simple.
Download free dotpeek .
Open dll or exe in it as a project (project files will be generated).
We edit and compile again, but with the changes made.
If you want without recompiling, then there are many other utilities, I forgot the names already, but there are many of them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question