Code Monkey home page Code Monkey logo

Comments (10)

 avatar commented on July 25, 2024

It's obfuscated and you should try de4dot first to clean it.

However, if you don't want to clean it, then you can still save it but it might not run afterwards. You can ignore all errors dnlib detects during writing by adding a dummy logger:

var mod = ModuleDefMD.Load(typeof(int).Module);
var writerOptions = new dnlib.DotNet.Writer.ModuleWriterOptions(mod);
writerOptions.Logger = DummyLogger.NoThrowInstance;
mod.Write(@"C:\out.dll", writerOptions);

from dnlib.

answering007 avatar answering007 commented on July 25, 2024

The goal is to get clean working assembly.
Unfortunately de4dot 3.1.41592 didn’t reconstruct method bodies and I try to “dump” assembly, using dnlib. Do you plan to update .Net Reactor deobfuscator in de4dot?

from dnlib.

 avatar commented on July 25, 2024

If de4dot fails to deobfuscate it, email me the file.

from dnlib.

 avatar commented on July 25, 2024

My email address is seen when you start de4dot. You just replied to github.com's issue email. This is the wrong place to discuss de4dot.

from dnlib.

RexProg avatar RexProg commented on July 25, 2024

writerOptions.Logger = DummyLogger.NoThrowInstance;

I Use It
but my app get an exception
"Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified."

what can i do to solve it?

from dnlib.

 avatar commented on July 25, 2024

You probably don't have an assembly resolver, see the readme file on the front page.

from dnlib.

RexProg avatar RexProg commented on July 25, 2024
                AssemblyResolver asmResolver = new AssemblyResolver();
                ModuleContext modCtx = new ModuleContext(asmResolver);               
                asmResolver.DefaultModuleContext = modCtx;              
                asmResolver.EnableTypeDefCache = true;
                GlobAssembly.Asm = ModuleDefMD.Load(GlobAssembly.AsmInputPath);
                GlobAssembly.Asm.Context = modCtx;
                GlobAssembly.Asm.Context.AssemblyResolver.AddToCache(GlobAssembly.Asm);

My code for resolve references is this
is it wrong?
Because now i have that problem too

from dnlib.

 avatar commented on July 25, 2024

Use this method.

from dnlib.

RexProg avatar RexProg commented on July 25, 2024

excuse me
my problem isn't solved
i made a simple project to show my problem

when i build with NoThrowInstance app have an exception
but without it app run correctly
anyway i need NoThrowInstance

from dnlib.

RexProg avatar RexProg commented on July 25, 2024

my problem is solved
ModuleWriterOptions();
i use this overloads
i change it to
ModuleWriterOptions(moduleDef);
and my problem solved
excuse me for my spam

from dnlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.