Patcher.Patcher.MakeReferenceImage C# (CSharp) Method

MakeReferenceImage() static private method

Unseal, publicize, virtualize.
static private MakeReferenceImage ( ) : void
return void
        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");
        }