![]() |
![]() |
![]() |
![]() |
![]() |
||||||||||
|
||||||||||||||
![]() |
#1
|
|||
|
|||
![]() If I want to whizz down the TypeDef table in an Assembly (and possibly the Method table) and reset the Flags on each type to make them all public, is there a tool in existence that would let me do it?
There's a pretty good post on the Assembly structure here: http://www.codeproject.com/Articles/...ET-File-Format And I'm sure given enough time I could knock something up, but rather than yak shaving I was wondering if a tool already existed. Many thanks, DNR |
#2
|
|||
|
|||
![]() I'm not aware of any ready-made tool. Most obvious choice would be to use Mono.Cecil and write ~20 line utility for that purpose.
|
#3
|
|||
|
|||
![]() OK, thanks. There are hundred of types...and I'm lazy
![]() Will post back when I have something working. Edit: Wish I'd seen Cecil sooner ![]() class Program { static void Main(string[] args) { AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly( @"C:\Path\To\InputAssembly.dll"); foreach (TypeDefinition typeDefinition in assembly.MainModule.Types) { Console.WriteLine(typeDefinition.FullName); typeDefinition.IsPublic = true; } assembly.Write(@"C:\Path\To\OutputAssembly.dll"); } } Thanks again Kao Last edited by DotNetResearcher2 : 01-24-2012 at 09:41 AM. |