Skip to content

Instantly share code, notes, and snippets.

@madordie
Created November 27, 2023 03:39
Show Gist options
  • Save madordie/55645e0c4c84105b36f1575bf8fe3ded to your computer and use it in GitHub Desktop.
Save madordie/55645e0c4c84105b36f1575bf8fe3ded to your computer and use it in GitHub Desktop.
[iOS17.0][ARM64] __int64 __fastcall _AssertAutoLayoutOnAllowedThreadsOnly(__int64 a1, const char *a2)
__int64 __fastcall _AssertAutoLayoutOnAllowedThreadsOnly(__int64 a1, const char *a2)
{
__int64 v2; // x19
__int64 result; // x0
const char *v4; // x1
__CFString *v5; // x20
__int64 v6; // x21
void *v7; // x0
__int64 v8; // x0
__int64 v9; // x0
const char *v10; // x1
void *v11; // x0
const char *v12; // x1
void *v13; // x0
const char *v14; // x1
const char *v15; // x1
void *v16; // x0
const char *v17; // x1
void *v18; // x0
const char *v19; // x1
const char *v20; // x1
__CFString *v21; // x3
void *v22; // x0
__int64 v23; // x0
v2 = a1;
result = (__int64)objc_msgSend_isMainThread(off_50138, a2);
if ( result & 1 )
{
*(_BYTE *)(v2 + 161) = 1;
return result;
}
v5 = &stru_46990;
if ( *(_BYTE *)(v2 + 161) )
goto LABEL_11;
v6 = *(_QWORD *)(v2 + 128);
if ( !v6 )
{
v7 = objc_msgSend_currentThread(off_50138, v4);
v8 = objc_retain(v7);
*(_QWORD *)(v2 + 128) = v8;
if ( *(_BYTE *)(v2 + 161) )
{
v5 = &stru_46990;
goto LABEL_11;
}
v6 = v8;
}
result = (__int64)objc_msgSend_currentThread(off_50138, v4);
if ( v6 == result )
return result;
if ( !*(_BYTE *)(v2 + 161) )
v5 = &stru_469B0;
LABEL_11:
objc_msgSend_callStackSymbols(off_50138, v4);
v9 = NSLog(v5);
result = _NSConstraintBasedLayoutAllowBGThreads(v9);
if ( !(result & 1) )
{
v11 = objc_msgSend_currentThread(off_50138, v10);
v13 = objc_msgSend_name(v11, v12);
result = (__int64)objc_msgSend_isEqualToString_(v13, v14, &stru_469D0);
if ( !(result & 1) )
{
v16 = objc_msgSend_mainBundle(off_50140, v15);
v18 = objc_msgSend_bundleIdentifier(v16, v17);
result = (__int64)objc_msgSend_isEqualToString_(v18, v19, &stru_469F0);
if ( !(result & 1) )
{
if ( *(_BYTE *)(v2 + 161) )
v21 = &stru_46A10;
else
v21 = &stru_46A30;
v22 = objc_msgSend_exceptionWithName_reason_userInfo_(
off_50038,
v20,
*(_QWORD *)NSInternalInconsistencyException_ptr,
v21,
0LL);
v23 = objc_exception_throw(v22);
result = -[NSISEngine tryToOptimizeReturningMutuallyExclusiveConstraints](v23);
}
}
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment