コード例 #1
0
ファイル: Studio.cs プロジェクト: zhukunqian/AssetStudio
        public static string GetScriptString(ObjectReader reader)
        {
            if (!ModuleLoaded)
            {
                var openFolderDialog = new OpenFolderDialog();
                openFolderDialog.Title = "Select Assembly Folder";
                if (openFolderDialog.ShowDialog() == DialogResult.OK)
                {
                    var files         = Directory.GetFiles(openFolderDialog.Folder, "*.dll");
                    var moduleContext = new ModuleContext();
                    var asmResolver   = new AssemblyResolver(moduleContext, true);
                    var resolver      = new Resolver(asmResolver);
                    moduleContext.AssemblyResolver = asmResolver;
                    moduleContext.Resolver         = resolver;
                    try
                    {
                        foreach (var file in files)
                        {
                            var module = ModuleDefMD.Load(file, moduleContext);
                            LoadedModuleDic.Add(Path.GetFileName(file), module);
                        }
                    }
                    catch
                    {
                        // ignored
                    }
                }

                ModuleLoaded = true;
            }

            return(ScriptHelper.GetScriptString(reader, LoadedModuleDic));
        }
コード例 #2
0
ファイル: Studio.cs プロジェクト: ayan0312/AssetStudio
 public static List <TypeTreeNode> MonoBehaviourToTypeTreeNodes(MonoBehaviour m_MonoBehaviour)
 {
     if (!assemblyLoader.Loaded)
     {
         var openFolderDialog = new OpenFolderDialog();
         openFolderDialog.Title = "Select Assembly Folder";
         if (openFolderDialog.ShowDialog() == DialogResult.OK)
         {
             assemblyLoader.Load(openFolderDialog.Folder);
         }
         else
         {
             assemblyLoader.Loaded = true;
         }
     }
     return(m_MonoBehaviour.ConvertToTypeTreeNodes(assemblyLoader));
 }
コード例 #3
0
ファイル: Studio.cs プロジェクト: tungthit/AssetStudio
        public static string GetScriptString(ObjectReader reader)
        {
            if (scriptDumper == null)
            {
                var openFolderDialog = new OpenFolderDialog();
                openFolderDialog.Title = "Select Assembly Folder";
                if (openFolderDialog.ShowDialog() == DialogResult.OK)
                {
                    scriptDumper = new ScriptDumper(openFolderDialog.Folder);
                }
                else
                {
                    scriptDumper = new ScriptDumper();
                }
            }

            return(scriptDumper.DumpScript(reader));
        }