|
| 1 | +from .helper import * |
| 2 | + |
| 3 | + |
| 4 | +class Il2CppCodeRegistration(MetaDataClass): |
| 5 | + methodPointersCount: Union[long, Version(Max=24.1)] |
| 6 | + methodPointers: Union[ulong, Version(Max=24.1)] |
| 7 | + delegateWrappersFromNativeToManagedCount: Union[ulong, Version(Max=21)] |
| 8 | + delegateWrappersFromNativeToManaged: Union[ |
| 9 | + ulong, Version(Max=21) |
| 10 | + ] # note the double indirection to handle different calling conventions |
| 11 | + reversePInvokeWrapperCount: Union[long, Version(Min=22)] |
| 12 | + reversePInvokeWrappers: Union[ulong, Version(Min=22)] |
| 13 | + delegateWrappersFromManagedToNativeCount: Union[ulong, Version(Max=22)] |
| 14 | + delegateWrappersFromManagedToNative: Union[ulong, Version(Max=22)] |
| 15 | + marshalingFunctionsCount: Union[ulong, Version(Max=22)] |
| 16 | + marshalingFunctions: Union[ulong, Version(Max=22)] |
| 17 | + ccwMarshalingFunctionsCount: Union[ulong, Version(Min=21, Max=22)] |
| 18 | + ccwMarshalingFunctions: Union[ulong, Version(Min=21, Max=22)] |
| 19 | + genericMethodPointersCount: long |
| 20 | + genericMethodPointers: ulong |
| 21 | + genericAdjustorThunks: Union[ulong, Version(Min=24.4, Max=24.4), Version(Min=27.1)] |
| 22 | + invokerPointersCount: long |
| 23 | + invokerPointers: ulong |
| 24 | + customAttributeCount: Union[long, Version(Max=24.4)] |
| 25 | + customAttributeGenerators: Union[ulong, Version(Max=24.4)] |
| 26 | + guidCount: Union[long, Version(Min=21, Max=22)] |
| 27 | + guids: Union[ulong, Version(Min=21, Max=22)] # Il2CppGuid |
| 28 | + unresolvedVirtualCallCount: Union[long, Version(Min=22)] |
| 29 | + unresolvedVirtualCallPointers: Union[ulong, Version(Min=22)] |
| 30 | + interopDataCount: Union[ulong, Version(Min=23)] |
| 31 | + interopData: Union[ulong, Version(Min=23)] |
| 32 | + windowsRuntimeFactoryCount: Union[ulong, Version(Min=24.3)] |
| 33 | + windowsRuntimeFactoryTable: Union[ulong, Version(Min=24.3)] |
| 34 | + codeGenModulesCount: Union[long, Version(Min=24.2)] |
| 35 | + codeGenModules: Union[ulong, Version(Min=24.2)] |
| 36 | + |
| 37 | + |
| 38 | +class Il2CppMetadataRegistration(MetaDataClass): |
| 39 | + genericClassesCount: long |
| 40 | + genericClasses: ulong |
| 41 | + genericInstsCount: long |
| 42 | + genericInsts: ulong |
| 43 | + genericMethodTableCount: long |
| 44 | + genericMethodTable: ulong |
| 45 | + typesCount: long |
| 46 | + types: ulong |
| 47 | + methodSpecsCount: long |
| 48 | + methodSpecs: ulong |
| 49 | + methodReferencesCount: Union[long, Version(Max=16)] |
| 50 | + methodReferences: Union[ulong, Version(Max=16)] |
| 51 | + |
| 52 | + fieldOffsetsCount: long |
| 53 | + fieldOffsets: ulong |
| 54 | + |
| 55 | + typeDefinitionsSizesCount: long |
| 56 | + typeDefinitionsSizes: ulong |
| 57 | + metadataUsagesCount: Union[ulong, Version(Min=19)] |
| 58 | + metadataUsages: Union[ulong, Version(Min=19)] |
| 59 | + |
| 60 | + |
| 61 | +class Il2CppTypeEnum(uint, Enum): |
| 62 | + IL2CPP_TYPE_END = 0x00 # End of List |
| 63 | + IL2CPP_TYPE_VOID = 0x01 |
| 64 | + IL2CPP_TYPE_BOOLEAN = 0x02 |
| 65 | + IL2CPP_TYPE_CHAR = 0x03 |
| 66 | + IL2CPP_TYPE_I1 = 0x04 |
| 67 | + IL2CPP_TYPE_U1 = 0x05 |
| 68 | + IL2CPP_TYPE_I2 = 0x06 |
| 69 | + IL2CPP_TYPE_U2 = 0x07 |
| 70 | + IL2CPP_TYPE_I4 = 0x08 |
| 71 | + IL2CPP_TYPE_U4 = 0x09 |
| 72 | + IL2CPP_TYPE_I8 = 0x0A |
| 73 | + IL2CPP_TYPE_U8 = 0x0B |
| 74 | + IL2CPP_TYPE_R4 = 0x0C |
| 75 | + IL2CPP_TYPE_R8 = 0x0D |
| 76 | + IL2CPP_TYPE_STRING = 0x0E |
| 77 | + IL2CPP_TYPE_PTR = 0x0F # arg: <type> token |
| 78 | + IL2CPP_TYPE_BYREF = 0x10 # arg: <type> token |
| 79 | + IL2CPP_TYPE_VALUETYPE = 0x11 # arg: <type> token |
| 80 | + IL2CPP_TYPE_CLASS = 0x12 # arg: <type> token |
| 81 | + IL2CPP_TYPE_VAR = 0x13 # Generic parameter in a generic type definition, represented as number (compressed unsigned integer) number |
| 82 | + IL2CPP_TYPE_ARRAY = 0x14 # type, rank, boundsCount, bound1, loCount, lo1 |
| 83 | + IL2CPP_TYPE_GENERICINST = 0x15 # <type> <type-arg-count> <type-1> \x{2026} <type-n> |
| 84 | + IL2CPP_TYPE_TYPEDBYREF = 0x16 |
| 85 | + IL2CPP_TYPE_I = 0x18 |
| 86 | + IL2CPP_TYPE_U = 0x19 |
| 87 | + IL2CPP_TYPE_FNPTR = 0x1B # arg: full method signature |
| 88 | + IL2CPP_TYPE_OBJECT = 0x1C |
| 89 | + IL2CPP_TYPE_SZARRAY = 0x1D # 0-based one-dim-array |
| 90 | + IL2CPP_TYPE_MVAR = 0x1E # Generic parameter in a generic method definition, represented as number (compressed unsigned integer) |
| 91 | + IL2CPP_TYPE_CMOD_REQD = 0x1F # arg: typedef or typeref token |
| 92 | + IL2CPP_TYPE_CMOD_OPT = 0x20 # optional arg: typedef or typref token |
| 93 | + IL2CPP_TYPE_INTERNAL = 0x21 # CLR internal type |
| 94 | + |
| 95 | + IL2CPP_TYPE_MODIFIER = 0x40 # Or with the following types |
| 96 | + IL2CPP_TYPE_SENTINEL = 0x41 # Sentinel for varargs method signature |
| 97 | + IL2CPP_TYPE_PINNED = 0x45 # Local var that points to pinned object |
| 98 | + |
| 99 | + IL2CPP_TYPE_ENUM = 0x55 # an enumeration |
| 100 | + |
| 101 | + |
| 102 | +# class Il2CppType(MetaDataClass): |
| 103 | +# datapoint: ulong |
| 104 | +# bits: uint |
| 105 | +# data { get: Union set; } |
| 106 | +# attrs { get: uint set; } |
| 107 | +# type { get: Il2CppTypeEnum set; } |
| 108 | +# num_mods { get: uint set; } |
| 109 | +# byref { get: uint set; } |
| 110 | +# pinned { get: uint set; } |
| 111 | + |
| 112 | +# public void Init() |
| 113 | +# { |
| 114 | +# attrs = bits & 0xffff; |
| 115 | +# type = (Il2CppTypeEnum)((bits >> 16) & 0xff); |
| 116 | +# num_mods = (bits >> 24) & 0x3f; |
| 117 | +# byref = (bits >> 30) & 1; |
| 118 | +# pinned = bits >> 31; |
| 119 | +# data = new Union { dummy = datapoint }; |
| 120 | +# } |
| 121 | + |
| 122 | +# public class Union |
| 123 | +# { |
| 124 | +# dummy: ulong |
| 125 | +# #/ <summary> |
| 126 | +# #/ for VALUETYPE and CLASS |
| 127 | +# #/ </summary> |
| 128 | +# klassIndex => (long)dummy: long |
| 129 | +# #/ <summary> |
| 130 | +# #/ for VALUETYPE and CLASS at runtime |
| 131 | +# #/ </summary> |
| 132 | +# typeHandle => dummy: ulong |
| 133 | +# #/ <summary> |
| 134 | +# #/ for PTR and SZARRAY |
| 135 | +# #/ </summary> |
| 136 | +# type => dummy: ulong |
| 137 | +# #/ <summary> |
| 138 | +# #/ for ARRAY |
| 139 | +# #/ </summary> |
| 140 | +# array => dummy: ulong |
| 141 | +# #/ <summary> |
| 142 | +# #/ for VAR and MVAR |
| 143 | +# #/ </summary> |
| 144 | +# genericParameterIndex => (long)dummy: long |
| 145 | +# #/ <summary> |
| 146 | +# #/ for VAR and MVAR at runtime |
| 147 | +# #/ </summary> |
| 148 | +# genericParameterHandle => dummy: ulong |
| 149 | +# #/ <summary> |
| 150 | +# #/ for GENERICINST |
| 151 | +# #/ </summary> |
| 152 | +# generic_class => dummy: ulong |
| 153 | +# } |
| 154 | +# } |
| 155 | + |
| 156 | + |
| 157 | +class Il2CppGenericContext(MetaDataClass): |
| 158 | + # The instantiation corresponding to the class generic parameters |
| 159 | + class_inst: ulong |
| 160 | + # The instantiation corresponding to the method generic parameters |
| 161 | + method_inst: ulong |
| 162 | + |
| 163 | + |
| 164 | +class Il2CppGenericClass(MetaDataClass): |
| 165 | + typeDefinitionIndex: Union[long, Version(Max=24.4)] # the generic type definition |
| 166 | + type: Union[ulong, Version(Min=27)] # the generic type definition |
| 167 | + context: Il2CppGenericContext # a context that contains the type instantiation doesn't contain any method instantiation |
| 168 | + cached_class: ulong # if present, the Il2CppClass corresponding to the instantiation. |
| 169 | + |
| 170 | + |
| 171 | +class Il2CppGenericInst(MetaDataClass): |
| 172 | + type_argc: long |
| 173 | + type_argv: ulong |
| 174 | + |
| 175 | + |
| 176 | +class Il2CppArrayType(MetaDataClass): |
| 177 | + etype: ulong |
| 178 | + rank: byte |
| 179 | + numsizes: byte |
| 180 | + numlobounds: byte |
| 181 | + sizes: ulong |
| 182 | + lobounds: ulong |
| 183 | + |
| 184 | + |
| 185 | +class Il2CppGenericMethodIndices(MetaDataClass): |
| 186 | + methodIndex: int |
| 187 | + invokerIndex: int |
| 188 | + adjustorThunk: Union[int, Version(Min=24.4, Max=24.4), Version(Min=27.1)] |
| 189 | + |
| 190 | + |
| 191 | +class Il2CppGenericMethodFunctionsDefinitions(MetaDataClass): |
| 192 | + genericMethodIndex: int |
| 193 | + indices: Il2CppGenericMethodIndices |
| 194 | + |
| 195 | + |
| 196 | +class Il2CppMethodSpec(MetaDataClass): |
| 197 | + methodDefinitionIndex: int |
| 198 | + classIndexIndex: int |
| 199 | + methodIndexIndex: int |
| 200 | + |
| 201 | + |
| 202 | +class Il2CppCodeGenModule(MetaDataClass): |
| 203 | + moduleName: ulong |
| 204 | + methodPointerCount: long |
| 205 | + methodPointers: ulong |
| 206 | + adjustorThunkCount: Union[long, Version(Min=24.4, Max=24.4), Version(Min=27.1)] |
| 207 | + adjustorThunks: Union[ulong, Version(Min=24.4, Max=24.4), Version(Min=27.1)] |
| 208 | + invokerIndices: ulong |
| 209 | + reversePInvokeWrapperCount: ulong |
| 210 | + reversePInvokeWrapperIndices: ulong |
| 211 | + rgctxRangesCount: long |
| 212 | + rgctxRanges: ulong |
| 213 | + rgctxsCount: long |
| 214 | + rgctxs: ulong |
| 215 | + debuggerMetadata: ulong |
| 216 | + customAttributeCacheGenerator: Union[ulong, Version(Min=27)] |
| 217 | + moduleInitializer: Union[ulong, Version(Min=27)] |
| 218 | + staticConstructorTypeIndices: Union[ulong, Version(Min=27)] |
| 219 | + metadataRegistration: Union[ulong, Version(Min=27)] # Per-assembly mode only |
| 220 | + codeRegistaration: Union[ulong, Version(Min=27)] # Per-assembly mode only |
| 221 | + |
| 222 | + |
| 223 | +class Il2CppRange(MetaDataClass): |
| 224 | + start: int |
| 225 | + length: int |
| 226 | + |
| 227 | + |
| 228 | +class Il2CppTokenRangePair(MetaDataClass): |
| 229 | + token: uint |
| 230 | + range: Il2CppRange |
0 commit comments