File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Il2CppInspector.Common/IL2CPP Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -282,13 +282,18 @@ ulong FindCodeRegistration()
282282 // but I know of at least one binary where this will break detection.
283283 // Testing showed that we can just use the same heuristic used for v27+
284284 // on older versions as well, so we'll just use it for all cases.
285+
286+ // On some 32-bit (arm) binaries, just checking fields with the type count is not sufficient
287+ // for uniquely identifying the metareg. We assume that all binaries have at least one generic class + inst
288+ // and use this for an additional heuristic, though this is kinda jank and might not be enough for all binaries
285289 if ( Image . Version >= MetadataVersions . V190 )
286290 {
287291 foreach ( var va in vas )
288292 {
289293 var mr = Image . ReadMappedVersionedObject < Il2CppMetadataRegistration > ( va ) ;
290294 if ( mr . TypeDefinitionsSizesCount == metadata . Types . Length
291- && mr . FieldOffsetsCount == metadata . Types . Length )
295+ && mr . FieldOffsetsCount == metadata . Types . Length
296+ && mr is { GenericInstsCount : > 0 , GenericClassesCount : > 0 } )
292297 {
293298 metadataRegistration = va ;
294299 break ;
You can’t perform that action at this time.
0 commit comments