예제 #1
0
        public static PubvarEntry[] From(BinaryReader rd, SectionEntry header, SmxNameTable names)
        {
            if (header.Size % Size != 0)
            {
                throw new Exception("invalid pubvar table size");
            }
            var count   = header.Size / Size;
            var entries = new PubvarEntry[count];

            for (var i = 0; i < count; i++)
            {
                var entry = new PubvarEntry();
                entry.Address  = rd.ReadUInt32();
                entry.nameoffs = rd.ReadInt32();
                entry.Name     = names.StringAt(entry.nameoffs);
                entries[i]     = entry;
            }
            return(entries);
        }
예제 #2
0
 public SmxPubvarTable(FileHeader file, SectionEntry header, SmxNameTable names)
     : base(file, header)
 {
     pubvars_ = PubvarEntry.From(file.SectionReader(header), header, names);
 }
예제 #3
0
 public static PubvarEntry[] From(BinaryReader rd, SectionEntry header, SmxNameTable names)
 {
     if (header.Size % Size != 0)
         throw new Exception("invalid pubvar table size");
     var count = header.Size / Size;
     var entries = new PubvarEntry[count];
     for (var i = 0; i < count; i++)
     {
         var entry = new PubvarEntry();
         entry.Address = rd.ReadUInt32();
         entry.nameoffs = rd.ReadInt32();
         entry.Name = names.StringAt(entry.nameoffs);
         entries[i] = entry;
     }
     return entries;
 }