{"type": "func", "start": 4298179056, "end": 4298179290, "name": "GJShopLayer::onSelectItem", "pseudocode": "// \n// GJShopLayer::onSelectItem from 0x1003101f0 to 0x1003102da (234 bytes)\n// \n// 1 xrefs:\n// > GJShopLayer::init @ 0x10030f69f\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 12:28:38 +0000\n// \n\nvoid __fastcall GJShopLayer::onSelectItem(__int64 a1, __int64 a2, __m128 a3)\n{\n  __int64 v3; // rax\n  __int64 v4; // rax\n  __int64 StoreItem_1; // r14\n  int v6; // r12d\n  int v7; // r13d\n  __int64 v8; // r15\n  const char *v9; // rsi\n  int Stat; // r15d\n  int v11; // r12d\n  _QWORD *v12; // rax\n  char v13; // [rsp+0h] [rbp-40h] BYREF\n  char v14; // [rsp+1h] [rbp-3Fh] BYREF\n  void *__p; // [rsp+10h] [rbp-30h]\n\n  if ( !*(_BYTE *)(a1 + 432) )\n  {\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);\n    v3 = GameStatsManager::sharedState();\n    if ( !GameStatsManager::isStoreItemUnlocked(v3) )\n    {\n      v4 = GameStatsManager::sharedState();\n      StoreItem_1 = GameStatsManager::getStoreItem_1(v4);\n      v6 = *(_DWORD *)(StoreItem_1 + 352);\n      v7 = *(_DWORD *)(StoreItem_1 + 356);\n      v8 = GameStatsManager::sharedState();\n      GJStoreItem::getCurrencyKey((__int64)&v13, StoreItem_1);\n      if ( (v13 & 1) != 0 )\n        v9 = (const char *)__p;\n      else\n        v9 = &v14;\n      Stat = GameStatsManager::getStat(v8, v9, a3);\n      v11 = v6 - v7;\n      if ( (v13 & 1) != 0 )\n        operator delete(__p);\n      if ( v11 <= Stat )\n      {\n        v12 = (_QWORD *)PurchaseItemPopup::create(StoreItem_1);\n        v12[84] = a1 + 408;\n        (*(void (__fastcall **)(_QWORD *))(*v12 + 1312LL))(v12);\n      }\n      else\n      {\n        sub_100310700(a1, StoreItem_1);\n      }\n    }\n  }\n}", "assembly": "; \n; GJShopLayer::onSelectItem from 0x1003101f0 to 0x1003102da (234 bytes)\n; \n; 1 xrefs:\n; > GJShopLayer::init @ 0x10030f69f\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 12:28:38 +0000\n; \npush    rbp                                                            ; +0x0, 0x1003101f0\nmov     rbp, rsp                                                       ; +0x1, 0x1003101f1\npush    r15                                                            ; +0x4, 0x1003101f4\npush    r14                                                            ; +0x6, 0x1003101f6\npush    r13                                                            ; +0x8, 0x1003101f8\npush    r12                                                            ; +0xa, 0x1003101fa\npush    rbx                                                            ; +0xc, 0x1003101fc\nsub     rsp, 18h                                                       ; +0xd, 0x1003101fd\ncmp     byte ptr [rdi+1B0h], 0                                         ; +0x11, 0x100310201\njnz     loc_1003102CB                                                  ; +0x18, 0x100310208\nmov     rbx, rdi                                                       ; +0x1e, 0x10031020e\nmov     rax, [rsi]                                                     ; +0x21, 0x100310211\nmov     rdi, rsi                                                       ; +0x24, 0x100310214\ncall    qword ptr [rax+40h]                                            ; +0x27, 0x100310217\nmov     r14d, eax                                                      ; +0x2a, 0x10031021a\ncall    GameStatsManager__sharedState                                  ; +0x2d, 0x10031021d\nmov     rdi, rax                                                       ; +0x32, 0x100310222\nmov     esi, r14d                                                      ; +0x35, 0x100310225\ncall    GameStatsManager__isStoreItemUnlocked                          ; +0x38, 0x100310228\ntest    al, al                                                         ; +0x3d, 0x10031022d\njnz     loc_1003102CB                                                  ; +0x3f, 0x10031022f\ncall    GameStatsManager__sharedState                                  ; +0x45, 0x100310235\nmov     rdi, rax                                                       ; +0x4a, 0x10031023a\nmov     esi, r14d                                                      ; +0x4d, 0x10031023d\ncall    GameStatsManager__getStoreItem_1                               ; +0x50, 0x100310240\nmov     r14, rax                                                       ; +0x55, 0x100310245\nmov     r12d, [rax+160h]                                               ; +0x58, 0x100310248\nmov     r13d, [rax+164h]                                               ; +0x5f, 0x10031024f\ncall    GameStatsManager__sharedState                                  ; +0x66, 0x100310256\nmov     r15, rax                                                       ; +0x6b, 0x10031025b\nlea     rdi, [rbp+var_40]                                              ; +0x6e, 0x10031025e\nmov     rsi, r14                                                       ; +0x72, 0x100310262\ncall    GJStoreItem__getCurrencyKey                                    ; +0x75, 0x100310265\ntest    [rbp+var_40], 1                                                ; +0x7a, 0x10031026a\njz      short loc_100310276                                            ; +0x7e, 0x10031026e\nmov     rsi, [rbp+__p]                                                 ; +0x80, 0x100310270\njmp     short loc_10031027A                                            ; +0x84, 0x100310274\nlea     rsi, [rbp+var_3F]                                              ; +0x86, 0x100310276\nmov     rdi, r15                                                       ; +0x8a, 0x10031027a\ncall    GameStatsManager__getStat                                      ; +0x8d, 0x10031027d\nmov     r15d, eax                                                      ; +0x92, 0x100310282\nsub     r12d, r13d                                                     ; +0x95, 0x100310285\ntest    [rbp+var_40], 1                                                ; +0x98, 0x100310288\njz      short loc_100310297                                            ; +0x9c, 0x10031028c\nmov     rdi, [rbp+__p]; __p                                            ; +0x9e, 0x10031028e\ncall    __ZdlPv; operator delete(void *)                               ; +0xa2, 0x100310292\ncmp     r12d, r15d                                                     ; +0xa7, 0x100310297\njle     short loc_1003102A9                                            ; +0xaa, 0x10031029a\nmov     rdi, rbx                                                       ; +0xac, 0x10031029c\nmov     rsi, r14                                                       ; +0xaf, 0x10031029f\ncall    sub_100310700                                                  ; +0xb2, 0x1003102a2\njmp     short loc_1003102CB                                            ; +0xb7, 0x1003102a7\nmov     rdi, r14                                                       ; +0xb9, 0x1003102a9\ncall    PurchaseItemPopup__create                                      ; +0xbc, 0x1003102ac\nadd     rbx, 198h                                                      ; +0xc1, 0x1003102b1\nmov     [rax+2A0h], rbx                                                ; +0xc8, 0x1003102b8\nmov     rcx, [rax]                                                     ; +0xcf, 0x1003102bf\nmov     rdi, rax                                                       ; +0xd2, 0x1003102c2\ncall    qword ptr [rcx+520h]                                           ; +0xd5, 0x1003102c5\nadd     rsp, 18h                                                       ; +0xdb, 0x1003102cb\npop     rbx                                                            ; +0xdf, 0x1003102cf\npop     r12                                                            ; +0xe0, 0x1003102d0\npop     r13                                                            ; +0xe2, 0x1003102d2\npop     r14                                                            ; +0xe4, 0x1003102d4\npop     r15                                                            ; +0xe6, 0x1003102d6\npop     rbp                                                            ; +0xe8, 0x1003102d8\nretn                                                                   ; +0xe9, 0x1003102d9", "xrefs": ["GJShopLayer::init @ 0x10030f69f"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}