Beispiel #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);
        }
Beispiel #2
0
 public SmxPubvarTable(FileHeader file, SectionEntry header, SmxNameTable names)
     : base(file, header)
 {
     pubvars_ = PubvarEntry.From(file.SectionReader(header), header, names);
 }
Beispiel #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;
 }