Bin2Object icon indicating copy to clipboard operation
Bin2Object copied to clipboard

Allow MapObject to copy field types that are mapped inside the ObjectMapping

Open AeonLucid opened this issue 3 years ago • 0 comments

For my Il2CppInspector loader I had to add a mapping for Il2CppAssemblyDefinition and Il2CppAssemblyNameDefinition.

public class Il2CppAssemblyDefinition
{
    // ..

    public Il2CppAssemblyNameDefinition aname_post16;
}

public class Il2CppAssemblyNameDefinition
{
    // ..
}
stream.AddObjectMapping(typeof(Il2CppAssemblyDefinition), typeof(Types.Il2CppAssemblyDefinition));
stream.AddObjectMapping(typeof(Il2CppAssemblyNameDefinition), typeof(Types.Il2CppAssemblyNameDefinition));

Without this pull request, this would fail with the exception Object must implement IConvertible because it can not cast between two different types on Convert.ChangeType.

AeonLucid avatar Jul 31 '21 03:07 AeonLucid