Exemplo n.º 1
0
        static void DisassembleRom(RomVersion version, string path, Func <DisassemblyTask, bool> filter)
        {
            Console.WriteLine($"{version} {path}");
            Console.Write("Initializing task list:  ");
            Rom rom = Rom.New(path, version);
            List <DisassemblyTask> taskList = DisassemblyTask.CreateTaskList(rom);

            taskList = taskList.Where(filter).Where(x => x.VRom.End > 0).ToList();

            if (taskList.Count == 0)
            {
                Console.WriteLine("Error: No tasks to process!");
                return;
            }

            Console.WriteLine("DONE!");
            Console.Write($"Loading symbol table from file: ");
            LoadFunctionDatabase(version);

            Console.WriteLine("DONE!");
            Console.WriteLine("Disassembling files: ");

            Stream getFile(FileAddress x) => rom.Files.GetFile(x);

            DisassembleTasks(rom.Version, taskList, getFile);
            DumpFoundFunctions(rom.Version, Disassemble.GetFunctions());
        }
Exemplo n.º 2
0
        static void DisassembleRom(RomVersion ver, string path)
        {
            Rom rom;

            Console.Write("Initializing task list:  ");
            if (ver.Game == Game.OcarinaOfTime)
            {
                rom = new ORom(path, ver);
            }
            else
            {
                rom = new MRom(path, ver);
            }

            List <DisassemblyTask> taskList = DisassemblyTask.CreateTaskList(rom);

            taskList = taskList.Where(x => x.VRom.End > 0).ToList();
            Console.WriteLine("DONE!");
            Console.Write($"Building symbol table: ");
            Stream getFile(FileAddress x) => rom.Files.GetFile(x);

            LoadFunctionDatabase(ver);
            GetSymbols(taskList, rom.Version, getFile);

            Console.WriteLine("DONE!");
            Console.WriteLine("Disassembling files: ");

            DisassembleTasks(rom.Version, taskList, getFile);
            DumpFoundFunctions(rom.Version, Disassemble.GetFunctions());
        }