Example #1
0
        private static void DisassembleTasks(RomVersion ver, List <DisassemblyTask> taskList, Func <FileAddress, Stream> getFile)
        {
            var folder = GetFolder(ver);

            Console.CursorVisible = false;
            foreach (var task in taskList)
            {
                string filename = $"{folder}/{task.Name}.txt";
                Console.Write($"\r{filename.PadRight(Console.BufferWidth)}");


                var file = getFile(task.VRom);

                foreach (var action in task.PreparseActions)
                {
                    action(file);
                }

                foreach (var item in task.Functions)
                {
                    Disassemble.AddFunction(item);
                }

                using var br = new BinaryReader(file);
                Disassemble.FirstParse(br, task);

                using var sw = File.CreateText(filename);
                Disassemble.Task(sw, br, task);
            }
            Console.CursorVisible = true;
        }
Example #2
0
        private static void GetSymbols(List <DisassemblyTask> tasks, RomVersion ver, Func <FileAddress, Stream> getFile)
        {
            foreach (var task in tasks)
            {
                BinaryReader FileReader = new BinaryReader(getFile(task.VRom));

                foreach (var item in task.Functions)
                {
                    Disassemble.AddFunction(item);
                }

                //Get a list of function names
                Disassemble.FirstParse(FileReader, task);
            }
        }