{"type": "func", "start": 5370898176, "end": 5370898634, "name": "GJBaseGameLayer::hasUniqueCoin", "pseudocode": "// \n// GJBaseGameLayer::hasUniqueCoin from 0x140216700 to 0x1402168ca (458 bytes)\n// \n// 5 xrefs:\n// > EnhancedGameObject::updateUserCoin @ 0x1401a695e\n// > GameObject::playDestroyObjectAnim @ 0x1401ab34a\n// > GJBaseGameLayer::collisionCheckObjects @ 0x140215c39\n// > GJBaseGameLayer::collisionCheckObjects @ 0x140215cef\n// > <???> @ 0x1406cd134\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\n// Hidden C++ exception states: #wind=3\nbool GJBaseGameLayer::hasUniqueCoin(GJBaseGameLayer *a1, EffectGameObject *a2)\n{\n  GJGameLevel *m_level; // rcx\n  int m_secretCoinID; // eax\n  const char *CoinKey; // rdi\n  GameStatsManager *v8; // rcx\n  GameStatsManager *v9; // rcx\n  void *v10; // [rsp+30h] [rbp+8h]\n  void *v11; // [rsp+30h] [rbp+8h]\n  void *v12; // [rsp+30h] [rbp+8h]\n\n  m_level = a1->m_level;\n  if ( m_level->m_levelType == Editor )\n  {\n    if ( a2->getType(a2) == (Collectible|0x1) )\n    {\n      m_secretCoinID = a2->m_secretCoinID;\n      switch ( m_secretCoinID )\n      {\n        case 1:\n          return a1->m_level->m_firstCoinVerified.random - a1->m_level->m_firstCoinVerified.seed == 1;\n        case 2:\n          return a1->m_level->m_secondCoinVerified.random - a1->m_level->m_secondCoinVerified.seed == 1;\n        case 3:\n          return a1->m_level->m_thirdCoinVerified.random - a1->m_level->m_thirdCoinVerified.seed == 1;\n      }\n    }\n    return 0;\n  }\n  CoinKey = GJGameLevel::getCoinKey(m_level, a2->m_secretCoinID);\n  v8 = (GameStatsManager *)qword_1406C2EE8;\n  if ( a1->m_level->m_levelType == Main )\n  {\n    if ( !qword_1406C2EE8 )\n    {\n      v10 = operator new(0x3E0u);\n      qword_1406C2EE8 = sub_1401D0AE0((__int64)v10);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);\n      v8 = (GameStatsManager *)qword_1406C2EE8;\n    }\n    return GameStatsManager::hasSecretCoin(v8, CoinKey);\n  }\n  else\n  {\n    if ( !qword_1406C2EE8 )\n    {\n      v11 = operator new(0x3E0u);\n      qword_1406C2EE8 = sub_1401D0AE0((__int64)v11);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);\n      v8 = (GameStatsManager *)qword_1406C2EE8;\n    }\n    if ( !GameStatsManager::hasUserCoin(v8, CoinKey) )\n    {\n      v9 = (GameStatsManager *)qword_1406C2EE8;\n      if ( !qword_1406C2EE8 )\n      {\n        v12 = operator new(0x3E0u);\n        qword_1406C2EE8 = sub_1401D0AE0((__int64)v12);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);\n        v9 = (GameStatsManager *)qword_1406C2EE8;\n      }\n      if ( !GameStatsManager::hasPendingUserCoin(v9, CoinKey) )\n        return 0;\n    }\n    return 1;\n  }\n}", "assembly": "; \n; GJBaseGameLayer::hasUniqueCoin from 0x140216700 to 0x1402168ca (458 bytes)\n; \n; 5 xrefs:\n; > EnhancedGameObject::updateUserCoin @ 0x1401a695e\n; > GameObject::playDestroyObjectAnim @ 0x1401ab34a\n; > GJBaseGameLayer::collisionCheckObjects @ 0x140215c39\n; > GJBaseGameLayer::collisionCheckObjects @ 0x140215cef\n; > <???> @ 0x1406cd134\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x140216700\npush    rdi                                                            ; +0x5, 0x140216705\nsub     rsp, 20h                                                       ; +0x6, 0x140216706\nmov     rdi, rdx                                                       ; +0xa, 0x14021670a\nmov     rbx, rcx                                                       ; +0xd, 0x14021670d\nmov     rcx, [rcx+878h]                                                ; +0x10, 0x140216710\ncmp     dword ptr [rcx+454h], 2                                        ; +0x17, 0x140216717\njnz     loc_1402167BE                                                  ; +0x1e, 0x14021671e\nmov     rax, [rdx]                                                     ; +0x24, 0x140216724\nmov     rcx, rdx                                                       ; +0x27, 0x140216727\ncall    qword ptr [rax+660h]                                           ; +0x2a, 0x14021672a\ncmp     eax, 1Fh                                                       ; +0x30, 0x140216730\njnz     loc_1402168B0                                                  ; +0x33, 0x140216733\nmov     eax, [rdi+710h]                                                ; +0x39, 0x140216739\ncmp     eax, 1                                                         ; +0x3f, 0x14021673f\njnz     short loc_140216768                                            ; +0x42, 0x140216742\nmov     rax, [rbx+878h]                                                ; +0x44, 0x140216744\nmov     ecx, [rax+3C4h]                                                ; +0x4b, 0x14021674b\nsub     ecx, [rax+3C8h]                                                ; +0x51, 0x140216751\ncmp     ecx, 1                                                         ; +0x57, 0x140216757\nsetz    al                                                             ; +0x5a, 0x14021675a\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x5d, 0x14021675d\nadd     rsp, 20h                                                       ; +0x62, 0x140216762\npop     rdi                                                            ; +0x66, 0x140216766\nretn                                                                   ; +0x67, 0x140216767\ncmp     eax, 2                                                         ; +0x68, 0x140216768\njnz     short loc_140216791                                            ; +0x6b, 0x14021676b\nmov     rax, [rbx+878h]                                                ; +0x6d, 0x14021676d\nmov     ecx, [rax+3D0h]                                                ; +0x74, 0x140216774\nsub     ecx, [rax+3D4h]                                                ; +0x7a, 0x14021677a\ncmp     ecx, 1                                                         ; +0x80, 0x140216780\nsetz    al                                                             ; +0x83, 0x140216783\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x86, 0x140216786\nadd     rsp, 20h                                                       ; +0x8b, 0x14021678b\npop     rdi                                                            ; +0x8f, 0x14021678f\nretn                                                                   ; +0x90, 0x140216790\ncmp     eax, 3                                                         ; +0x91, 0x140216791\njnz     loc_1402168B0                                                  ; +0x94, 0x140216794\nmov     rax, [rbx+878h]                                                ; +0x9a, 0x14021679a\nmov     ecx, [rax+3DCh]                                                ; +0xa1, 0x1402167a1\nsub     ecx, [rax+3E0h]                                                ; +0xa7, 0x1402167a7\ncmp     ecx, 1                                                         ; +0xad, 0x1402167ad\nsetz    al                                                             ; +0xb0, 0x1402167b0\nmov     rbx, [rsp+28h+arg_8]                                           ; +0xb3, 0x1402167b3\nadd     rsp, 20h                                                       ; +0xb8, 0x1402167b8\npop     rdi                                                            ; +0xbc, 0x1402167bc\nretn                                                                   ; +0xbd, 0x1402167bd\nmov     edx, [rdx+710h]                                                ; +0xbe, 0x1402167be\ncall    GJGameLevel__getCoinKey                                        ; +0xc4, 0x1402167c4\nmov     rdi, rax                                                       ; +0xc9, 0x1402167c9\nmov     rcx, [rbx+878h]                                                ; +0xcc, 0x1402167cc\ncmp     dword ptr [rcx+454h], 1                                        ; +0xd3, 0x1402167d3\nmov     rcx, cs:qword_1406C2EE8                                        ; +0xda, 0x1402167da\njnz     short loc_140216829                                            ; +0xe1, 0x1402167e1\ntest    rcx, rcx                                                       ; +0xe3, 0x1402167e3\njnz     short loc_140216817                                            ; +0xe6, 0x1402167e6\nmov     ecx, 3E0h; Size                                                ; +0xe8, 0x1402167e8\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xed, 0x1402167ed\nmov     [rsp+28h+arg_0], rax                                           ; +0xf2, 0x1402167f2\nmov     rcx, rax                                                       ; +0xf7, 0x1402167f7\ncall    sub_1401D0AE0                                                  ; +0xfa, 0x1402167fa\nnop                                                                    ; +0xff, 0x1402167ff\nmov     cs:qword_1406C2EE8, rax                                        ; +0x100, 0x140216800\nmov     rdx, [rax]                                                     ; +0x107, 0x140216807\nmov     rcx, rax                                                       ; +0x10a, 0x14021680a\ncall    qword ptr [rdx+48h]                                            ; +0x10d, 0x14021680d\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x110, 0x140216810\nmov     rdx, rdi                                                       ; +0x117, 0x140216817\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x11a, 0x14021681a\nadd     rsp, 20h                                                       ; +0x11f, 0x14021681f\npop     rdi                                                            ; +0x123, 0x140216823\njmp     GameStatsManager__hasSecretCoin                                ; +0x124, 0x140216824\ntest    rcx, rcx                                                       ; +0x129, 0x140216829\njnz     short loc_14021685D                                            ; +0x12c, 0x14021682c\nmov     ecx, 3E0h; Size                                                ; +0x12e, 0x14021682e\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x133, 0x140216833\nmov     [rsp+28h+arg_0], rax                                           ; +0x138, 0x140216838\nmov     rcx, rax                                                       ; +0x13d, 0x14021683d\ncall    sub_1401D0AE0                                                  ; +0x140, 0x140216840\nnop                                                                    ; +0x145, 0x140216845\nmov     cs:qword_1406C2EE8, rax                                        ; +0x146, 0x140216846\nmov     rdx, [rax]                                                     ; +0x14d, 0x14021684d\nmov     rcx, rax                                                       ; +0x150, 0x140216850\ncall    qword ptr [rdx+48h]                                            ; +0x153, 0x140216853\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x156, 0x140216856\nmov     rdx, rdi                                                       ; +0x15d, 0x14021685d\ncall    GameStatsManager__hasUserCoin                                  ; +0x160, 0x140216860\ntest    al, al                                                         ; +0x165, 0x140216865\njnz     short loc_1402168BD                                            ; +0x167, 0x140216867\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x169, 0x140216869\ntest    rcx, rcx                                                       ; +0x170, 0x140216870\njnz     short loc_1402168A4                                            ; +0x173, 0x140216873\nmov     ecx, 3E0h; Size                                                ; +0x175, 0x140216875\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x17a, 0x14021687a\nmov     [rsp+28h+arg_0], rax                                           ; +0x17f, 0x14021687f\nmov     rcx, rax                                                       ; +0x184, 0x140216884\ncall    sub_1401D0AE0                                                  ; +0x187, 0x140216887\nnop                                                                    ; +0x18c, 0x14021688c\nmov     cs:qword_1406C2EE8, rax                                        ; +0x18d, 0x14021688d\nmov     rdx, [rax]                                                     ; +0x194, 0x140216894\nmov     rcx, rax                                                       ; +0x197, 0x140216897\ncall    qword ptr [rdx+48h]                                            ; +0x19a, 0x14021689a\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x19d, 0x14021689d\nmov     rdx, rdi                                                       ; +0x1a4, 0x1402168a4\ncall    GameStatsManager__hasPendingUserCoin                           ; +0x1a7, 0x1402168a7\ntest    al, al                                                         ; +0x1ac, 0x1402168ac\njnz     short loc_1402168BD                                            ; +0x1ae, 0x1402168ae\nxor     al, al                                                         ; +0x1b0, 0x1402168b0\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x1b2, 0x1402168b2\nadd     rsp, 20h                                                       ; +0x1b7, 0x1402168b7\npop     rdi                                                            ; +0x1bb, 0x1402168bb\nretn                                                                   ; +0x1bc, 0x1402168bc\nmov     al, 1                                                          ; +0x1bd, 0x1402168bd\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x1bf, 0x1402168bf\nadd     rsp, 20h                                                       ; +0x1c4, 0x1402168c4\npop     rdi                                                            ; +0x1c8, 0x1402168c8\nretn                                                                   ; +0x1c9, 0x1402168c9", "xrefs": ["EnhancedGameObject::updateUserCoin @ 0x1401a695e", "GameObject::playDestroyObjectAnim @ 0x1401ab34a", "GJBaseGameLayer::collisionCheckObjects @ 0x140215c39", "GJBaseGameLayer::collisionCheckObjects @ 0x140215cef", "<???> @ 0x1406cd134"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}