public override object GetValue(ulong address) { if (IsPrimitive) { address += (ulong)DesktopHeap.PointerSize; } return(DesktopHeap.GetValueAtAddress(ElementType, address)); }
public override object GetArrayElementValue(ulong objRef, int index) { ulong addr = GetArrayElementAddress(objRef, index); if (addr == 0) { return(null); } ClrElementType cet = ClrElementType.Unknown; var componentType = this.ComponentType; if (componentType != null) { cet = componentType.ElementType; } else { // Slow path, we need to get the element type of the array. IObjectData data = DesktopHeap.DesktopRuntime.GetObjectData(objRef); if (data == null) { return(null); } cet = data.ElementType; } if (cet == ClrElementType.Unknown) { return(null); } if (cet == ClrElementType.String && !DesktopHeap.MemoryReader.ReadPtr(addr, out addr)) { return(null); } return(DesktopHeap.GetValueAtAddress(cet, addr)); }