Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove the strong name from 3rd party assemblies?

How can I remove a strong name from a 3rd party assembly that I do not have the source code for, maybe using ilasm/ildasm (since it is possible to add a strong name using ilasm/ildasm)?

Generally, it seems to be possible, since this tool seems to be able to do this.

like image 445
bitbonk Avatar asked Aug 02 '16 09:08

bitbonk


2 Answers

Just use a tool to do it for you, doing it manually will probably take you too much time and hell, if there are tools out there then why reinvent the wheel?

Personally I have never used SNRemove but here is a list of tools I generally use:

  • de4dot - universal .NET deobfuscator/unpacker
  • Strong.Name.Helper v1.7
  • Reflexil (plugin for .NET Reflector)

EDIT: simple-assembly-explorer/SimpleAssemblyExplorer.Core/Assembler/Assembler.cs - this class should give you an idea of how strong name keys can be removed from strong named assemblies.

like image 107
Jevgeni Geurtsen Avatar answered Oct 16 '22 02:10

Jevgeni Geurtsen


This is to remove strong name validation, not remove the strong name signature, however searches for strongname validation errors seem to route to this question so this is not irrelevant.

sn.exe can be used to disable strongname validation (sn.exe can be accessed via visual studio developer command prompt)

To disable strongname validation for all assemblies with a given public key token:

sn.exe -Vr *,<public key hex token>

or to disable validation for all assemblies with any public key:

sn.exe -Vr *,*
like image 37
James Wierzba Avatar answered Oct 16 '22 03:10

James Wierzba