Exemplo n.º 1
0
        private FileHeader LoadHeader()
        {
            var rdr   = new LeImageReader(RawImage, 0);
            var magic = rdr.ReadLeUInt16();

            switch (magic)
            {
            case 0x014C: arch = new IntelArchitecture(ProcessorMode.Protected32); break;

            default: throw new NotSupportedException();
            }
            return(new FileHeader
            {
                f_magic = magic,
                f_nscns = rdr.ReadUInt16(),
                f_timdat = rdr.ReadUInt32(),
                f_symptr = rdr.ReadUInt32(),
                f_nsyms = rdr.ReadUInt32(),
                f_opthdr = rdr.ReadUInt16(),
                f_flags = rdr.ReadUInt16(),
            });
        }
Exemplo n.º 2
0
        private FileHeader LoadHeader()
        {
            var rdr    = new LeImageReader(RawImage, 0);
            var magic  = rdr.ReadLeUInt16();
            var cfgSvc = Services.RequireService <IConfigurationService>();

            switch (magic)
            {
            case 0x014C: arch = cfgSvc.GetArchitecture("x86-real-16"); break;

            default: throw new NotSupportedException();
            }
            return(new FileHeader
            {
                f_magic = magic,
                f_nscns = rdr.ReadUInt16(),
                f_timdat = rdr.ReadUInt32(),
                f_symptr = rdr.ReadUInt32(),
                f_nsyms = rdr.ReadUInt32(),
                f_opthdr = rdr.ReadUInt16(),
                f_flags = rdr.ReadUInt16(),
            });
        }