Add BlobReader, fix Il2CppType for 27.2+

This commit is contained in:
LukeFZ
2023-11-30 13:31:37 +01:00
parent a4528e5f55
commit ef1a5d1e83
4 changed files with 723 additions and 632 deletions

View File

@@ -218,10 +218,12 @@ namespace Il2CppInspector
public uint attrs => (uint) bits & 0xffff; /* param attributes or field flags */
public Il2CppTypeEnum type => (Il2CppTypeEnum)((bits >> 16) & 0xff);
// TODO: Unity 2021.1 (v27.2): num_mods becomes 1 bit shorter, shifting byref and pinned right 1 bit, valuetype bit added
public uint num_mods => (uint) (bits >> 24) & 0x3f; /* max 64 modifiers follow at the end */
public bool byref => ((bits >> 30) & 1) == 1;
public bool pinned => (bits >> 31) == 1; /* valid when included in a local var signature */
// Unity 2021.1 (v27.2): num_mods becomes 1 bit shorter, shifting byref and pinned left 1 bit, valuetype bit added
public uint NumMods(double version) => (uint) (bits >> 24) & (version >= 27.2 ? 0x1fu : 0x3fu);
public bool ByRef(double version) => (bits >> (version >= 27.2 ? 29 : 30) & 1) == 1;
public bool Pinned(double version) => (bits >> (version >= 27.2 ? 30 : 31) & 1) == 1;
public bool ValueType(double version) => version >= 27.2 && ((bits >> 31) & 1) == 1; // Was only added in 27.2
/*public class Union
{