Esempio n. 1
0
 public virtual void show_symbol_hunk(SymbolHunk hunk)
 {
     foreach (var symbol in hunk.symbols)
     {
         this.print_symbol((uint) symbol.Value, symbol.Key, "");
     }
 }
Esempio n. 2
0
 public void ParseSymbol(Action<Hunk> h)
 {
     var hunk = new SymbolHunk();
     h(hunk);
     var symbols = new Dictionary<string, int>();
     int name_len = 1;
     hunk.symbols = symbols;
     while (name_len > 0)
     {
         var x = this.ReadString();
         if (x == null)
             throw new BadImageFormatException(string.Format("{0} has invalid symbol name", hunk.HunkType));
         else if (x.Length == 0)
         {
             // last name occurred
             break;
         }
         var value = this.read_long();
         if (value < 0)
             throw new NotImplementedException(string.Format("{0} has invalid symbol value", hunk.HunkType));
         symbols[x] = value;
     }
 }