0

I am using ClrMd to examine memory in a C# app and successively created a runtime object on a process. I use the runtime object to call EnumerateObjects(). This returns a collection of ulongs that are references to all the objects on the heap. If the reference is to a string, I have no problem reconstituting the string using the ClrType GetValue(). However, when I call GetValue() on a reference to other objects, GetValue returns what appears to be another reference (i.e. ulong).

Do I need to execute some kind of C# unsafe code? code sample By the way, I get the same result with EnumerateObjectAddresses() (is there a difference between the two?)

Richard
  • 181
  • 1
  • 3
  • With that ulong, you can retrieve the type with `ClrHeap.GetObjectType`, and then retrieve the fields of that object, and so on – Kevin Gosse Apr 06 '20 at 15:48
  • I did as you suggested, i.e. executed: ClrType type2 = runtime.Heap.GetObjectType((ulong) myObject); and the result was type2 = null. – Richard Apr 07 '20 at 19:50

0 Answers0