You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var targetType = module.GetTypeByName("x.y.classname");
if (targetType == null)
{
continue;
}
var staticField = targetType.GetStaticFieldByName("FieldName");
if (!staticField.IsInitialized(runtime.AppDomains[0]))
{
Console.WriteLine("Static field is not initialized.");
return;
}
var objAddress = staticField.GetAddress(runtime.AppDomains[0]);
if (objAddress == 0)
{
Console.WriteLine("Obj address is 0");
return;
}
var targetObj = runtime.Heap.GetObject(objAddress);
if (targetObj.IsNull)
{
Console.WriteLine("target object is null.");
return;
}
if (!targetObj.IsValid)
{
Console.WriteLine("target object is not valid."); // FAILS HERE <<<<<<<<<<<
return;
}
if (targetObj.Type == null)
{
Console.WriteLine("target object.Type is null.");
return;
}
Console.WriteLine("success so far.");
The text was updated successfully, but these errors were encountered:
Why does this fail at the indicated line?
The text was updated successfully, but these errors were encountered: