// // GameLevelOptionsLayer::didToggle from 0x10029fc40 to 0x1002a0087 (1095 bytes) // // 1 xrefs: // > @ 0x100b04258 // // This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True! // // Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings // Generated at Fri, 27 Nov 2026 12:27:54 +0000 // unsigned __int64 __fastcall GameLevelOptionsLayer::didToggle(_QWORD *a1, int a2) { unsigned __int64 result; // rax int v3; // r8d int v4; // r15d unsigned __int64 v5; // rcx unsigned __int64 v6; // r9 unsigned __int64 v7; // rdx __int64 v8; // rbx __int64 v9; // rcx unsigned int v10; // eax __int64 v11; // rbx __int64 **v12; // rax __int64 *v13; // r9 __int64 v14; // rdx unsigned __int64 v15; // rsi unsigned __int64 v16; // rdx __int64 v17; // rsi __int64 *v18; // rdi unsigned __int64 v19; // rcx __int64 v20; // rdi _QWORD v21[2]; // [rsp+0h] [rbp-40h] BYREF void *__p; // [rsp+10h] [rbp-30h] result = (unsigned int)(a2 - 1); switch ( a2 ) { case 1: v9 = a1[141]; v10 = *(unsigned __int8 *)(v9 + 1472); if ( (v10 & 1) != 0 ) { if ( *(_QWORD *)(v9 + 1480) ) goto LABEL_10; } else if ( v10 >> 1 ) { LABEL_10: __p = operator new(0x60u); v21[0] = 97; v21[1] = 94; strcpy( (char *)__p, "Changing LDM will delete your saved checkpoint for this level."); v11 = FLAlertLayer::create_1(a1 + 140, "Low Detail Mode", v21, "Cancel", "OK", 380.0); if ( (v21[0] & 1) != 0 ) operator delete(__p); return (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 1312LL))(v11); } return sub_1002A00C0(); case 2: result = a1[141]; *(_BYTE *)(result + 770) ^= 1u; return result; case 3: case 4: result = a1[141]; v3 = *(_DWORD *)(result + 1436); v4 = a2 != 3 || v3 != 1; if ( a2 != 3 ) v4 = 2 * (v3 != 2); *(_DWORD *)(result + 1436) = v4; v5 = a1[136]; if ( !v5 ) return result; v6 = ((v5 - ((v5 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL) + (((v5 - ((v5 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL); v7 = (0x101010101010101LL * ((v6 + (v6 >> 4)) & 0xF0F0F0F0F0F0F0FLL)) >> 56; if ( v7 > 1 ) { v8 = 3; if ( v5 <= 3 ) v8 = 3u % (unsigned __int8)v5; } else { v8 = ((_BYTE)v5 - 1) & 3; } v12 = *(__int64 ***)(a1[135] + 8 * v8); if ( !v12 ) goto LABEL_40; v13 = *v12; if ( !*v12 ) goto LABEL_40; if ( (unsigned int)v7 >= 2 ) { while ( 1 ) { result = v13[1]; if ( result == 3 ) { if ( *((_DWORD *)v13 + 4) == 3 ) goto LABEL_37; } else { if ( result < v5 ) goto LABEL_26; if ( (v5 | result) >> 32 ) { result %= v5; LABEL_26: if ( result != v8 ) goto LABEL_39; goto LABEL_21; } result = (unsigned int)result % (unsigned int)v5; if ( result != v8 ) goto LABEL_39; } LABEL_21: v13 = (__int64 *)*v13; if ( !v13 ) goto LABEL_39; } } result = v5 - 1; while ( 1 ) { v14 = v13[1]; if ( v14 == 3 ) break; if ( (result & v14) != v8 ) goto LABEL_39; LABEL_31: v13 = (__int64 *)*v13; if ( !v13 ) goto LABEL_39; } if ( *((_DWORD *)v13 + 4) != 3 ) goto LABEL_31; LABEL_37: result = v13[3]; if ( result ) { result = CCMenuItemToggler::toggle(v13[3], (v3 != 1) & (unsigned __int8)(a2 == 3)); v5 = a1[136]; } LABEL_39: if ( v5 ) { LABEL_40: v15 = ((v5 - ((v5 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL) + (((v5 - ((v5 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL); v16 = (0x101010101010101LL * ((v15 + (v15 >> 4)) & 0xF0F0F0F0F0F0F0FLL)) >> 56; if ( v16 > 1 ) { v17 = 4; if ( v5 <= 4 ) v17 = 4u % (unsigned __int8)v5; } else { v17 = ((_BYTE)v5 - 1) & 4; } result = *(_QWORD *)(a1[135] + 8 * v17); if ( result ) { v18 = *(__int64 **)result; if ( *(_QWORD *)result ) { if ( (unsigned int)v16 < 2 ) { v19 = v5 - 1; while ( 1 ) { result = v18[1]; if ( result == 4 ) { if ( *((_DWORD *)v18 + 4) == 4 ) goto LABEL_63; } else { result &= v19; if ( result != v17 ) return result; } v18 = (__int64 *)*v18; if ( !v18 ) return result; } } do { result = v18[1]; if ( result == 4 ) { if ( *((_DWORD *)v18 + 4) == 4 ) { LABEL_63: v20 = v18[3]; if ( v20 ) return CCMenuItemToggler::toggle(v20, v4 == 2); return result; } } else { if ( result < v5 ) goto LABEL_54; if ( (v5 | result) >> 32 ) { result %= v5; LABEL_54: if ( result != v17 ) return result; goto LABEL_49; } result = (unsigned int)result % (unsigned int)v5; if ( result != v17 ) return result; } LABEL_49: v18 = (__int64 *)*v18; } while ( v18 ); } } } return result; case 5: result = a1[141]; *(_BYTE *)(result + 1528) ^= 1u; return result; default: return result; } }
GD Web Decomp Icon

GD Web Decomp

Raw Source