{"type": "func", "start": 5152120, "end": 5152304, "name": "GJChestSprite::setColor", "pseudocode": "// \n// GJChestSprite::setColor from 0x4e9d78 to 0x4e9e30 (184 bytes)\n// \n// 1 xrefs:\n// > `non-virtual thunk to'GJChestSprite::setColor @ 0x4e9e3c\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 GJChestSprite::setColor(GJChestSprite *a1, const cocos2d::ccColor3B *a2)\n{\n  cocos2d::CCArray *v3; // r0\n  cocos2d::CCArray *v4; // r6\n  int v5; // r0\n  _DWORD v6[2]; // [sp+0h] [bp-8h] BYREF\n\n  v6[0] = a1;\n  v6[1] = a2;\n  *(cocos2d::ccColor3B *)v6 = *a2;\n  if ( a1->m_dark )\n  {\n    BYTE1(v6[0]) = (unsigned int)(float)((float)BYTE1(v6[0]) * 0.4);\n    BYTE2(v6[0]) = (unsigned int)(float)((float)BYTE2(v6[0]) * 0.4);\n    LOBYTE(v6[0]) = (unsigned int)(float)((float)LOBYTE(v6[0]) * 0.4);\n  }\n  cocos2d::CCSprite::setColor(a1, (const cocos2d::ccColor3B *)v6);\n  v3 = a1->getChildren(a1);\n  v4 = v3;\n  if ( v3 )\n  {\n    if ( cocos2d::CCArray::count(v3) )\n    {\n      v5 = cocos2d::CCArray::objectAtIndex(v4, 0);\n      (*(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v5 + 472))(v5, v6);\n    }\n  }\n}", "assembly": "; \n; GJChestSprite::setColor from 0x4e9d78 to 0x4e9e30 (184 bytes)\n; \n; 1 xrefs:\n; > `non-virtual thunk to'GJChestSprite::setColor @ 0x4e9e3c\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            {R0,R1,R4-R6,LR}                                       ; +0x0, 0x4e9d78\nMOV             R6, R0                                                 ; +0x2, 0x4e9d7a\nLDR             R4, =(__stack_chk_guard_ptr - 0x4E9D86)                ; +0x4, 0x4e9d7c\nMOV             R5, SP                                                 ; +0x6, 0x4e9d7e\nLDRH            R2, [R1]                                               ; +0x8, 0x4e9d80\nADD             R4, PC; __stack_chk_guard_ptr                          ; +0xa, 0x4e9d82\nLDR             R4, [R4]; __stack_chk_guard                            ; +0xc, 0x4e9d84\nLDR             R3, [R4]                                               ; +0xe, 0x4e9d86\nSTRH.W          R2, [SP,#8+var_8]                                      ; +0x10, 0x4e9d88\nSTR             R3, [SP,#8+var_4]                                      ; +0x14, 0x4e9d8c\nLDRB            R3, [R1,#2]                                            ; +0x16, 0x4e9d8e\nSTRB.W          R3, [SP,#8+var_6]                                      ; +0x18, 0x4e9d90\nLDRB.W          R3, [R0,#0x204]                                        ; +0x1c, 0x4e9d94\nCBZ             R3, loc_4E9DF2                                         ; +0x20, 0x4e9d98\nLDRB.W          R3, [SP,#8+var_8+1]                                    ; +0x22, 0x4e9d9a\nVLDR            S13, =0.4                                              ; +0x26, 0x4e9d9e\nLDRB.W          R1, [SP,#8+var_8]                                      ; +0x2a, 0x4e9da2\nVMOV            S14, R3                                                ; +0x2e, 0x4e9da6\nLDRB.W          R3, [SP,#8+var_6]                                      ; +0x32, 0x4e9daa\nVCVT.F32.S32    S14, S14                                               ; +0x36, 0x4e9dae\nVMUL.F32        S14, S14, S13                                          ; +0x3a, 0x4e9db2\nVCVT.U32.F32    S15, S14                                               ; +0x3e, 0x4e9db6\nVMOV            R2, S15                                                ; +0x42, 0x4e9dba\nVMOV            S15, R3                                                ; +0x46, 0x4e9dbe\nVCVT.F32.S32    S15, S15                                               ; +0x4a, 0x4e9dc2\nVMUL.F32        S15, S15, S13                                          ; +0x4e, 0x4e9dc6\nSTRB.W          R2, [SP,#8+var_8+1]                                    ; +0x52, 0x4e9dca\nVCVT.U32.F32    S15, S15                                               ; +0x56, 0x4e9dce\nVMOV            R3, S15                                                ; +0x5a, 0x4e9dd2\nVMOV            S15, R1                                                ; +0x5e, 0x4e9dd6\nVCVT.F32.S32    S15, S15                                               ; +0x62, 0x4e9dda\nVMUL.F32        S15, S15, S13                                          ; +0x66, 0x4e9dde\nSTRB.W          R3, [SP,#8+var_6]                                      ; +0x6a, 0x4e9de2\nVCVT.U32.F32    S15, S15                                               ; +0x6e, 0x4e9de6\nVMOV            R1, S15                                                ; +0x72, 0x4e9dea\nSTRB.W          R1, [SP,#8+var_8]                                      ; +0x76, 0x4e9dee\nMOV             R0, R6                                                 ; +0x7a, 0x4e9df2\nMOV             R1, R5                                                 ; +0x7c, 0x4e9df4\nBL              _ZN7cocos2d8CCSprite8setColorERKNS_10_ccColor3BE; cocos2d::CCSprite::setColor(cocos2d::_ccColor3B const&) ; +0x7e, 0x4e9df6\nLDR             R3, [R6]                                               ; +0x82, 0x4e9dfa\nMOV             R0, R6                                                 ; +0x84, 0x4e9dfc\nLDR.W           R3, [R3,#0xEC]                                         ; +0x86, 0x4e9dfe\nBLX             R3                                                     ; +0x8a, 0x4e9e02\nMOV             R6, R0                                                 ; +0x8c, 0x4e9e04\nCBZ             R0, loc_4E9E20                                         ; +0x8e, 0x4e9e06\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x90, 0x4e9e08\nCBZ             R0, loc_4E9E20                                         ; +0x94, 0x4e9e0c\nMOVS            R1, #0; unsigned int                                   ; +0x96, 0x4e9e0e\nMOV             R0, R6; this                                           ; +0x98, 0x4e9e10\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x9a, 0x4e9e12\nMOV             R1, R5                                                 ; +0x9e, 0x4e9e16\nLDR             R3, [R0]                                               ; +0xa0, 0x4e9e18\nLDR.W           R3, [R3,#0x1D8]                                        ; +0xa2, 0x4e9e1a\nBLX             R3                                                     ; +0xa6, 0x4e9e1e\nLDR             R2, [SP,#8+var_4]                                      ; +0xa8, 0x4e9e20\nLDR             R3, [R4]                                               ; +0xaa, 0x4e9e22\nCMP             R2, R3                                                 ; +0xac, 0x4e9e24\nBEQ             loc_4E9E2C                                             ; +0xae, 0x4e9e26\nBLX             __stack_chk_fail                                       ; +0xb0, 0x4e9e28\nADD             SP, SP, #8                                             ; +0xb4, 0x4e9e2c\nPOP             {R4-R6,PC}                                             ; +0xb6, 0x4e9e2e", "xrefs": ["`non-virtual thunk to'GJChestSprite::setColor @ 0x4e9e3c"], "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"}