Code Monkey home page Code Monkey logo

Comments (3)

aKzenT avatar aKzenT commented on July 25, 2024

To add to this, it is also not possible to round trip such assemblies. When loading a delay signed assembly and then directly saving it again, the assemblies will have the "StrongName" flag set in the header, while normally delay signed assemblies do not have the flag set. The same applies to test-signed assemblies.

from dnlib.

 avatar commented on July 25, 2024

I've added a DelaySign option to ModuleWriterOptions that you can use.

Generate the public key:

sn -p mykey.snk mypublickey.snk

Delay sign it:

var file = @"c:\some\path\DelaySigned.exe";
var snPublicKey = new StrongNamePublicKey(@"c:\some\path\mypublickey.snk");
var ctx = ModuleDef.CreateModuleContext();
var mod = ModuleDefMD.Load(file, ctx);
//...
var opts = new ModuleWriterOptions(mod);
opts.DelaySign = true;
opts.StrongNamePublicKey = snPublicKey;
mod.Write(@"c:\some\path\DelaySigned_new.exe", opts);

from dnlib.

aKzenT avatar aKzenT commented on July 25, 2024

Great! Thank you very much. Is there also a property to check if a loaded
assembly is delay signed (ModuleDef) and in this case would the writer be
initialized correctly to roundtrip?

Thanks again!

Edit: Removed remark about public key as this is already handled. Was confused about the .snk ending.

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.