{"type": "func", "start": 4295437376, "end": 4295437618, "name": "GJRewardItem::getRewardObjectForType", "pseudocode": "// \n// GJRewardItem::getRewardObjectForType from 0x100072c40 to 0x100072d32 (242 bytes)\n// \n// 1 xrefs:\n// > GameStatsManager::preProcessReward @ 0x100072a73\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// local variable allocation has failed, the output may be wrong!\nGJRewardObject *__fastcall GJRewardItem::getRewardObjectForType(GJRewardItem *a1, SpecialRewardItem a2)\n{\n  cocos2d::CCArray *m_rewardObjects; // rdi\n  cocos2d::CCArray *v4; // rax\n  unsigned int v5; // r15d\n  GJRewardObject *result; // rax\n  GJRewardObject *v7; // r15\n\n  m_rewardObjects = a1->m_rewardObjects;\n  if ( m_rewardObjects )\n    goto LABEL_8;\n  m_rewardObjects = (cocos2d::CCArray *)sub_10071F9E0(0, *(_QWORD *)&a2);\n  v4 = a1->m_rewardObjects;\n  if ( v4 != m_rewardObjects )\n  {\n    if ( m_rewardObjects )\n    {\n      cocos2d::CCObject::retain(m_rewardObjects);\n      v4 = a1->m_rewardObjects;\n    }\n    if ( v4 )\n      cocos2d::CCObject::release(v4);\n    a1->m_rewardObjects = m_rewardObjects;\nLABEL_8:\n    if ( (unsigned int)sub_100720070(m_rewardObjects) )\n      goto LABEL_9;\nLABEL_12:\n    v7 = (GJRewardObject *)operator new(0x48u);\n    cocos2d::CCObject::CCObject(v7);\n    v7->__vftable = (GJRewardObject_vtbl *)off_1008B38A8;\n    v7->m_specialRewardItem = a2;\n    *(_QWORD *)&v7->m_itemID = 0;\n    cocos2d::CCObject::autorelease(v7);\n    sub_10071FCD0(a1->m_rewardObjects, v7);\n    return v7;\n  }\n  if ( !(unsigned int)sub_100720070(a1->m_rewardObjects) )\n    goto LABEL_12;\nLABEL_9:\n  v5 = 0;\n  while ( 1 )\n  {\n    result = (GJRewardObject *)sub_1007200C0(a1->m_rewardObjects, v5);\n    if ( result->m_specialRewardItem == a2 )\n      return result;\n    if ( ++v5 >= (unsigned int)sub_100720070(a1->m_rewardObjects) )\n      goto LABEL_12;\n  }\n}", "assembly": "; \n; GJRewardItem::getRewardObjectForType from 0x100072c40 to 0x100072d32 (242 bytes)\n; \n; 1 xrefs:\n; > GameStatsManager::preProcessReward @ 0x100072a73\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    rbp                                                            ; +0x0, 0x100072c40\nmov     rbp, rsp                                                       ; +0x1, 0x100072c41\npush    r15                                                            ; +0x4, 0x100072c44\npush    r14                                                            ; +0x6, 0x100072c46\npush    rbx                                                            ; +0x8, 0x100072c48\npush    rax                                                            ; +0x9, 0x100072c49\nmov     r14d, esi                                                      ; +0xa, 0x100072c4a\nmov     rbx, rdi                                                       ; +0xd, 0x100072c4d\nmov     rdi, [rdi+48h]                                                 ; +0x10, 0x100072c50\ntest    rdi, rdi                                                       ; +0x14, 0x100072c54\njnz     short loc_100072C99                                            ; +0x17, 0x100072c57\ncall    sub_10071F9E0                                                  ; +0x19, 0x100072c59\nmov     rdi, rax                                                       ; +0x1e, 0x100072c5e\nmov     rax, [rbx+48h]                                                 ; +0x21, 0x100072c61\ncmp     rax, rdi                                                       ; +0x25, 0x100072c65\njz      loc_100072D20                                                  ; +0x28, 0x100072c68\ntest    rdi, rdi                                                       ; +0x2e, 0x100072c6e\njz      short loc_100072C82                                            ; +0x31, 0x100072c71\nmov     r15, rdi                                                       ; +0x33, 0x100072c73\ncall    cocos2d__CCObject__retain                                      ; +0x36, 0x100072c76\nmov     rdi, r15                                                       ; +0x3b, 0x100072c7b\nmov     rax, [rbx+48h]                                                 ; +0x3e, 0x100072c7e\ntest    rax, rax                                                       ; +0x42, 0x100072c82\njz      short loc_100072C95                                            ; +0x45, 0x100072c85\nmov     r15, rdi                                                       ; +0x47, 0x100072c87\nmov     rdi, rax                                                       ; +0x4a, 0x100072c8a\ncall    cocos2d__CCObject__release                                     ; +0x4d, 0x100072c8d\nmov     rdi, r15                                                       ; +0x52, 0x100072c92\nmov     [rbx+48h], rdi                                                 ; +0x55, 0x100072c95\ncall    sub_100720070                                                  ; +0x59, 0x100072c99\ntest    eax, eax                                                       ; +0x5e, 0x100072c9e\njz      short loc_100072CD3                                            ; +0x60, 0x100072ca0\nxor     r15d, r15d                                                     ; +0x62, 0x100072ca2\nnop     word ptr [rax+rax+00000000h]                                   ; +0x65, 0x100072ca5\nmov     rdi, [rbx+48h]                                                 ; +0x70, 0x100072cb0\nmov     esi, r15d                                                      ; +0x74, 0x100072cb4\ncall    sub_1007200C0                                                  ; +0x77, 0x100072cb7\ncmp     [rax+38h], r14d                                                ; +0x7c, 0x100072cbc\njz      short loc_100072D15                                            ; +0x80, 0x100072cc0\ninc     r15d                                                           ; +0x82, 0x100072cc2\nmov     rdi, [rbx+48h]                                                 ; +0x85, 0x100072cc5\ncall    sub_100720070                                                  ; +0x89, 0x100072cc9\ncmp     r15d, eax                                                      ; +0x8e, 0x100072cce\njb      short loc_100072CB0                                            ; +0x91, 0x100072cd1\nmov     edi, 48h ; 'H'; __sz                                           ; +0x93, 0x100072cd3\ncall    __Znwm; operator new(ulong)                                    ; +0x98, 0x100072cd8\nmov     r15, rax                                                       ; +0x9d, 0x100072cdd\nmov     rdi, rax                                                       ; +0xa0, 0x100072ce0\ncall    cocos2d__CCObject__CCObject                                    ; +0xa3, 0x100072ce3\nlea     rax, off_1008B38A8                                             ; +0xa8, 0x100072ce8\nmov     [r15], rax                                                     ; +0xaf, 0x100072cef\nmov     [r15+38h], r14d                                                ; +0xb2, 0x100072cf2\nmov     qword ptr [r15+40h], 0                                         ; +0xb6, 0x100072cf6\nmov     rdi, r15                                                       ; +0xbe, 0x100072cfe\ncall    cocos2d__CCObject__autorelease                                 ; +0xc1, 0x100072d01\nmov     rdi, [rbx+48h]                                                 ; +0xc6, 0x100072d06\nmov     rsi, r15                                                       ; +0xca, 0x100072d0a\ncall    sub_10071FCD0                                                  ; +0xcd, 0x100072d0d\nmov     rax, r15                                                       ; +0xd2, 0x100072d12\nadd     rsp, 8                                                         ; +0xd5, 0x100072d15\npop     rbx                                                            ; +0xd9, 0x100072d19\npop     r14                                                            ; +0xda, 0x100072d1a\npop     r15                                                            ; +0xdc, 0x100072d1c\npop     rbp                                                            ; +0xde, 0x100072d1e\nretn                                                                   ; +0xdf, 0x100072d1f\nmov     rdi, rax                                                       ; +0xe0, 0x100072d20\ncall    sub_100720070                                                  ; +0xe3, 0x100072d23\ntest    eax, eax                                                       ; +0xe8, 0x100072d28\njnz     loc_100072CA2                                                  ; +0xea, 0x100072d2a\njmp     short loc_100072CD3                                            ; +0xf0, 0x100072d30", "xrefs": ["GameStatsManager::preProcessReward @ 0x100072a73"], "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"}