Reverse Engineering RET Homepage RET Members Reverse Engineering Projects Reverse Engineering Papers Reversing Challenges Reverser Tools RET Re-Search Engine Reverse Engineering Forum Reverse Engineering Links

Go Back   Reverse Engineering Team Board > Reverse Engineering Board > .NET Reverse Engineering
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 01-24-2012, 08:29 AM
DotNetResearcher2 DotNetResearcher2 is offline
Member
 
Join Date: Sep 2011
Posts: 6
Default Mass flag reset

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
Reply With Quote
  #2  
Old 01-24-2012, 09:09 AM
kao kao is offline
Senior Member
 
Join Date: Sep 2007
Posts: 184
Default

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.
Reply With Quote
  #3  
Old 01-24-2012, 09:22 AM
DotNetResearcher2 DotNetResearcher2 is offline
Member
 
Join Date: Sep 2011
Posts: 6
Default

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 I mean, I'd heard about it, but not really understood it. Turns out my problem was trivial to solve:

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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump





Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.