Skip to content

Instantly share code, notes, and snippets.

@Criteo-dotnet-blog
Created April 24, 2017 07:57
Show Gist options
  • Save Criteo-dotnet-blog/233df81ef1a886d13084bbfb0391c132 to your computer and use it in GitHub Desktop.
Save Criteo-dotnet-blog/233df81ef1a886d13084bbfb0391c132 to your computer and use it in GitHub Desktop.
private object GetFieldValue(ClrHeap heap, ulong address, string fieldName)
{
    var type = heap.GetObjectType(address);
    ClrInstanceField field = type.GetFieldByName(fieldName);
    if (field == null)
        return null;
    return field.GetValue(address);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment