예제 #1
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;
            }
        }
예제 #2
0
파일: HunkShow.cs 프로젝트: relaxar/reko
 public virtual void show_symbol_hunk(SymbolHunk hunk)
 {
     foreach (var symbol in hunk.symbols)
     {
         this.print_symbol((uint)symbol.Value, symbol.Key, "");
     }
 }
예제 #3
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;
     }
 }