{"type": "func", "start": 4650178, "end": 4650342, "name": "GJBaseGameLayer::hasUniqueCoin", "pseudocode": "// \n// GJBaseGameLayer::hasUniqueCoin from 0x46f4c2 to 0x46f566 (164 bytes)\n// \n// 4 xrefs:\n// > EnhancedGameObject::updateUserCoin @ 0x36093a\n// > GJBaseGameLayer::collisionCheckObjects @ 0x492ada\n// > GJBaseGameLayer::collisionCheckObjects @ 0x492b34\n// > GameObject::playDestroyObjectAnim @ 0x52ad44\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 GJBaseGameLayer::hasUniqueCoin(GJBaseGameLayer *a1, EffectGameObject *a2)\n{\n  GJGameLevel *m_level; // r0\n  int m_secretCoinID; // r3\n  GJGameLevel *v6; // r2\n  int random; // r3\n  int seed; // r0\n  GJGameLevel *v9; // r2\n  GJGameLevel *v10; // r2\n  const char *CoinKey; // r5\n  GameStatsManager *v12; // r0\n  GameStatsManager *v13; // r0\n  GameStatsManager *v14; // r0\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          v6 = a1->m_level;\n          random = v6->m_firstCoinVerified.random;\n          seed = v6->m_firstCoinVerified.seed;\nLABEL_9:\n          LOBYTE(seed) = random - seed == 1;\n          return seed;\n        case 2:\n          v9 = a1->m_level;\n          random = v9->m_secondCoinVerified.random;\n          seed = v9->m_secondCoinVerified.seed;\n          goto LABEL_9;\n        case 3:\n          v10 = a1->m_level;\n          random = v10->m_thirdCoinVerified.random;\n          seed = v10->m_thirdCoinVerified.seed;\n          goto LABEL_9;\n      }\n    }\n    LOBYTE(seed) = 0;\n    return seed;\n  }\n  CoinKey = GJGameLevel::getCoinKey(m_level, a2->m_secretCoinID);\n  if ( a1->m_level->m_levelType == Main )\n  {\n    v12 = GameStatsManager::sharedState();\n    LOBYTE(seed) = GameStatsManager::hasSecretCoin(v12, CoinKey);\n  }\n  else\n  {\n    v13 = GameStatsManager::sharedState();\n    seed = GameStatsManager::hasUserCoin(v13, CoinKey);\n    if ( !seed )\n    {\n      v14 = GameStatsManager::sharedState();\n      LOBYTE(seed) = GameStatsManager::hasPendingUserCoin(v14, CoinKey);\n    }\n  }\n  return seed;\n}", "assembly": "; \n; GJBaseGameLayer::hasUniqueCoin from 0x46f4c2 to 0x46f566 (164 bytes)\n; \n; 4 xrefs:\n; > EnhancedGameObject::updateUserCoin @ 0x36093a\n; > GJBaseGameLayer::collisionCheckObjects @ 0x492ada\n; > GJBaseGameLayer::collisionCheckObjects @ 0x492b34\n; > GameObject::playDestroyObjectAnim @ 0x52ad44\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\nPUSH            {R3-R5,LR}                                             ; +0x0, 0x46f4c2\nMOV             R4, R0                                                 ; +0x2, 0x46f4c4\nLDR.W           R0, [R0,#0x608]; this                                  ; +0x4, 0x46f4c6\nMOV             R5, R1                                                 ; +0x8, 0x46f4ca\nLDR.W           R3, [R0,#0x2F8]                                        ; +0xa, 0x46f4cc\nCMP             R3, #2                                                 ; +0xe, 0x46f4d0\nBNE             loc_46F524                                             ; +0x10, 0x46f4d2\nLDR             R3, [R1]                                               ; +0x12, 0x46f4d4\nMOV             R0, R1                                                 ; +0x14, 0x46f4d6\nLDR.W           R3, [R3,#0x37C]                                        ; +0x16, 0x46f4d8\nBLX             R3                                                     ; +0x1a, 0x46f4dc\nCMP             R0, #0x1F                                              ; +0x1c, 0x46f4de\nBNE             loc_46F562                                             ; +0x1e, 0x46f4e0\nLDR.W           R3, [R5,#0x640]                                        ; +0x20, 0x46f4e2\nCMP             R3, #1                                                 ; +0x24, 0x46f4e6\nBNE             loc_46F4F8                                             ; +0x26, 0x46f4e8\nLDR.W           R2, [R4,#0x608]                                        ; +0x28, 0x46f4ea\nLDR.W           R3, [R2,#0x288]                                        ; +0x2c, 0x46f4ee\nLDR.W           R0, [R2,#0x28C]                                        ; +0x30, 0x46f4f2\nB               loc_46F51A                                             ; +0x34, 0x46f4f6\nCMP             R3, #2                                                 ; +0x36, 0x46f4f8\nBNE             loc_46F50A                                             ; +0x38, 0x46f4fa\nLDR.W           R2, [R4,#0x608]                                        ; +0x3a, 0x46f4fc\nLDR.W           R3, [R2,#0x294]                                        ; +0x3e, 0x46f500\nLDR.W           R0, [R2,#0x298]                                        ; +0x42, 0x46f504\nB               loc_46F51A                                             ; +0x46, 0x46f508\nCMP             R3, #3                                                 ; +0x48, 0x46f50a\nBNE             loc_46F562                                             ; +0x4a, 0x46f50c\nLDR.W           R2, [R4,#0x608]                                        ; +0x4c, 0x46f50e\nLDR.W           R3, [R2,#0x2A0]                                        ; +0x50, 0x46f512\nLDR.W           R0, [R2,#0x2A4]                                        ; +0x54, 0x46f516\nSUBS            R0, R3, R0                                             ; +0x58, 0x46f51a\nSUBS            R3, R0, #1                                             ; +0x5a, 0x46f51c\nNEGS            R0, R3                                                 ; +0x5c, 0x46f51e\nADCS            R0, R3                                                 ; +0x5e, 0x46f520\nPOP             {R3-R5,PC}                                             ; +0x60, 0x46f522\nLDR.W           R1, [R1,#0x640]; int                                   ; +0x62, 0x46f524\nBL              _ZN11GJGameLevel10getCoinKeyEi; GJGameLevel::getCoinKey(int) ; +0x66, 0x46f528\nLDR.W           R3, [R4,#0x608]                                        ; +0x6a, 0x46f52c\nLDR.W           R3, [R3,#0x2F8]                                        ; +0x6e, 0x46f530\nCMP             R3, #1                                                 ; +0x72, 0x46f534\nMOV             R5, R0                                                 ; +0x74, 0x46f536\nBNE             loc_46F548                                             ; +0x76, 0x46f538\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x78, 0x46f53a\nMOV             R1, R5; char *                                         ; +0x7c, 0x46f53e\nPOP.W           {R3-R5,LR}                                             ; +0x7e, 0x46f540\nB.W             _ZN16GameStatsManager13hasSecretCoinEPKc; GameStatsManager::hasSecretCoin(char const*) ; +0x82, 0x46f544\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x86, 0x46f548\nMOV             R1, R5; char *                                         ; +0x8a, 0x46f54c\nBL              _ZN16GameStatsManager11hasUserCoinEPKc; GameStatsManager::hasUserCoin(char const*) ; +0x8c, 0x46f54e\nCBNZ            R0, locret_46F564                                      ; +0x90, 0x46f552\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x92, 0x46f554\nMOV             R1, R5; char *                                         ; +0x96, 0x46f558\nPOP.W           {R3-R5,LR}                                             ; +0x98, 0x46f55a\nB.W             _ZN16GameStatsManager18hasPendingUserCoinEPKc; GameStatsManager::hasPendingUserCoin(char const*) ; +0x9c, 0x46f55e\nMOVS            R0, #0                                                 ; +0xa0, 0x46f562\nPOP             {R3-R5,PC}                                             ; +0xa2, 0x46f564", "xrefs": ["EnhancedGameObject::updateUserCoin @ 0x36093a", "GJBaseGameLayer::collisionCheckObjects @ 0x492ada", "GJBaseGameLayer::collisionCheckObjects @ 0x492b34", "GameObject::playDestroyObjectAnim @ 0x52ad44"], "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"}