예제 #1
0
        private void DoOpenObjFile(string fileName)
        {
            ObjectLibrary library = OmfLoader.LoadObject(fileName);

            library.ResolveAllSymbols();

            LibraryDisassembler dasm = new LibraryDisassembler(library);

            dasm.Analyze();

            this.program = library;
            this.procedureList.Program  = program;
            this.errorList.Program      = program;
            this.segmentList.Program    = program;
            this.libraryBrowser.Library = library;
        }
예제 #2
0
        private void DoOpenLibFile(string fileName)
        {
            ObjectLibrary library = OmfLoader.LoadLibrary(fileName);

            library.ResolveAllSymbols();

            LibraryDisassembler dasm = new LibraryDisassembler(library);

            dasm.Analyze();

            this.program = library;
            this.procedureList.Program = program;
            this.errorList.Program     = program;
            this.segmentList.Program   = program;

            // Display all unresolved symbols.
            foreach (string key in library.GetUnresolvedSymbols())
            {
                System.Diagnostics.Debug.WriteLine(string.Format(
                                                       "Symbol {0} is unresolved.", key));
            }

            this.libraryBrowser.Library = library;

#if false
            string symbolToFind = "FISRQQ";
            foreach (var mod in library.Symbols[symbolToFind])
            {
                System.Diagnostics.Debug.WriteLine(string.Format(
                                                       "Symbol {0} is defined in module {1}",
                                                       symbolToFind, mod.Name));
            }
            //library.DuplicateSymbols

            ObjectModule  module     = library.FindModule("_ctype");
            DefinedSymbol symbol     = module.DefinedNames.Find(x => x.Name == "_isupper");
            Address       entryPoint = new Address(
                symbol.BaseSegment.Id, (int)symbol.Offset);

            Disassembler16New dasm = new Disassembler16New(library);
            dasm.Analyze(entryPoint);

            this.disassemblyList.SetView(library, symbol.BaseSegment);
#endif
        }