{"type": "func", "start": 5372738208, "end": 5372738580, "name": "SecretRewardsLayer::updateUnlockedGoldLabel", "pseudocode": "// \n// SecretRewardsLayer::updateUnlockedGoldLabel from 0x1403d7aa0 to 0x1403d7c14 (372 bytes)\n// \n// 3 xrefs:\n// > SecretRewardsLayer::init @ 0x1403d3ffe\n// > SecretRewardsLayer::onGoldChest @ 0x1403d76f1\n// > <???> @ 0x1406d7dcc\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\n// Hidden C++ exception states: #wind=2\nvoid SecretRewardsLayer::updateUnlockedGoldLabel(SecretRewardsLayer *a1)\n{\n  __int64 v2; // r8\n  int v3; // edi\n  int v4; // esi\n  __int64 v5; // rax\n  __int64 v6; // rax\n  __int64 i; // rdx\n  int v8; // ecx\n  __int64 v9; // rax\n  __int64 v10; // rax\n  __int64 j; // rdx\n  int v12; // ecx\n  void (__fastcall **v13)(unsigned int *, const char *); // rbx\n  cocos2d::CCString *v14; // rax\n  const char *CString; // rax\n  cocos2d::CCSpriteBatchNode **p_m_pobBatchNode; // rcx\n  void *v17; // [rsp+30h] [rbp+8h] BYREF\n\n  v2 = qword_1406C2EE8;\n  if ( !qword_1406C2EE8 )\n  {\n    v17 = operator new(0x3E0u);\n    qword_1406C2EE8 = sub_1401D0AE0((__int64)v17);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);\n    v2 = qword_1406C2EE8;\n  }\n  v3 = 0;\n  v4 = 0;\n  v5 = *(_QWORD *)(v2 + 856);\n  if ( v5 )\n  {\n    v6 = *(_QWORD *)(v5 + 56);\n    if ( v6 )\n    {\n      for ( i = *(_QWORD *)(v6 + 288); ; i = *(_QWORD *)(i + 288) )\n      {\n        v8 = v4++;\n        if ( *(_DWORD *)(*(_QWORD *)(v6 + 264) + 64LL) != 9 )\n          v4 = v8;\n        v6 = i;\n        if ( !i )\n          break;\n      }\n    }\n  }\n  v9 = *(_QWORD *)(v2 + 352);\n  if ( v9 )\n  {\n    v10 = *(_QWORD *)(v9 + 56);\n    if ( v10 )\n    {\n      for ( j = *(_QWORD *)(v10 + 288); ; j = *(_QWORD *)(j + 288) )\n      {\n        v12 = v3++;\n        if ( *(_DWORD *)(*(_QWORD *)(v10 + 264) + 64LL) != 9 )\n          v3 = v12;\n        v10 = j;\n        if ( !j )\n          break;\n      }\n    }\n  }\n  v13 = *(void (__fastcall ***)(unsigned int *, const char *))&a1->m_goldPriceSprite->m_uAtlasIndex;\n  v14 = cocos2d::CCString::createWithFormat(\"%i / %i\", v4, v3);\n  CString = cocos2d::CCString::getCString(v14);\n  (*v13)(&a1->m_goldPriceSprite->m_uAtlasIndex, CString);\n  p_m_pobBatchNode = &a1->m_goldPriceSprite->m_pobBatchNode;\n  if ( v4 < v3 )\n  {\n    qmemcpy(&v17, \"dWp\", 3);\n  }\n  else\n  {\n    LOWORD(v17) = -206;\n    BYTE2(v17) = 50;\n  }\n  ((void (__fastcall *)(cocos2d::CCSpriteBatchNode **, void **))(*p_m_pobBatchNode)->cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable)(\n    p_m_pobBatchNode,\n    &v17);\n}", "assembly": "; \n; SecretRewardsLayer::updateUnlockedGoldLabel from 0x1403d7aa0 to 0x1403d7c14 (372 bytes)\n; \n; 3 xrefs:\n; > SecretRewardsLayer::init @ 0x1403d3ffe\n; > SecretRewardsLayer::onGoldChest @ 0x1403d76f1\n; > <???> @ 0x1406d7dcc\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\nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x1403d7aa0\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x1403d7aa5\nmov     [rsp+arg_18], rsi                                              ; +0xa, 0x1403d7aaa\npush    rdi                                                            ; +0xf, 0x1403d7aaf\nsub     rsp, 20h                                                       ; +0x10, 0x1403d7ab0\nmov     rbp, rcx                                                       ; +0x14, 0x1403d7ab4\nmov     r8, cs:qword_1406C2EE8                                         ; +0x17, 0x1403d7ab7\ntest    r8, r8                                                         ; +0x1e, 0x1403d7abe\njnz     short loc_1403D7AF2                                            ; +0x21, 0x1403d7ac1\nmov     ecx, 3E0h; Size                                                ; +0x23, 0x1403d7ac3\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x28, 0x1403d7ac8\nmov     [rsp+28h+arg_0], rax                                           ; +0x2d, 0x1403d7acd\nmov     rcx, rax                                                       ; +0x32, 0x1403d7ad2\ncall    sub_1401D0AE0                                                  ; +0x35, 0x1403d7ad5\nnop                                                                    ; +0x3a, 0x1403d7ada\nmov     cs:qword_1406C2EE8, rax                                        ; +0x3b, 0x1403d7adb\nmov     rdx, [rax]                                                     ; +0x42, 0x1403d7ae2\nmov     rcx, rax                                                       ; +0x45, 0x1403d7ae5\ncall    qword ptr [rdx+48h]                                            ; +0x48, 0x1403d7ae8\nmov     r8, cs:qword_1406C2EE8                                         ; +0x4b, 0x1403d7aeb\nxor     edi, edi                                                       ; +0x52, 0x1403d7af2\nmov     esi, edi                                                       ; +0x54, 0x1403d7af4\nmov     rax, [r8+358h]                                                 ; +0x56, 0x1403d7af6\ntest    rax, rax                                                       ; +0x5d, 0x1403d7afd\njz      short loc_1403D7B43                                            ; +0x60, 0x1403d7b00\nmov     rax, [rax+38h]                                                 ; +0x62, 0x1403d7b02\ntest    rax, rax                                                       ; +0x66, 0x1403d7b06\njz      short loc_1403D7B43                                            ; +0x69, 0x1403d7b09\nmov     rdx, [rax+120h]                                                ; +0x6b, 0x1403d7b0b\nnop     dword ptr [rax+00h]                                            ; +0x72, 0x1403d7b12\nnop     word ptr [rax+rax+00000000h]                                   ; +0x76, 0x1403d7b16\nmov     ecx, esi                                                       ; +0x80, 0x1403d7b20\nmov     rax, [rax+108h]                                                ; +0x82, 0x1403d7b22\ninc     esi                                                            ; +0x89, 0x1403d7b29\ncmp     dword ptr [rax+40h], 9                                         ; +0x8b, 0x1403d7b2b\ncmovnz  esi, ecx                                                       ; +0x8f, 0x1403d7b2f\nmov     rax, rdx                                                       ; +0x92, 0x1403d7b32\ntest    rdx, rdx                                                       ; +0x95, 0x1403d7b35\njz      short loc_1403D7B43                                            ; +0x98, 0x1403d7b38\nmov     rdx, [rdx+120h]                                                ; +0x9a, 0x1403d7b3a\njmp     short loc_1403D7B20                                            ; +0xa1, 0x1403d7b41\nmov     rax, [r8+160h]                                                 ; +0xa3, 0x1403d7b43\ntest    rax, rax                                                       ; +0xaa, 0x1403d7b4a\njz      short loc_1403D7B83                                            ; +0xad, 0x1403d7b4d\nmov     rax, [rax+38h]                                                 ; +0xaf, 0x1403d7b4f\ntest    rax, rax                                                       ; +0xb3, 0x1403d7b53\njz      short loc_1403D7B83                                            ; +0xb6, 0x1403d7b56\nmov     rdx, [rax+120h]                                                ; +0xb8, 0x1403d7b58\nnop                                                                    ; +0xbf, 0x1403d7b5f\nmov     ecx, edi                                                       ; +0xc0, 0x1403d7b60\nmov     rax, [rax+108h]                                                ; +0xc2, 0x1403d7b62\ninc     edi                                                            ; +0xc9, 0x1403d7b69\ncmp     dword ptr [rax+40h], 9                                         ; +0xcb, 0x1403d7b6b\ncmovnz  edi, ecx                                                       ; +0xcf, 0x1403d7b6f\nmov     rax, rdx                                                       ; +0xd2, 0x1403d7b72\ntest    rdx, rdx                                                       ; +0xd5, 0x1403d7b75\njz      short loc_1403D7B83                                            ; +0xd8, 0x1403d7b78\nmov     rdx, [rdx+120h]                                                ; +0xda, 0x1403d7b7a\njmp     short loc_1403D7B60                                            ; +0xe1, 0x1403d7b81\nmov     rax, [rbp+1C8h]                                                ; +0xe3, 0x1403d7b83\nmov     rbx, [rax+168h]                                                ; +0xea, 0x1403d7b8a\nmov     r8d, edi                                                       ; +0xf1, 0x1403d7b91\nmov     edx, esi                                                       ; +0xf4, 0x1403d7b94\nlea     rcx, aII; \"%i / %i\"                                            ; +0xf6, 0x1403d7b96\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xfd, 0x1403d7b9d\nmov     rcx, rax                                                       ; +0x103, 0x1403d7ba3\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x106, 0x1403d7ba6\nmov     rdx, rax                                                       ; +0x10c, 0x1403d7bac\nmov     rcx, [rbp+1C8h]                                                ; +0x10f, 0x1403d7baf\nadd     rcx, 168h                                                      ; +0x116, 0x1403d7bb6\ncall    qword ptr [rbx]                                                ; +0x11d, 0x1403d7bbd\nmov     rcx, [rbp+1C8h]                                                ; +0x11f, 0x1403d7bbf\nadd     rcx, 170h                                                      ; +0x126, 0x1403d7bc6\nlea     rdx, [rsp+28h+arg_0]                                           ; +0x12d, 0x1403d7bcd\ncmp     esi, edi                                                       ; +0x132, 0x1403d7bd2\njl      short loc_1403D7BE4                                            ; +0x134, 0x1403d7bd4\nmov     word ptr [rsp+28h+arg_0], 0FF32h                               ; +0x136, 0x1403d7bd6\nmov     byte ptr [rsp+28h+arg_0+2], 32h ; '2'                          ; +0x13d, 0x1403d7bdd\njmp     short loc_1403D7BF0                                            ; +0x142, 0x1403d7be2\nmov     word ptr [rsp+28h+arg_0], 5764h                                ; +0x144, 0x1403d7be4\nmov     byte ptr [rsp+28h+arg_0+2], 70h ; 'p'                          ; +0x14b, 0x1403d7beb\nmovzx   eax, word ptr [rsp+28h+arg_0]                                  ; +0x150, 0x1403d7bf0\nmov     word ptr [rsp+28h+arg_0], ax                                   ; +0x155, 0x1403d7bf5\nmov     rax, [rcx]                                                     ; +0x15a, 0x1403d7bfa\ncall    qword ptr [rax]                                                ; +0x15d, 0x1403d7bfd\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x15f, 0x1403d7bff\nmov     rbp, [rsp+28h+arg_10]                                          ; +0x164, 0x1403d7c04\nmov     rsi, [rsp+28h+arg_18]                                          ; +0x169, 0x1403d7c09\nadd     rsp, 20h                                                       ; +0x16e, 0x1403d7c0e\npop     rdi                                                            ; +0x172, 0x1403d7c12\nretn                                                                   ; +0x173, 0x1403d7c13", "xrefs": ["SecretRewardsLayer::init @ 0x1403d3ffe", "SecretRewardsLayer::onGoldChest @ 0x1403d76f1", "<???> @ 0x1406d7dcc"], "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"}