{"type": "func", "start": 5503776, "end": 5503984, "name": "BrowseSmartKeyLayer::updateChanceValues", "pseudocode": "// \n// BrowseSmartKeyLayer::updateChanceValues from 0x53fb20 to 0x53fbf0 (208 bytes)\n// \n// 2 xrefs:\n// > BrowseSmartKeyLayer::deletedSelectedItems @ 0x53fc98\n// > BrowseSmartKeyLayer::addChanceToSelected @ 0x53fd42\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\nvoid BrowseSmartKeyLayer::updateChanceValues(BrowseSmartKeyLayer *a1)\n{\n  GJSmartTemplate *m_template; // r7\n  unsigned int i; // r6\n  unsigned int v4; // r7\n  cocos2d::CCArray *v5; // r10\n  int v6; // r0\n  int v7; // r0\n  GJSmartTemplate *v8; // r11\n  GJSmartBlockPreview *v9; // r8\n  int v10; // r0\n  int PrefabWithID; // r11\n  unsigned int TotalChanceForPrefab; // [sp+0h] [bp-14h]\n  std::string v13; // [sp+8h] [bp-Ch] BYREF\n\n  m_template = a1->m_template;\n  sub_775C20(&v13);\n  TotalChanceForPrefab = GJSmartTemplate::getTotalChanceForPrefab(\n                           (stl::StringData<char>::Internal *)m_template,\n                           (stl::StringData<char>::Internal *)&v13);\n  sub_774008(&v13);\n  for ( i = 0; i < cocos2d::CCArray::count(a1->m_pages); ++i )\n  {\n    v4 = 0;\n    v5 = (cocos2d::CCArray *)cocos2d::CCArray::objectAtIndex(a1->m_pages, i);\n    while ( v4 < cocos2d::CCArray::count(v5) )\n    {\n      v6 = cocos2d::CCArray::objectAtIndex(v5, v4);\n      v7 = (*(int (__fastcall **)(int))(*(_DWORD *)v6 + 528))(v6);\n      v8 = a1->m_template;\n      v9 = (GJSmartBlockPreview *)v7;\n      sub_775C20(&v13);\n      v10 = v9->getTag(v9);\n      PrefabWithID = GJSmartTemplate::getPrefabWithID((int)v8, &v13, v10);\n      sub_774008(&v13);\n      if ( PrefabWithID )\n        GJSmartBlockPreview::addChance(v9, *(_DWORD *)(PrefabWithID + 64), TotalChanceForPrefab);\n      ++v4;\n    }\n  }\n}", "assembly": "; \n; BrowseSmartKeyLayer::updateChanceValues from 0x53fb20 to 0x53fbf0 (208 bytes)\n; \n; 2 xrefs:\n; > BrowseSmartKeyLayer::deletedSelectedItems @ 0x53fc98\n; > BrowseSmartKeyLayer::addChanceToSelected @ 0x53fd42\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.W          {R4-R11,LR}                                            ; +0x0, 0x53fb20\nSUB             SP, SP, #0x14                                          ; +0x4, 0x53fb24\nLDR             R6, =(__stack_chk_guard_ptr - 0x53FB36)                ; +0x6, 0x53fb26\nADD.W           R9, R0, #0x208                                         ; +0x8, 0x53fb28\nLDR.W           R7, [R0,#0x1F0]                                        ; +0xc, 0x53fb2c\nADD             R4, SP, #0x14+var_C                                    ; +0x10, 0x53fb30\nADD             R6, PC; __stack_chk_guard_ptr                          ; +0x12, 0x53fb32\nLDR             R6, [R6]; __stack_chk_guard                            ; +0x14, 0x53fb34\nMOV             R1, R9                                                 ; +0x16, 0x53fb36\nMOV             R5, R0                                                 ; +0x18, 0x53fb38\nMOV             R0, R4                                                 ; +0x1a, 0x53fb3a\nLDR             R3, [R6]                                               ; +0x1c, 0x53fb3c\nSTR             R3, [SP,#0x14+var_8]                                   ; +0x1e, 0x53fb3e\nBL              sub_775C20                                             ; +0x20, 0x53fb40\nMOV             R0, R7                                                 ; +0x24, 0x53fb44\nMOV             R1, R4                                                 ; +0x26, 0x53fb46\nSTR             R6, [SP,#0x14+var_10]                                  ; +0x28, 0x53fb48\nBL              _ZN15GJSmartTemplate23getTotalChanceForPrefabESs; GJSmartTemplate::getTotalChanceForPrefab(std::string) ; +0x2a, 0x53fb4a\nSTR             R0, [SP,#0x14+var_14]                                  ; +0x2e, 0x53fb4e\nMOV             R0, R4                                                 ; +0x30, 0x53fb50\nBL              sub_774008                                             ; +0x32, 0x53fb52\nMOVS            R6, #0                                                 ; +0x36, 0x53fb56\nLDR.W           R0, [R5,#0x1F4]; this                                  ; +0x38, 0x53fb58\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x3c, 0x53fb5c\nCMP             R6, R0                                                 ; +0x40, 0x53fb60\nBCS             loc_53FBDC                                             ; +0x42, 0x53fb62\nLDR.W           R0, [R5,#0x1F4]; this                                  ; +0x44, 0x53fb64\nMOV             R1, R6; unsigned int                                   ; +0x48, 0x53fb68\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x4a, 0x53fb6a\nMOVS            R7, #0                                                 ; +0x4e, 0x53fb6e\nMOV             R10, R0                                                ; +0x50, 0x53fb70\nMOV             R0, R10; this                                          ; +0x52, 0x53fb72\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x54, 0x53fb74\nCMP             R7, R0                                                 ; +0x58, 0x53fb78\nBCS             loc_53FBCC                                             ; +0x5a, 0x53fb7a\nMOV             R1, R7; unsigned int                                   ; +0x5c, 0x53fb7c\nMOV             R0, R10; this                                          ; +0x5e, 0x53fb7e\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x60, 0x53fb80\nLDR             R3, [R0]                                               ; +0x64, 0x53fb84\nLDR.W           R3, [R3,#0x210]                                        ; +0x66, 0x53fb86\nBLX             R3                                                     ; +0x6a, 0x53fb8a\nMOV             R1, R9                                                 ; +0x6c, 0x53fb8c\nLDR.W           R11, [R5,#0x1F0]                                       ; +0x6e, 0x53fb8e\nMOV             R8, R0                                                 ; +0x72, 0x53fb92\nMOV             R0, R4                                                 ; +0x74, 0x53fb94\nBL              sub_775C20                                             ; +0x76, 0x53fb96\nLDR.W           R3, [R8]                                               ; +0x7a, 0x53fb9a\nMOV             R0, R8                                                 ; +0x7e, 0x53fb9e\nLDR             R3, [R3,#0x20]                                         ; +0x80, 0x53fba0\nBLX             R3                                                     ; +0x82, 0x53fba2\nMOV             R2, R0                                                 ; +0x84, 0x53fba4\nMOV             R1, R4                                                 ; +0x86, 0x53fba6\nMOV             R0, R11                                                ; +0x88, 0x53fba8\nBL              _ZN15GJSmartTemplate15getPrefabWithIDESsi; GJSmartTemplate::getPrefabWithID(std::string,int) ; +0x8a, 0x53fbaa\nMOV             R11, R0                                                ; +0x8e, 0x53fbae\nMOV             R0, R4                                                 ; +0x90, 0x53fbb0\nBL              sub_774008                                             ; +0x92, 0x53fbb2\nCMP.W           R11, #0                                                ; +0x96, 0x53fbb6\nBEQ             loc_53FBC8                                             ; +0x9a, 0x53fbba\nMOV             R0, R8; this                                           ; +0x9c, 0x53fbbc\nLDR.W           R1, [R11,#0x40]; int                                   ; +0x9e, 0x53fbbe\nLDR             R2, [SP,#0x14+var_14]; int                             ; +0xa2, 0x53fbc2\nBL              _ZN19GJSmartBlockPreview9addChanceEii; GJSmartBlockPreview::addChance(int,int) ; +0xa4, 0x53fbc4\nADDS            R7, #1                                                 ; +0xa8, 0x53fbc8\nB               loc_53FB72                                             ; +0xaa, 0x53fbca\nADDS            R6, #1                                                 ; +0xac, 0x53fbcc\nB               loc_53FB58                                             ; +0xae, 0x53fbce\nB               loc_53FBD2                                             ; +0xb0, 0x53fbd0\nMOV             R0, R4                                                 ; +0xb2, 0x53fbd2\nBL              sub_774008                                             ; +0xb4, 0x53fbd4\nBL              __cxa_end_cleanup                                      ; +0xb8, 0x53fbd8\nLDR             R3, [SP,#0x14+var_10]                                  ; +0xbc, 0x53fbdc\nLDR             R2, [SP,#0x14+var_8]                                   ; +0xbe, 0x53fbde\nLDR             R3, [R3]                                               ; +0xc0, 0x53fbe0\nCMP             R2, R3                                                 ; +0xc2, 0x53fbe2\nBEQ             loc_53FBEA                                             ; +0xc4, 0x53fbe4\nBLX             __stack_chk_fail                                       ; +0xc6, 0x53fbe6\nADD             SP, SP, #0x14                                          ; +0xca, 0x53fbea\nPOP.W           {R4-R11,PC}                                            ; +0xcc, 0x53fbec", "xrefs": ["BrowseSmartKeyLayer::deletedSelectedItems @ 0x53fc98", "BrowseSmartKeyLayer::addChanceToSelected @ 0x53fd42"], "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"}