public List <ImageSymbol> GetAllSymbols() { //TODO: ask if number of symbols is available and preallocate list List <ImageSymbol> symbols = new List <ImageSymbol>(); IntPtr syms = prv.GetSymbols(); IntPtr sym; for (int off = 0; ; off += Marshal.SizeOf(sym)) { sym = Marshal.ReadIntPtr(syms, off); if (sym == IntPtr.Zero) { break; } ulong start = prv.GetSymbolStart(sym); ulong end = prv.GetSymbolEnd(sym); symbols.Add(new ImageSymbol(new Address32((uint)start)) { Size = (uint)(end - start), Name = prv.GetSymbolName(sym) }); } return(symbols); }
public List <ImageSymbol> GetAllSymbols() { //TODO: ask if number of symbols is available and preallocate list List <ImageSymbol> symbols = new List <ImageSymbol>(); IntPtr syms = prv.GetSymbols(); IntPtr sym; for (int off = 0; ; off += Marshal.SizeOf(sym)) { sym = Marshal.ReadIntPtr(syms, off); if (sym == IntPtr.Zero) { break; } ulong start = prv.GetSymbolStart(sym); ulong end = prv.GetSymbolEnd(sym); symbols.Add(ImageSymbol.Create( SymbolType.Unknown, arch, Address.Ptr32((uint)start), name: prv.GetSymbolName(sym), dataType: new UnknownType((int)(end - start)))); } return(symbols); }