Created
October 14, 2016 14:49
-
-
Save spouliot/7d86498f8a5e55f6b639afc2daa3dd7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Mono.Cecil; | |
using Mono.Cecil.Mdb; | |
namespace roundtrip | |
{ | |
class MainClass | |
{ | |
public static void Main (string [] args) | |
{ | |
var ar = new DefaultAssemblyResolver (); | |
ar.AddSearchDirectory ("/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS"); | |
ar.AddSearchDirectory ("/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Facades"); | |
var rp = new ReaderParameters () { | |
ReadSymbols = true, | |
SymbolReaderProvider = new MdbReaderProvider (), | |
AssemblyResolver = ar, | |
}; | |
var n = args [0]; | |
var a = AssemblyDefinition.ReadAssembly (n, rp); | |
var wp = new WriterParameters () { | |
SymbolWriterProvider = new MdbWriterProvider (), | |
WriteSymbols = true, | |
}; | |
a.Write (n + ".roundtrip", wp); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment