dnlib icon indicating copy to clipboard operation
dnlib copied to clipboard

How to load a source code?

Open Ambal2221 opened this issue 6 years ago • 2 comments

Is it possible to somehow load the source code (class files) into these library without decompiling .exe? Suppose I need to upload my code and rename all methods and fields to random values, and save the already renamed code.

Ambal2221 avatar Jul 01 '20 09:07 Ambal2221

Sorry but dnlib doesn't work like that. But dnlib can be used for disassembling a compiled .NET assembly. Here's a good technique. Compile your class files into a library, load it with dnlib, and use dnlib to rename all definitions you want to rename. Then, use dnspy to export it as source code.

or you can just ctrl + r + r in visual studio and rename them manually.

CursedSheep avatar Jul 01 '20 12:07 CursedSheep

Sorry but dnlib doesn't work like that. But dnlib can be used for disassembling a compiled .NET assembly. Here's a good technique. Compile your class files into a library, load it with dnlib, and use dnlib to rename all definitions you want to rename. Then, use dnspy to export it as source code.

or you can just ctrl + r + r in visual studio and rename them manually.

Ok, thanks

Ambal2221 avatar Jul 01 '20 13:07 Ambal2221