{"type": "func", "start": 4296971608, "end": 4296971860, "name": "GJBaseGameLayer::hasUniqueCoin", "pseudocode": "// \n// GJBaseGameLayer::hasUniqueCoin from 0x1001e9558 to 0x1001e9654 (252 bytes)\n// \n// 4 xrefs:\n// > GJBaseGameLayer::collisionCheckObjects @ 0x1001e835c\n// > GJBaseGameLayer::collisionCheckObjects @ 0x1001e84f8\n// > EnhancedGameObject::updateUserCoin @ 0x10025f52c\n// > GameObject::playDestroyObjectAnim @ 0x100349c6c\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\nbool __fastcall GJBaseGameLayer::hasUniqueCoin(GJBaseGameLayer *a1, EffectGameObject *a2)\n{\n  GJGameLevel *m_level; // x0\n  int m_secretCoinID; // w8\n  GJGameLevel *v6; // x8\n  int random; // w9\n  int seed; // w8\n  const char *CoinKey; // x20\n  GJLevelType m_levelType; // w19\n  GameStatsManager *v11; // x0\n  GameStatsManager *v13; // x0\n  GJGameLevel *v14; // x8\n  GJGameLevel *v15; // x8\n\n  m_level = a1->m_level;\n  if ( m_level->m_levelType == Editor )\n  {\n    if ( ((unsigned int (__fastcall *)(EffectGameObject *))a2->getType)(a2) == 31 )\n    {\n      m_secretCoinID = a2->m_secretCoinID;\n      switch ( m_secretCoinID )\n      {\n        case 3:\n          v15 = a1->m_level;\n          random = v15->m_thirdCoinVerified.random;\n          seed = v15->m_thirdCoinVerified.seed;\n          return random - seed == 1;\n        case 2:\n          v14 = a1->m_level;\n          random = v14->m_secondCoinVerified.random;\n          seed = v14->m_secondCoinVerified.seed;\n          return random - seed == 1;\n        case 1:\n          v6 = a1->m_level;\n          random = v6->m_firstCoinVerified.random;\n          seed = v6->m_firstCoinVerified.seed;\n          return random - seed == 1;\n      }\n    }\n    return 0;\n  }\n  CoinKey = GJGameLevel::getCoinKey(m_level, a2->m_secretCoinID);\n  m_levelType = a1->m_level->m_levelType;\n  v11 = GameStatsManager::sharedState();\n  if ( m_levelType == Main )\n    return GameStatsManager::hasSecretCoin(v11, CoinKey);\n  if ( GameStatsManager::hasUserCoin(v11, CoinKey) )\n    return 1;\n  v13 = GameStatsManager::sharedState();\n  return GameStatsManager::hasPendingUserCoin(v13, CoinKey);\n}", "assembly": "; \n; GJBaseGameLayer::hasUniqueCoin from 0x1001e9558 to 0x1001e9654 (252 bytes)\n; \n; 4 xrefs:\n; > GJBaseGameLayer::collisionCheckObjects @ 0x1001e835c\n; > GJBaseGameLayer::collisionCheckObjects @ 0x1001e84f8\n; > EnhancedGameObject::updateUserCoin @ 0x10025f52c\n; > GameObject::playDestroyObjectAnim @ 0x100349c6c\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\nSTP             X20, X19, [SP,#-0x10+var_10]!                          ; +0x0, 0x1001e9558\nSTP             X29, X30, [SP,#0x10+var_s0]                            ; +0x4, 0x1001e955c\nADD             X29, SP, #0x10                                         ; +0x8, 0x1001e9560\nMOV             X20, X1                                                ; +0xc, 0x1001e9564\nMOV             X19, X0                                                ; +0x10, 0x1001e9568\nLDR             X0, [X0,#0x790]                                        ; +0x14, 0x1001e956c\nLDR             W8, [X0,#0x404]                                        ; +0x18, 0x1001e9570\nCMP             W8, #2                                                 ; +0x1c, 0x1001e9574\nB.NE            loc_1001E95C0                                          ; +0x20, 0x1001e9578\nLDR             X8, [X20]                                              ; +0x24, 0x1001e957c\nLDR             X8, [X8,#0x6F8]                                        ; +0x28, 0x1001e9580\nMOV             X0, X20                                                ; +0x2c, 0x1001e9584\nBLR             X8                                                     ; +0x30, 0x1001e9588\nCMP             W0, #0x1F                                              ; +0x34, 0x1001e958c\nB.NE            loc_1001E95F0                                          ; +0x38, 0x1001e9590\nLDR             W8, [X20,#0x700]                                       ; +0x3c, 0x1001e9594\nCMP             W8, #3                                                 ; +0x40, 0x1001e9598\nB.EQ            loc_1001E9630                                          ; +0x44, 0x1001e959c\nCMP             W8, #2                                                 ; +0x48, 0x1001e95a0\nB.EQ            loc_1001E9620                                          ; +0x4c, 0x1001e95a4\nCMP             W8, #1                                                 ; +0x50, 0x1001e95a8\nB.NE            loc_1001E95F0                                          ; +0x54, 0x1001e95ac\nLDR             X8, [X19,#0x790]                                       ; +0x58, 0x1001e95b0\nLDR             W9, [X8,#0x37C]                                        ; +0x5c, 0x1001e95b4\nLDR             W8, [X8,#0x380]                                        ; +0x60, 0x1001e95b8\nB               loc_1001E963C                                          ; +0x64, 0x1001e95bc\nLDR             W1, [X20,#0x700]                                       ; +0x68, 0x1001e95c0\nBL              GJGameLevel__getCoinKey                                ; +0x6c, 0x1001e95c4\nMOV             X20, X0                                                ; +0x70, 0x1001e95c8\nLDR             X8, [X19,#0x790]                                       ; +0x74, 0x1001e95cc\nLDR             W19, [X8,#0x404]                                       ; +0x78, 0x1001e95d0\nBL              GameStatsManager__sharedState                          ; +0x7c, 0x1001e95d4\nCMP             W19, #1                                                ; +0x80, 0x1001e95d8\nB.NE            loc_1001E95F8                                          ; +0x84, 0x1001e95dc\nMOV             X1, X20                                                ; +0x88, 0x1001e95e0\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x8c, 0x1001e95e4\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x90, 0x1001e95e8\nB               GameStatsManager__hasSecretCoin                        ; +0x94, 0x1001e95ec\nMOV             W0, #0                                                 ; +0x98, 0x1001e95f0\nB               loc_1001E9648                                          ; +0x9c, 0x1001e95f4\nMOV             X1, X20                                                ; +0xa0, 0x1001e95f8\nBL              GameStatsManager__hasUserCoin                          ; +0xa4, 0x1001e95fc\nTBZ             W0, #0, loc_1001E960C                                  ; +0xa8, 0x1001e9600\nMOV             W0, #1                                                 ; +0xac, 0x1001e9604\nB               loc_1001E9648                                          ; +0xb0, 0x1001e9608\nBL              GameStatsManager__sharedState                          ; +0xb4, 0x1001e960c\nMOV             X1, X20                                                ; +0xb8, 0x1001e9610\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0xbc, 0x1001e9614\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0xc0, 0x1001e9618\nB               GameStatsManager__hasPendingUserCoin                   ; +0xc4, 0x1001e961c\nLDR             X8, [X19,#0x790]                                       ; +0xc8, 0x1001e9620\nLDR             W9, [X8,#0x388]                                        ; +0xcc, 0x1001e9624\nLDR             W8, [X8,#0x38C]                                        ; +0xd0, 0x1001e9628\nB               loc_1001E963C                                          ; +0xd4, 0x1001e962c\nLDR             X8, [X19,#0x790]                                       ; +0xd8, 0x1001e9630\nLDR             W9, [X8,#0x394]                                        ; +0xdc, 0x1001e9634\nLDR             W8, [X8,#0x398]                                        ; +0xe0, 0x1001e9638\nSUB             W8, W9, W8                                             ; +0xe4, 0x1001e963c\nCMP             W8, #1                                                 ; +0xe8, 0x1001e9640\nCSET            W0, EQ                                                 ; +0xec, 0x1001e9644\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0xf0, 0x1001e9648\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0xf4, 0x1001e964c\nRET                                                                    ; +0xf8, 0x1001e9650", "xrefs": ["GJBaseGameLayer::collisionCheckObjects @ 0x1001e835c", "GJBaseGameLayer::collisionCheckObjects @ 0x1001e84f8", "EnhancedGameObject::updateUserCoin @ 0x10025f52c", "GameObject::playDestroyObjectAnim @ 0x100349c6c"], "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"}