{"type": "func", "start": 5371744336, "end": 5371744912, "name": "GameStatsManager::createReward", "pseudocode": "// \n// GameStatsManager::createReward from 0x1402e5050 to 0x1402e5290 (576 bytes)\n// \n// 3 xrefs:\n// > GameLevelManager::rewardItemFromResponse @ 0x14025cc65\n// > GameLevelManager::parseEventReward @ 0x1402601f7\n// > <???> @ 0x14091df78\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:29:50 +0000\n// \n\n// Hidden C++ exception states: #wind=3\n__int64 __fastcall GameStatsManager::createReward(__int64 a1, int a2, int a3, __int64 *a4)\n{\n  int v5; // r13d\n  int v6; // edi\n  __int64 v7; // rcx\n  cocos2d::CCArray *v8; // r14\n  unsigned __int64 v9; // r15\n  __int64 v10; // rdx\n  __int64 v11; // rsi\n  const char *v12; // rcx\n  int v13; // ebx\n  const char *v14; // rcx\n  unsigned int v15; // ebp\n  struct cocos2d::CCObject *v16; // rdi\n  __int64 v17; // rbx\n  cocos2d::CCObject *v18; // rcx\n  __int128 v22; // [rsp+28h] [rbp-80h] BYREF\n  __int64 v23; // [rsp+38h] [rbp-70h]\n  struct cocos2d::CCObject *v24; // [rsp+40h] [rbp-68h]\n  __int128 v25; // [rsp+48h] [rbp-60h] BYREF\n  __int64 v26; // [rsp+58h] [rbp-50h]\n  __int64 v27; // [rsp+60h] [rbp-48h]\n  __int64 *v28; // [rsp+68h] [rbp-40h]\n\n  v5 = a3;\n  v6 = a2;\n  v28 = a4;\n  v22 = 0;\n  v23 = 0;\n  sub_1401C5360(a4, byte_14070ECF8, (__int64 *)&v22);\n  v8 = (cocos2d::CCArray *)cocos2d::CCArray::create(v7);\n  v9 = 0;\n  v10 = v22;\n  if ( (__int64)(*((_QWORD *)&v22 + 1) - v22) >> 5 != 1 )\n  {\n    v11 = 0;\n    while ( 1 )\n    {\n      v12 = (const char *)(v11 + v10);\n      if ( *(_QWORD *)(v11 + v10 + 24) > 0xFu )\n        v12 = *(const char **)v12;\n      v13 = atoi(v12);\n      v14 = (const char *)(v11 + v22 + 32);\n      if ( *((_QWORD *)v14 + 3) > 0xFu )\n        v14 = *(const char **)v14;\n      v15 = atoi(v14);\n      if ( v13 > 1000 )\n        break;\n      if ( (unsigned int)(v13 - 1) <= 0xE && v13 != 9 )\n      {\n        v16 = (struct cocos2d::CCObject *)GJRewardObject::create((unsigned int)v13, v15, 0);\nLABEL_12:\n        if ( v16 )\n          cocos2d::CCArray::addObject(v8, v16);\n      }\n      v9 += 2LL;\n      v11 += 64;\n      v10 = v22;\n      if ( v9 >= ((__int64)(*((_QWORD *)&v22 + 1) - v22) >> 5) - 1 )\n      {\n        v5 = a3;\n        v6 = a2;\n        goto LABEL_16;\n      }\n    }\n    v16 = (struct cocos2d::CCObject *)operator new(0x48u);\n    v24 = v16;\n    cocos2d::CCObject::CCObject(v16);\n    *(_QWORD *)v16 = &GJRewardObject::`vftable';\n    *((_DWORD *)v16 + 14) = 9;\n    *((_DWORD *)v16 + 16) = v15;\n    *((_DWORD *)v16 + 17) = 1;\n    cocos2d::CCObject::autorelease(v16);\n    *((_DWORD *)v16 + 15) = v13 - 1000;\n    goto LABEL_12;\n  }\nLABEL_16:\n  if ( cocos2d::CCArray::count(v8) )\n  {\n    v25 = 0;\n    v26 = 0;\n    v27 = 15;\n    LOBYTE(v25) = 0;\n    v17 = GJRewardItem::create(0, 0, &v25);\n    *(_DWORD *)(v17 + 64) = v6;\n    if ( *(cocos2d::CCArray **)(v17 + 72) != v8 )\n    {\n      if ( v8 )\n        cocos2d::CCObject::retain(v8);\n      v18 = *(cocos2d::CCObject **)(v17 + 72);\n      if ( v18 )\n        cocos2d::CCObject::release(v18);\n      *(_QWORD *)(v17 + 72) = v8;\n    }\n    *(_DWORD *)(v17 + 56) = v5;\n    sub_1400760C0((__int64 *)&v22);\n    sub_14003D310((__int64)a4);\n    return v17;\n  }\n  else\n  {\n    sub_1400760C0((__int64 *)&v22);\n    sub_14003D310((__int64)a4);\n    return 0;\n  }\n}", "assembly": "; \n; GameStatsManager::createReward from 0x1402e5050 to 0x1402e5290 (576 bytes)\n; \n; 3 xrefs:\n; > GameLevelManager::rewardItemFromResponse @ 0x14025cc65\n; > GameLevelManager::parseEventReward @ 0x1402601f7\n; > <???> @ 0x14091df78\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:29:50 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x1402e5050\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x1402e5055\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x1402e505a\npush    rdi                                                            ; +0xf, 0x1402e505f\npush    r12                                                            ; +0x10, 0x1402e5060\npush    r13                                                            ; +0x12, 0x1402e5062\npush    r14                                                            ; +0x14, 0x1402e5064\npush    r15                                                            ; +0x16, 0x1402e5066\nsub     rsp, 80h                                                       ; +0x18, 0x1402e5068\nmov     rax, cs:__security_cookie                                      ; +0x1f, 0x1402e506f\nxor     rax, rsp                                                       ; +0x26, 0x1402e5076\nmov     [rsp+0A8h+var_38], rax                                         ; +0x29, 0x1402e5079\nmov     r12, r9                                                        ; +0x2e, 0x1402e507e\nmov     r13d, r8d                                                      ; +0x31, 0x1402e5081\nmov     [rsp+0A8h+var_88], r8d                                         ; +0x34, 0x1402e5084\nmov     edi, edx                                                       ; +0x39, 0x1402e5089\nmov     [rsp+0A8h+var_84], edx                                         ; +0x3b, 0x1402e508b\nmov     [rsp+0A8h+var_40], r9                                          ; +0x3f, 0x1402e508f\nxorps   xmm0, xmm0                                                     ; +0x44, 0x1402e5094\nmovdqu  [rsp+0A8h+var_80], xmm0                                        ; +0x47, 0x1402e5097\nmov     [rsp+0A8h+var_70], 0                                           ; +0x4d, 0x1402e509d\nlea     r8, [rsp+0A8h+var_80]                                          ; +0x56, 0x1402e50a6\nlea     rdx, byte_14070ECF8                                            ; +0x5b, 0x1402e50ab\nmov     rcx, r9                                                        ; +0x62, 0x1402e50b2\ncall    sub_1401C5360                                                  ; +0x65, 0x1402e50b5\ncall    cs:?create@CCArray@cocos2d@@SAPEAV12@XZ; cocos2d::CCArray::create(void) ; +0x6a, 0x1402e50ba\nmov     r14, rax                                                       ; +0x70, 0x1402e50c0\nxor     r15d, r15d                                                     ; +0x73, 0x1402e50c3\nmov     rcx, qword ptr [rsp+0A8h+var_80+8]                             ; +0x76, 0x1402e50c6\nmov     rdx, qword ptr [rsp+0A8h+var_80]                               ; +0x7b, 0x1402e50cb\nsub     rcx, rdx                                                       ; +0x80, 0x1402e50d0\nsar     rcx, 5                                                         ; +0x83, 0x1402e50d3\ncmp     rcx, 1                                                         ; +0x87, 0x1402e50d7\njz      loc_1402E51CA                                                  ; +0x8b, 0x1402e50db\nxor     esi, esi                                                       ; +0x91, 0x1402e50e1\nlea     r13, ??_7GJRewardObject@@6B@; const GJRewardObject::`vftable'  ; +0x93, 0x1402e50e3\nnop     word ptr [rax+rax+00h]                                         ; +0x9a, 0x1402e50ea\nlea     rcx, [rsi+rdx]                                                 ; +0xa0, 0x1402e50f0\ncmp     qword ptr [rcx+18h], 0Fh                                       ; +0xa4, 0x1402e50f4\njbe     short loc_1402E50FE                                            ; +0xa9, 0x1402e50f9\nmov     rcx, [rcx]; String                                             ; +0xab, 0x1402e50fb\ncall    cs:atoi                                                        ; +0xae, 0x1402e50fe\nmov     ebx, eax                                                       ; +0xb4, 0x1402e5104\nmov     rcx, qword ptr [rsp+0A8h+var_80]                               ; +0xb6, 0x1402e5106\nadd     rcx, 20h ; ' '                                                 ; +0xbb, 0x1402e510b\nadd     rcx, rsi                                                       ; +0xbf, 0x1402e510f\ncmp     qword ptr [rcx+18h], 0Fh                                       ; +0xc2, 0x1402e5112\njbe     short loc_1402E511C                                            ; +0xc7, 0x1402e5117\nmov     rcx, [rcx]; String                                             ; +0xc9, 0x1402e5119\ncall    cs:atoi                                                        ; +0xcc, 0x1402e511c\nmov     ebp, eax                                                       ; +0xd2, 0x1402e5122\ncmp     ebx, 3E8h                                                      ; +0xd4, 0x1402e5124\njle     short loc_1402E516F                                            ; +0xda, 0x1402e512a\nadd     ebx, 0FFFFFC18h                                                ; +0xdc, 0x1402e512c\nmov     ecx, 48h ; 'H'; Size                                           ; +0xe2, 0x1402e5132\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xe7, 0x1402e5137\nmov     rdi, rax                                                       ; +0xec, 0x1402e513c\nmov     [rsp+0A8h+var_68], rax                                         ; +0xef, 0x1402e513f\nmov     rcx, rax                                                       ; +0xf4, 0x1402e5144\ncall    cs:??0CCObject@cocos2d@@QEAA@XZ; cocos2d::CCObject::CCObject(void) ; +0xf7, 0x1402e5147\nmov     [rdi], r13                                                     ; +0xfd, 0x1402e514d\nmov     dword ptr [rdi+38h], 9                                         ; +0x100, 0x1402e5150\nmov     [rdi+40h], ebp                                                 ; +0x107, 0x1402e5157\nmov     dword ptr [rdi+44h], 1                                         ; +0x10a, 0x1402e515a\nmov     rcx, rdi                                                       ; +0x111, 0x1402e5161\ncall    cs:?autorelease@CCObject@cocos2d@@QEAAPEAV12@XZ; cocos2d::CCObject::autorelease(void) ; +0x114, 0x1402e5164\nmov     [rdi+3Ch], ebx                                                 ; +0x11a, 0x1402e516a\njmp     short loc_1402E518B                                            ; +0x11d, 0x1402e516d\nlea     eax, [rbx-1]                                                   ; +0x11f, 0x1402e516f\ncmp     eax, 0Eh                                                       ; +0x122, 0x1402e5172\nja      short loc_1402E519C                                            ; +0x125, 0x1402e5175\ncmp     ebx, 9                                                         ; +0x127, 0x1402e5177\njz      short loc_1402E519C                                            ; +0x12a, 0x1402e517a\nxor     r8d, r8d                                                       ; +0x12c, 0x1402e517c\nmov     edx, ebp                                                       ; +0x12f, 0x1402e517f\nmov     ecx, ebx                                                       ; +0x131, 0x1402e5181\ncall    GJRewardObject__create                                         ; +0x133, 0x1402e5183\nmov     rdi, rax                                                       ; +0x138, 0x1402e5188\ntest    rdi, rdi                                                       ; +0x13b, 0x1402e518b\njz      short loc_1402E519C                                            ; +0x13e, 0x1402e518e\nmov     rdx, rdi                                                       ; +0x140, 0x1402e5190\nmov     rcx, r14                                                       ; +0x143, 0x1402e5193\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x146, 0x1402e5196\nadd     r15, 2                                                         ; +0x14c, 0x1402e519c\nadd     rsi, 40h ; '@'                                                 ; +0x150, 0x1402e51a0\nmov     rax, qword ptr [rsp+0A8h+var_80+8]                             ; +0x154, 0x1402e51a4\nmov     rdx, qword ptr [rsp+0A8h+var_80]                               ; +0x159, 0x1402e51a9\nsub     rax, rdx                                                       ; +0x15e, 0x1402e51ae\nsar     rax, 5                                                         ; +0x161, 0x1402e51b1\ndec     rax                                                            ; +0x165, 0x1402e51b5\ncmp     r15, rax                                                       ; +0x168, 0x1402e51b8\njb      loc_1402E50F0                                                  ; +0x16b, 0x1402e51bb\nmov     r13d, [rsp+0A8h+var_88]                                        ; +0x171, 0x1402e51c1\nmov     edi, [rsp+0A8h+var_84]                                         ; +0x176, 0x1402e51c6\nmov     rcx, r14                                                       ; +0x17a, 0x1402e51ca\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x17d, 0x1402e51cd\ntest    eax, eax                                                       ; +0x183, 0x1402e51d3\njz      short loc_1402E524D                                            ; +0x185, 0x1402e51d5\nxorps   xmm0, xmm0                                                     ; +0x187, 0x1402e51d7\nmovups  [rsp+0A8h+var_60], xmm0                                        ; +0x18a, 0x1402e51da\nmov     [rsp+0A8h+var_50], 0                                           ; +0x18f, 0x1402e51df\nmov     [rsp+0A8h+var_48], 0Fh                                         ; +0x198, 0x1402e51e8\nmov     byte ptr [rsp+0A8h+var_60], 0                                  ; +0x1a1, 0x1402e51f1\nlea     r8, [rsp+0A8h+var_60]                                          ; +0x1a6, 0x1402e51f6\nxor     edx, edx                                                       ; +0x1ab, 0x1402e51fb\nxor     ecx, ecx                                                       ; +0x1ad, 0x1402e51fd\ncall    GJRewardItem__create                                           ; +0x1af, 0x1402e51ff\nmov     rbx, rax                                                       ; +0x1b4, 0x1402e5204\nmov     [rax+40h], edi                                                 ; +0x1b7, 0x1402e5207\ncmp     [rax+48h], r14                                                 ; +0x1ba, 0x1402e520a\njz      short loc_1402E5231                                            ; +0x1be, 0x1402e520e\ntest    r14, r14                                                       ; +0x1c0, 0x1402e5210\njz      short loc_1402E521E                                            ; +0x1c3, 0x1402e5213\nmov     rcx, r14                                                       ; +0x1c5, 0x1402e5215\ncall    cs:?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x1c8, 0x1402e5218\nmov     rcx, [rbx+48h]                                                 ; +0x1ce, 0x1402e521e\ntest    rcx, rcx                                                       ; +0x1d2, 0x1402e5222\njz      short loc_1402E522D                                            ; +0x1d5, 0x1402e5225\ncall    cs:?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0x1d7, 0x1402e5227\nmov     [rbx+48h], r14                                                 ; +0x1dd, 0x1402e522d\nmov     [rbx+38h], r13d                                                ; +0x1e1, 0x1402e5231\nlea     rcx, [rsp+0A8h+var_80]                                         ; +0x1e5, 0x1402e5235\ncall    sub_1400760C0                                                  ; +0x1ea, 0x1402e523a\nnop                                                                    ; +0x1ef, 0x1402e523f\nmov     rcx, r12                                                       ; +0x1f0, 0x1402e5240\ncall    sub_14003D310                                                  ; +0x1f3, 0x1402e5243\nmov     rax, rbx                                                       ; +0x1f8, 0x1402e5248\njmp     short loc_1402E5262                                            ; +0x1fb, 0x1402e524b\nlea     rcx, [rsp+0A8h+var_80]                                         ; +0x1fd, 0x1402e524d\ncall    sub_1400760C0                                                  ; +0x202, 0x1402e5252\nnop                                                                    ; +0x207, 0x1402e5257\nmov     rcx, r12                                                       ; +0x208, 0x1402e5258\ncall    sub_14003D310                                                  ; +0x20b, 0x1402e525b\nxor     eax, eax                                                       ; +0x210, 0x1402e5260\nmov     rcx, [rsp+0A8h+var_38]                                         ; +0x212, 0x1402e5262\nxor     rcx, rsp; StackCookie                                          ; +0x217, 0x1402e5267\ncall    __security_check_cookie                                        ; +0x21a, 0x1402e526a\nlea     r11, [rsp+0A8h+var_28]                                         ; +0x21f, 0x1402e526f\nmov     rbx, [r11+30h]                                                 ; +0x227, 0x1402e5277\nmov     rbp, [r11+38h]                                                 ; +0x22b, 0x1402e527b\nmov     rsi, [r11+40h]                                                 ; +0x22f, 0x1402e527f\nmov     rsp, r11                                                       ; +0x233, 0x1402e5283\npop     r15                                                            ; +0x236, 0x1402e5286\npop     r14                                                            ; +0x238, 0x1402e5288\npop     r13                                                            ; +0x23a, 0x1402e528a\npop     r12                                                            ; +0x23c, 0x1402e528c\npop     rdi                                                            ; +0x23e, 0x1402e528e\nretn                                                                   ; +0x23f, 0x1402e528f", "xrefs": ["GameLevelManager::rewardItemFromResponse @ 0x14025cc65", "GameLevelManager::parseEventReward @ 0x1402601f7", "<???> @ 0x14091df78"], "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"}