static void MakeReferenceImage()
{
var module = ModuleDefinition.ReadModule("TowerFall.exe");
foreach (var type in module.AllNestedTypes())
{
if (!type.FullName.StartsWith("TowerFall.") && !type.FullName.StartsWith("Monocle"))
{
continue;
}
if (type.Name.StartsWith("<>"))
{
continue;
}
if (type.IsNested)
type.IsNestedPublic = true;
if (type.IsValueType)
{
continue;
}
type.IsSealed = false;
foreach (var field in type.Fields)
field.IsPublic = true;
foreach (var method in type.Methods)
{
method.IsPublic = true;
if (!method.IsConstructor && !method.IsStatic)
method.IsVirtual = true;
}
}
module.Write("TowerFallReference.exe");
}