{"type": "func", "start": 4296182288, "end": 4296182531, "name": "GJBaseGameLayer::hasUniqueCoin", "pseudocode": "// \n// GJBaseGameLayer::hasUniqueCoin from 0x100128a10 to 0x100128b03 (243 bytes)\n// \n// 4 xrefs:\n// > GJBaseGameLayer::collisionCheckObjects @ 0x100127094\n// > GJBaseGameLayer::collisionCheckObjects @ 0x100127277\n// > GameObject::playDestroyObjectAnim @ 0x10025e618\n// > EnhancedGameObject::updateUserCoin @ 0x1005c1aaa\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; // rdi\n  int m_secretCoinID; // eax\n  int v5; // ecx\n  const char *CoinKey; // r14\n  GJLevelType m_levelType; // ebx\n  GameStatsManager *v8; // rdi\n  bool result; // al\n  bool hasUserCoin; // cl\n  GameStatsManager *v11; // rax\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          v5 = a1->m_level->m_thirdCoinVerified.random - a1->m_level->m_thirdCoinVerified.seed;\n          return v5 == 1;\n        case 2:\n          v5 = a1->m_level->m_secondCoinVerified.random - a1->m_level->m_secondCoinVerified.seed;\n          return v5 == 1;\n        case 1:\n          v5 = a1->m_level->m_firstCoinVerified.random - a1->m_level->m_firstCoinVerified.seed;\n          return v5 == 1;\n      }\n    }\n    return 0;\n  }\n  else\n  {\n    CoinKey = GJGameLevel::getCoinKey(m_level, a2->m_secretCoinID);\n    m_levelType = a1->m_level->m_levelType;\n    v8 = GameStatsManager::sharedState();\n    if ( m_levelType == Main )\n    {\n      return GameStatsManager::hasSecretCoin(v8, CoinKey);\n    }\n    else\n    {\n      hasUserCoin = GameStatsManager::hasUserCoin(v8, CoinKey);\n      result = 1;\n      if ( !hasUserCoin )\n      {\n        v11 = GameStatsManager::sharedState();\n        return GameStatsManager::hasPendingUserCoin(v11, CoinKey);\n      }\n    }\n  }\n  return result;\n}", "assembly": "; \n; GJBaseGameLayer::hasUniqueCoin from 0x100128a10 to 0x100128b03 (243 bytes)\n; \n; 4 xrefs:\n; > GJBaseGameLayer::collisionCheckObjects @ 0x100127094\n; > GJBaseGameLayer::collisionCheckObjects @ 0x100127277\n; > GameObject::playDestroyObjectAnim @ 0x10025e618\n; > EnhancedGameObject::updateUserCoin @ 0x1005c1aaa\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    rbp                                                            ; +0x0, 0x100128a10\nmov     rbp, rsp                                                       ; +0x1, 0x100128a11\npush    r14                                                            ; +0x4, 0x100128a14\npush    rbx                                                            ; +0x6, 0x100128a16\nmov     r14, rsi                                                       ; +0x7, 0x100128a17\nmov     rbx, rdi                                                       ; +0xa, 0x100128a1a\nmov     rdi, [rdi+790h]                                                ; +0xd, 0x100128a1d\ncmp     dword ptr [rdi+404h], 2                                        ; +0x14, 0x100128a24\njnz     short loc_100128A70                                            ; +0x1b, 0x100128a2b\nmov     rax, [r14]                                                     ; +0x1d, 0x100128a2d\nmov     rdi, r14                                                       ; +0x20, 0x100128a30\ncall    qword ptr [rax+6F8h]                                           ; +0x23, 0x100128a33\ncmp     eax, 1Fh                                                       ; +0x29, 0x100128a39\njnz     short loc_100128AA5                                            ; +0x2c, 0x100128a3c\nmov     eax, [r14+700h]                                                ; +0x2e, 0x100128a3e\ncmp     eax, 3                                                         ; +0x35, 0x100128a45\njz      loc_100128AE5                                                  ; +0x38, 0x100128a48\ncmp     eax, 2                                                         ; +0x3e, 0x100128a4e\njz      short loc_100128AD0                                            ; +0x41, 0x100128a51\ncmp     eax, 1                                                         ; +0x43, 0x100128a53\njnz     short loc_100128AA5                                            ; +0x46, 0x100128a56\nmov     rax, [rbx+790h]                                                ; +0x48, 0x100128a58\nmov     ecx, [rax+37Ch]                                                ; +0x4f, 0x100128a5f\nsub     ecx, [rax+380h]                                                ; +0x55, 0x100128a65\njmp     loc_100128AF8                                                  ; +0x5b, 0x100128a6b\nmov     esi, [r14+700h]                                                ; +0x60, 0x100128a70\ncall    GJGameLevel__getCoinKey                                        ; +0x67, 0x100128a77\nmov     r14, rax                                                       ; +0x6c, 0x100128a7c\nmov     rax, [rbx+790h]                                                ; +0x6f, 0x100128a7f\nmov     ebx, [rax+404h]                                                ; +0x76, 0x100128a86\ncall    GameStatsManager__sharedState                                  ; +0x7c, 0x100128a8c\nmov     rdi, rax                                                       ; +0x81, 0x100128a91\ncmp     ebx, 1                                                         ; +0x84, 0x100128a94\njnz     short loc_100128AAC                                            ; +0x87, 0x100128a97\nmov     rsi, r14                                                       ; +0x89, 0x100128a99\npop     rbx                                                            ; +0x8c, 0x100128a9c\npop     r14                                                            ; +0x8d, 0x100128a9d\npop     rbp                                                            ; +0x8f, 0x100128a9f\njmp     GameStatsManager__hasSecretCoin                                ; +0x90, 0x100128aa0\nxor     eax, eax                                                       ; +0x95, 0x100128aa5\npop     rbx                                                            ; +0x97, 0x100128aa7\npop     r14                                                            ; +0x98, 0x100128aa8\npop     rbp                                                            ; +0x9a, 0x100128aaa\nretn                                                                   ; +0x9b, 0x100128aab\nmov     rsi, r14                                                       ; +0x9c, 0x100128aac\ncall    GameStatsManager__hasUserCoin                                  ; +0x9f, 0x100128aaf\nmov     ecx, eax                                                       ; +0xa4, 0x100128ab4\nmov     al, 1                                                          ; +0xa6, 0x100128ab6\ntest    cl, cl                                                         ; +0xa8, 0x100128ab8\njnz     short loc_100128AA7                                            ; +0xaa, 0x100128aba\ncall    GameStatsManager__sharedState                                  ; +0xac, 0x100128abc\nmov     rdi, rax                                                       ; +0xb1, 0x100128ac1\nmov     rsi, r14                                                       ; +0xb4, 0x100128ac4\npop     rbx                                                            ; +0xb7, 0x100128ac7\npop     r14                                                            ; +0xb8, 0x100128ac8\npop     rbp                                                            ; +0xba, 0x100128aca\njmp     GameStatsManager__hasPendingUserCoin                           ; +0xbb, 0x100128acb\nmov     rax, [rbx+790h]                                                ; +0xc0, 0x100128ad0\nmov     ecx, [rax+388h]                                                ; +0xc7, 0x100128ad7\nsub     ecx, [rax+38Ch]                                                ; +0xcd, 0x100128add\njmp     short loc_100128AF8                                            ; +0xd3, 0x100128ae3\nmov     rax, [rbx+790h]                                                ; +0xd5, 0x100128ae5\nmov     ecx, [rax+394h]                                                ; +0xdc, 0x100128aec\nsub     ecx, [rax+398h]                                                ; +0xe2, 0x100128af2\ncmp     ecx, 1                                                         ; +0xe8, 0x100128af8\nsetz    al                                                             ; +0xeb, 0x100128afb\npop     rbx                                                            ; +0xee, 0x100128afe\npop     r14                                                            ; +0xef, 0x100128aff\npop     rbp                                                            ; +0xf1, 0x100128b01\nretn                                                                   ; +0xf2, 0x100128b02", "xrefs": ["GJBaseGameLayer::collisionCheckObjects @ 0x100127094", "GJBaseGameLayer::collisionCheckObjects @ 0x100127277", "GameObject::playDestroyObjectAnim @ 0x10025e618", "EnhancedGameObject::updateUserCoin @ 0x1005c1aaa"], "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"}