{"type": "func", "start": 5374943072, "end": 5374943407, "name": "BrowseSmartKeyLayer::updateChanceValues", "pseudocode": "// \n// BrowseSmartKeyLayer::updateChanceValues from 0x1405f1f60 to 0x1405f20af (335 bytes)\n// \n// 4 xrefs:\n// > BrowseSmartKeyLayer::onButton @ 0x1405f1a78\n// > BrowseSmartKeyLayer::deletedSelectedItems @ 0x1405f1d98\n// > BrowseSmartKeyLayer::addChanceToSelected @ 0x1405f1f4c\n// > <???> @ 0x14092f2dc\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 11:35:06 +0000\n// \n\n// Hidden C++ exception states: #wind=1\nunsigned int __fastcall BrowseSmartKeyLayer::updateChanceValues(__int64 a1)\n{\n  __int64 v2; // rax\n  int TotalChanceForPrefab; // r12d\n  unsigned int v4; // r15d\n  unsigned int result; // eax\n  cocos2d::CCArray *v6; // rbp\n  unsigned int v7; // ebx\n  struct cocos2d::CCObject *v8; // rax\n  cocos2d::CCLabelBMFont **v9; // r14\n  __int64 v10; // rsi\n  __int64 v11; // rdi\n  int v12; // eax\n  struct cocos2d::CCObject *PrefabWithID; // rax\n  _BYTE v14[88]; // [rsp+20h] [rbp-58h] BYREF\n  unsigned int v15; // [rsp+80h] [rbp+8h]\n\n  v2 = sub_14003F4F0((__int64)v14, a1 + 712);\n  TotalChanceForPrefab = GJSmartTemplate::getTotalChanceForPrefab(*(_QWORD *)(a1 + 664), v2);\n  v4 = 0;\n  v15 = 0;\n  result = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 672));\n  if ( result )\n  {\n    do\n    {\n      v6 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 672), v4);\n      v7 = 0;\n      if ( cocos2d::CCArray::count(v6) )\n      {\n        do\n        {\n          v8 = cocos2d::CCArray::objectAtIndex(v6, v7);\n          v9 = (cocos2d::CCLabelBMFont **)(*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v8 + 952LL))(v8);\n          v10 = sub_14003F4F0((__int64)v14, a1 + 712);\n          v11 = *(_QWORD *)(a1 + 664);\n          v12 = (*((__int64 (__fastcall **)(cocos2d::CCLabelBMFont **))*v9 + 7))(v9);\n          PrefabWithID = GJSmartTemplate::getPrefabWithID(v11, v10, v12);\n          if ( PrefabWithID )\n            GJSmartBlockPreview::addChance(v9, *((_DWORD *)PrefabWithID + 31), TotalChanceForPrefab);\n          ++v7;\n        }\n        while ( v7 < cocos2d::CCArray::count(v6) );\n        v4 = v15;\n      }\n      v15 = ++v4;\n      result = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 672));\n    }\n    while ( v4 < result );\n  }\n  return result;\n}", "assembly": "; \n; BrowseSmartKeyLayer::updateChanceValues from 0x1405f1f60 to 0x1405f20af (335 bytes)\n; \n; 4 xrefs:\n; > BrowseSmartKeyLayer::onButton @ 0x1405f1a78\n; > BrowseSmartKeyLayer::deletedSelectedItems @ 0x1405f1d98\n; > BrowseSmartKeyLayer::addChanceToSelected @ 0x1405f1f4c\n; > <???> @ 0x14092f2dc\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 11:35:06 +0000\n; \nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x1405f1f60\npush    rbp                                                            ; +0x5, 0x1405f1f65\npush    rsi                                                            ; +0x6, 0x1405f1f66\npush    rdi                                                            ; +0x7, 0x1405f1f67\npush    r12                                                            ; +0x8, 0x1405f1f68\npush    r13                                                            ; +0xa, 0x1405f1f6a\npush    r14                                                            ; +0xc, 0x1405f1f6c\npush    r15                                                            ; +0xe, 0x1405f1f6e\nsub     rsp, 40h                                                       ; +0x10, 0x1405f1f70\nmov     r13, rcx                                                       ; +0x14, 0x1405f1f74\nlea     rdx, [rcx+2C8h]                                                ; +0x17, 0x1405f1f77\nlea     rcx, [rsp+78h+var_58]                                          ; +0x1e, 0x1405f1f7e\ncall    sub_14003F4F0                                                  ; +0x23, 0x1405f1f83\nmov     rdx, rax                                                       ; +0x28, 0x1405f1f88\nmov     rcx, [r13+298h]                                                ; +0x2b, 0x1405f1f8b\ncall    GJSmartTemplate__getTotalChanceForPrefab                       ; +0x32, 0x1405f1f92\nmov     r12d, eax                                                      ; +0x37, 0x1405f1f97\nxor     r15d, r15d                                                     ; +0x3a, 0x1405f1f9a\nmov     [rsp+78h+arg_0], r15d                                          ; +0x3d, 0x1405f1f9d\nmov     rcx, [r13+2A0h]                                                ; +0x45, 0x1405f1fa5\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x4c, 0x1405f1fac\ntest    eax, eax                                                       ; +0x52, 0x1405f1fb2\njz      loc_1405F2097                                                  ; +0x54, 0x1405f1fb4\nnop     word ptr [rax+rax+00h]                                         ; +0x5a, 0x1405f1fba\nmov     edx, r15d                                                      ; +0x60, 0x1405f1fc0\nmov     rcx, [r13+2A0h]                                                ; +0x63, 0x1405f1fc3\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x6a, 0x1405f1fca\nmov     rbp, rax                                                       ; +0x70, 0x1405f1fd0\nxor     ebx, ebx                                                       ; +0x73, 0x1405f1fd3\nmov     rcx, rax                                                       ; +0x75, 0x1405f1fd5\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x78, 0x1405f1fd8\ntest    eax, eax                                                       ; +0x7e, 0x1405f1fde\njz      loc_1405F2076                                                  ; +0x80, 0x1405f1fe0\nnop     word ptr [rax+rax+00000000h]                                   ; +0x86, 0x1405f1fe6\nmov     edx, ebx                                                       ; +0x90, 0x1405f1ff0\nmov     rcx, rbp                                                       ; +0x92, 0x1405f1ff2\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x95, 0x1405f1ff5\nmov     rcx, [rax]                                                     ; +0x9b, 0x1405f1ffb\nmov     rdx, [rcx+3B8h]                                                ; +0x9e, 0x1405f1ffe\nmov     rcx, rax                                                       ; +0xa5, 0x1405f2005\ncall    rdx                                                            ; +0xa8, 0x1405f2008\nmov     r14, rax                                                       ; +0xaa, 0x1405f200a\nlea     rax, [rsp+78h+var_58]                                          ; +0xad, 0x1405f200d\nmov     [rsp+78h+arg_8], rax                                           ; +0xb2, 0x1405f2012\nlea     rdx, [r13+2C8h]                                                ; +0xba, 0x1405f201a\nlea     rcx, [rsp+78h+var_58]                                          ; +0xc1, 0x1405f2021\ncall    sub_14003F4F0                                                  ; +0xc6, 0x1405f2026\nmov     rsi, rax                                                       ; +0xcb, 0x1405f202b\nmov     rdi, [r13+298h]                                                ; +0xce, 0x1405f202e\nmov     rdx, [r14]                                                     ; +0xd5, 0x1405f2035\nmov     rcx, r14                                                       ; +0xd8, 0x1405f2038\ncall    qword ptr [rdx+38h]                                            ; +0xdb, 0x1405f203b\nmov     r8d, eax                                                       ; +0xde, 0x1405f203e\nmov     rdx, rsi                                                       ; +0xe1, 0x1405f2041\nmov     rcx, rdi                                                       ; +0xe4, 0x1405f2044\ncall    GJSmartTemplate__getPrefabWithID                               ; +0xe7, 0x1405f2047\ntest    rax, rax                                                       ; +0xec, 0x1405f204c\njz      short loc_1405F205F                                            ; +0xef, 0x1405f204f\nmov     r8d, r12d                                                      ; +0xf1, 0x1405f2051\nmov     edx, [rax+7Ch]                                                 ; +0xf4, 0x1405f2054\nmov     rcx, r14                                                       ; +0xf7, 0x1405f2057\ncall    GJSmartBlockPreview__addChance                                 ; +0xfa, 0x1405f205a\ninc     ebx                                                            ; +0xff, 0x1405f205f\nmov     rcx, rbp                                                       ; +0x101, 0x1405f2061\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x104, 0x1405f2064\ncmp     ebx, eax                                                       ; +0x10a, 0x1405f206a\njb      short loc_1405F1FF0                                            ; +0x10c, 0x1405f206c\nmov     r15d, [rsp+78h+arg_0]                                          ; +0x10e, 0x1405f206e\ninc     r15d                                                           ; +0x116, 0x1405f2076\nmov     [rsp+78h+arg_0], r15d                                          ; +0x119, 0x1405f2079\nmov     rcx, [r13+2A0h]                                                ; +0x121, 0x1405f2081\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x128, 0x1405f2088\ncmp     r15d, eax                                                      ; +0x12e, 0x1405f208e\njb      loc_1405F1FC0                                                  ; +0x131, 0x1405f2091\nmov     rbx, [rsp+78h+arg_10]                                          ; +0x137, 0x1405f2097\nadd     rsp, 40h                                                       ; +0x13f, 0x1405f209f\npop     r15                                                            ; +0x143, 0x1405f20a3\npop     r14                                                            ; +0x145, 0x1405f20a5\npop     r13                                                            ; +0x147, 0x1405f20a7\npop     r12                                                            ; +0x149, 0x1405f20a9\npop     rdi                                                            ; +0x14b, 0x1405f20ab\npop     rsi                                                            ; +0x14c, 0x1405f20ac\npop     rbp                                                            ; +0x14d, 0x1405f20ad\nretn                                                                   ; +0x14e, 0x1405f20ae", "xrefs": ["BrowseSmartKeyLayer::onButton @ 0x1405f1a78", "BrowseSmartKeyLayer::deletedSelectedItems @ 0x1405f1d98", "BrowseSmartKeyLayer::addChanceToSelected @ 0x1405f1f4c", "<???> @ 0x14092f2dc"], "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"}