Example #1
0
        /// <summary>
        /// Loads a LIB file from a BinaryReader.
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        public static ObjectLibrary LoadLibrary(BinaryReader reader)
        {
            if (reader == null)
                throw new ArgumentNullException("reader");

            ObjectLibrary library = new ObjectLibrary();

            foreach (var context in FileFormats.Omf.OmfLoader.LoadLibrary(reader))
            {
                ObjectModule module = LoadObject(context);
                library.Modules.Add(module);
            }
            return library;
        }
Example #2
0
        public static ObjectLibrary LoadObject(string fileName)
        {
            if (fileName == null)
                throw new ArgumentNullException("fileName");

            using (Stream stream = File.OpenRead(fileName))
            using (BinaryReader reader = new BinaryReader(stream))
            {
                ObjectLibrary library = new ObjectLibrary();

                var context = FileFormats.Omf.OmfLoader.LoadObject(reader);
                ObjectModule module = LoadObject(context);
                library.Modules.Add(module);

                library.AssignIdsToSegments();
                library.FileName = fileName;
                return library;
            }
        }
            public LibraryItem(ObjectLibrary library)
            {
                if (library == null)
                    throw new ArgumentNullException("library");

                this.Library = library;
                this.Modules =
                    new ObservableCollection<ModuleItem>(
                        from ObjectModule module in library.Modules
                        orderby module.Name
                        select new ModuleItem(module));
            }
 public LibraryBrowserViewModel(ObjectLibrary library)
 {
     this.Libraries = new LibraryItem[1] { new LibraryItem(library) };
 }
 public static void Disassemble(ObjectLibrary library, Address entryPoint)
 {
     LibraryDisassembler dasm = new LibraryDisassembler(library);
     dasm.Analyze(entryPoint);
 }
 public LibraryDisassembler(ObjectLibrary library)
     : base(library.Image)
 {
     this.library = library;
 }
        public static void Disassemble(ObjectLibrary library, Address entryPoint)
        {
            LibraryDisassembler dasm = new LibraryDisassembler(library);

            dasm.Analyze(entryPoint);
        }
 public LibraryDisassembler(ObjectLibrary library)
     : base(library.Image)
 {
     this.library = library;
 }