Exemplo n.º 1
0
 public override void Render(ImageSegment segment, Program program, Formatter formatter)
 {
     var entries = shdr.EntryCount();
     var symtab = shdr.LinkedSection;
     var rdr = loader.CreateReader(shdr.FileOffset);
     for (int i = 0; i < entries; ++i)
     {
         uint iName;
         if (!rdr.TryReadUInt32(out iName))
             return;
         uint value;
         if (!rdr.TryReadUInt32(out value))
             return;
         uint size;
         if (!rdr.TryReadUInt32(out size))
             return;
         byte info;
         if (!rdr.TryReadByte(out info))
             return;
         byte other;
         if (!rdr.TryReadByte(out other))
             return;
         ushort shIndex;
         if (!rdr.TryReadUInt16(out shIndex))
             return;
         string symStr = loader.GetStrPtr(symtab, iName);
         string segName = loader.GetSectionName(shIndex);
         formatter.Write("{0:X4} {1,-40} {2:X8} {3:X8} {4:X2} {5}", i, symStr, value, size, info & 0xFF, segName);
         formatter.WriteLine();
     }
 }
Exemplo n.º 2
0
        public override void Render(ImageSegment segment, Program program, Formatter formatter)
        {
            var entries = shdr.sh_size / shdr.sh_entsize;
            var symtab  = (int)shdr.sh_link;
            var rdr     = loader.CreateReader(shdr.sh_offset);

            for (int i = 0; i < entries; ++i)
            {
                uint iName;
                if (!rdr.TryReadUInt32(out iName))
                {
                    return;
                }
                uint value;
                if (!rdr.TryReadUInt32(out value))
                {
                    return;
                }
                uint size;
                if (!rdr.TryReadUInt32(out size))
                {
                    return;
                }
                byte info;
                if (!rdr.TryReadByte(out info))
                {
                    return;
                }
                byte other;
                if (!rdr.TryReadByte(out other))
                {
                    return;
                }
                ushort shIndex;
                if (!rdr.TryReadUInt16(out shIndex))
                {
                    return;
                }
                string symStr  = loader.GetStrPtr(symtab, iName);
                string segName = loader.GetSectionName(shIndex);
                formatter.Write("{0,-40} {1:X8} {2:X8} {3:X2} {4}", symStr, value, size, info & 0xFF, segName);
                formatter.WriteLine();
            }
        }