static void MakeIntermediateImage()
{
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;
}
foreach (var field in type.Fields)
field.IsPublic = true;
}
module.Write("PatchedTowerFall.exe");
}