{"type": "func", "start": 4297193632, "end": 4297193826, "name": "GJChestSprite::setColor", "pseudocode": "// \n// GJChestSprite::setColor from 0x10021f8a0 to 0x10021f962 (194 bytes)\n// \n// 2 xrefs:\n// > sub_10021F970 @ 0x10021f97c\n// > <???> @ 0x1008e0a50\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 __fastcall GJChestSprite::setColor(GJChestSprite *a1, const cocos2d::ccColor3B *a2)\n{\n  __int64 v2; // rax\n  __int64 v3; // rax\n  __int64 v4; // rbx\n  __int64 v5; // rax\n  _DWORD v6[3]; // [rsp+0h] [rbp-Ch] BYREF\n\n  v6[0] = HIDWORD(v2);\n  *(cocos2d::ccColor3B *)v6 = *a2;\n  if ( a1->m_dark )\n  {\n    BYTE2(v6[0]) = (int)(float)((float)BYTE2(v6[0]) * 0.40000001);\n    LOWORD(v6[0]) = ((unsigned __int8)(int)(float)((float)BYTE1(v6[0]) * 0.40000001) << 8)\n                  | (unsigned __int8)(int)(float)((float)LOBYTE(v6[0]) * 0.40000001);\n  }\n  cocos2d::CCSprite::setColor(a1, (const cocos2d::ccColor3B *)v6);\n  v3 = ((__int64 (__fastcall *)(GJChestSprite *))a1->getChildren)(a1);\n  if ( v3 )\n  {\n    v4 = v3;\n    if ( (unsigned int)sub_100720070(v3) )\n    {\n      v5 = sub_1007200C0(v4, 0);\n      (*(void (__fastcall **)(__int64, _DWORD *))(*(_QWORD *)v5 + 944LL))(v5, v6);\n    }\n  }\n}", "assembly": "; \n; GJChestSprite::setColor from 0x10021f8a0 to 0x10021f962 (194 bytes)\n; \n; 2 xrefs:\n; > sub_10021F970 @ 0x10021f97c\n; > <???> @ 0x1008e0a50\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, 0x10021f8a0\nmov     rbp, rsp                                                       ; +0x1, 0x10021f8a1\npush    rbx                                                            ; +0x4, 0x10021f8a4\npush    rax                                                            ; +0x5, 0x10021f8a5\nmov     rbx, rdi                                                       ; +0x6, 0x10021f8a6\nmovzx   eax, byte ptr [rsi+2]                                          ; +0x9, 0x10021f8a9\nmov     [rbp+var_A], al                                                ; +0xd, 0x10021f8ad\nmovzx   eax, word ptr [rsi]                                            ; +0x10, 0x10021f8b0\nmov     [rbp+var_C], ax                                                ; +0x13, 0x10021f8b3\ncmp     byte ptr [rdi+25Ch], 1                                         ; +0x17, 0x10021f8b7\njnz     short loc_10021F915                                            ; +0x1e, 0x10021f8be\nmovzx   eax, byte ptr [rbp+var_C]                                      ; +0x20, 0x10021f8c0\ncvtsi2ss xmm0, eax                                                     ; +0x24, 0x10021f8c4\nmovss   xmm1, cs:dword_100815004                                       ; +0x28, 0x10021f8c8\nmulss   xmm0, xmm1                                                     ; +0x30, 0x10021f8d0\ncvttss2si eax, xmm0                                                    ; +0x34, 0x10021f8d4\nmovzx   ecx, byte ptr [rbp+var_C+1]                                    ; +0x38, 0x10021f8d8\nxorps   xmm0, xmm0                                                     ; +0x3c, 0x10021f8dc\ncvtsi2ss xmm0, ecx                                                     ; +0x3f, 0x10021f8df\nmulss   xmm0, xmm1                                                     ; +0x43, 0x10021f8e3\ncvttss2si ecx, xmm0                                                    ; +0x47, 0x10021f8e7\nmovzx   edx, [rbp+var_A]                                               ; +0x4b, 0x10021f8eb\nxorps   xmm0, xmm0                                                     ; +0x4f, 0x10021f8ef\ncvtsi2ss xmm0, edx                                                     ; +0x52, 0x10021f8f2\nmulss   xmm0, xmm1                                                     ; +0x56, 0x10021f8f6\ncvttss2si edx, xmm0                                                    ; +0x5a, 0x10021f8fa\nmov     [rbp+var_A], dl                                                ; +0x5e, 0x10021f8fe\nshl     edx, 10h                                                       ; +0x61, 0x10021f901\nmovzx   ecx, cl                                                        ; +0x64, 0x10021f904\nshl     ecx, 8                                                         ; +0x67, 0x10021f907\nor      ecx, edx                                                       ; +0x6a, 0x10021f90a\nmovzx   eax, al                                                        ; +0x6c, 0x10021f90c\nor      eax, ecx                                                       ; +0x6f, 0x10021f90f\nmov     [rbp+var_C], ax                                                ; +0x71, 0x10021f911\nlea     rsi, [rbp+var_C]                                               ; +0x75, 0x10021f915\nmov     rdi, rbx                                                       ; +0x79, 0x10021f919\ncall    cocos2d__CCSprite__setColor                                    ; +0x7c, 0x10021f91c\nmov     rax, [rbx]                                                     ; +0x81, 0x10021f921\nmov     rdi, rbx                                                       ; +0x84, 0x10021f924\ncall    qword ptr [rax+1D8h]                                           ; +0x87, 0x10021f927\ntest    rax, rax                                                       ; +0x8d, 0x10021f92d\njz      short loc_10021F95B                                            ; +0x90, 0x10021f930\nmov     rbx, rax                                                       ; +0x92, 0x10021f932\nmov     rdi, rax                                                       ; +0x95, 0x10021f935\ncall    sub_100720070                                                  ; +0x98, 0x10021f938\ntest    eax, eax                                                       ; +0x9d, 0x10021f93d\njz      short loc_10021F95B                                            ; +0x9f, 0x10021f93f\nmov     rdi, rbx                                                       ; +0xa1, 0x10021f941\nxor     esi, esi                                                       ; +0xa4, 0x10021f944\ncall    sub_1007200C0                                                  ; +0xa6, 0x10021f946\nmov     rcx, [rax]                                                     ; +0xab, 0x10021f94b\nlea     rsi, [rbp+var_C]                                               ; +0xae, 0x10021f94e\nmov     rdi, rax                                                       ; +0xb2, 0x10021f952\ncall    qword ptr [rcx+3B0h]                                           ; +0xb5, 0x10021f955\nadd     rsp, 8                                                         ; +0xbb, 0x10021f95b\npop     rbx                                                            ; +0xbf, 0x10021f95f\npop     rbp                                                            ; +0xc0, 0x10021f960\nretn                                                                   ; +0xc1, 0x10021f961", "xrefs": ["sub_10021F970 @ 0x10021f97c", "<???> @ 0x1008e0a50"], "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"}