{"type": "func", "start": 5373435024, "end": 5373435284, "name": "ShaderLayer::init", "pseudocode": "// \n// ShaderLayer::init from 0x140481c90 to 0x140481d94 (260 bytes)\n// \n// 4 xrefs:\n// > GJBaseGameLayer::setupLayers @ 0x14020afd0\n// > GJBaseGameLayer::setupLayers @ 0x14020afc1\n// > <???> @ 0x140609de8\n// > <???> @ 0x1406dbb28\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=1\nbool ShaderLayer::init(ShaderLayer *a1)\n{\n  bool result; // al\n  __int64 v3; // rdx\n  double v4; // xmm0_8\n  void *v5; // [rsp+38h] [rbp+10h]\n\n  result = cocos2d::CCLayer::init(a1);\n  if ( result )\n  {\n    v3 = qword_1406C2ED8;\n    if ( !qword_1406C2ED8 )\n    {\n      v5 = operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00((__int64)v5);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v3 = qword_1406C2ED8;\n    }\n    ShaderLayer::setupShader(a1, *(_BYTE *)(v3 + 1620));\n    v4 = (float)((float)((float)((float)rand() / 32767.0) * 100.0) + 10000.0);\n    a1->m_state.m_startTime = v4;\n    a1->m_state.m_time = v4;\n    if ( a1->m_state.m_minBlendingLayer != 1 )\n    {\n      a1->m_state.m_minBlendingLayer = 1;\n      a1->m_state.m_zLayerDirty = 1;\n    }\n    if ( a1->m_state.m_maxBlendingLayer != 15 )\n    {\n      a1->m_state.m_maxBlendingLayer = 15;\n      a1->m_state.m_zLayerDirty = 1;\n    }\n    if ( a1->m_state.m_noPlayerParticles )\n      a1->m_state.m_noPlayerParticles = 0;\n    a1->m_state.m_zLayerDirty = 1;\n    return 1;\n  }\n  return result;\n}", "assembly": "; \n; ShaderLayer::init from 0x140481c90 to 0x140481d94 (260 bytes)\n; \n; 4 xrefs:\n; > GJBaseGameLayer::setupLayers @ 0x14020afd0\n; > GJBaseGameLayer::setupLayers @ 0x14020afc1\n; > <???> @ 0x140609de8\n; > <???> @ 0x1406dbb28\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    rbx                                                            ; +0x0, 0x140481c90\nsub     rsp, 20h                                                       ; +0x2, 0x140481c92\nmov     rbx, rcx                                                       ; +0x6, 0x140481c96\ncall    cs:__imp_?init@CCLayer@cocos2d@@UEAA_NXZ; cocos2d::CCLayer::init(void) ; +0x9, 0x140481c99\ntest    al, al                                                         ; +0xf, 0x140481c9f\njnz     short loc_140481CA9                                            ; +0x11, 0x140481ca1\nadd     rsp, 20h                                                       ; +0x13, 0x140481ca3\npop     rbx                                                            ; +0x17, 0x140481ca7\nretn                                                                   ; +0x18, 0x140481ca8\nmov     rdx, cs:qword_1406C2ED8                                        ; +0x19, 0x140481ca9\ntest    rdx, rdx                                                       ; +0x20, 0x140481cb0\njnz     short loc_140481CE4                                            ; +0x23, 0x140481cb3\nmov     ecx, 668h; Size                                                ; +0x25, 0x140481cb5\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x2a, 0x140481cba\nmov     [rsp+28h+arg_8], rax                                           ; +0x2f, 0x140481cbf\nmov     rcx, rax                                                       ; +0x34, 0x140481cc4\ncall    sub_14017AB00                                                  ; +0x37, 0x140481cc7\nnop                                                                    ; +0x3c, 0x140481ccc\nmov     cs:qword_1406C2ED8, rax                                        ; +0x3d, 0x140481ccd\nmov     rdx, [rax]                                                     ; +0x44, 0x140481cd4\nmov     rcx, rax                                                       ; +0x47, 0x140481cd7\ncall    qword ptr [rdx+48h]                                            ; +0x4a, 0x140481cda\nmov     rdx, cs:qword_1406C2ED8                                        ; +0x4d, 0x140481cdd\nmovzx   edx, byte ptr [rdx+654h]                                       ; +0x54, 0x140481ce4\nmov     rcx, rbx                                                       ; +0x5b, 0x140481ceb\ncall    ShaderLayer__setupShader                                       ; +0x5e, 0x140481cee\ncall    cs:rand                                                        ; +0x63, 0x140481cf3\nmovd    xmm0, eax                                                      ; +0x69, 0x140481cf9\ncvtdq2ps xmm0, xmm0                                                    ; +0x6d, 0x140481cfd\ndivss   xmm0, cs:dword_140623644                                       ; +0x70, 0x140481d00\nmulss   xmm0, cs:dword_1406232BC                                       ; +0x78, 0x140481d08\naddss   xmm0, cs:dword_140623614                                       ; +0x80, 0x140481d10\ncvtps2pd xmm0, xmm0                                                    ; +0x88, 0x140481d18\nmovsd   qword ptr [rbx+228h], xmm0                                     ; +0x8b, 0x140481d1b\nmovsd   qword ptr [rbx+218h], xmm0                                     ; +0x93, 0x140481d23\nmov     ecx, [rbx+454h]                                                ; +0x9b, 0x140481d2b\ncmp     ecx, 1                                                         ; +0xa1, 0x140481d31\njz      short loc_140481D47                                            ; +0xa4, 0x140481d34\nmov     ecx, 1                                                         ; +0xa6, 0x140481d36\nmov     [rbx+454h], ecx                                                ; +0xab, 0x140481d3b\nmov     [rbx+45Ch], cl                                                 ; +0xb1, 0x140481d41\nmov     eax, [rbx+458h]                                                ; +0xb7, 0x140481d47\ncmp     eax, 0Fh                                                       ; +0xbd, 0x140481d4d\njz      short loc_140481D64                                            ; +0xc0, 0x140481d50\nmov     eax, 0Fh                                                       ; +0xc2, 0x140481d52\nmov     [rbx+458h], eax                                                ; +0xc7, 0x140481d57\nmov     byte ptr [rbx+45Ch], 1                                         ; +0xcd, 0x140481d5d\ncmp     byte ptr [rbx+45Dh], 0                                         ; +0xd4, 0x140481d64\njz      short loc_140481D85                                            ; +0xdb, 0x140481d6b\nmov     byte ptr [rbx+45Dh], 0                                         ; +0xdd, 0x140481d6d\ncmp     ecx, 8                                                         ; +0xe4, 0x140481d74\njz      short loc_140481D7E                                            ; +0xe7, 0x140481d77\ncmp     eax, 8                                                         ; +0xe9, 0x140481d79\njnz     short loc_140481D85                                            ; +0xec, 0x140481d7c\nmov     byte ptr [rbx+45Ch], 1                                         ; +0xee, 0x140481d7e\nmov     byte ptr [rbx+45Ch], 1                                         ; +0xf5, 0x140481d85\nmov     al, 1                                                          ; +0xfc, 0x140481d8c\nadd     rsp, 20h                                                       ; +0xfe, 0x140481d8e\npop     rbx                                                            ; +0x102, 0x140481d92\nretn                                                                   ; +0x103, 0x140481d93", "xrefs": ["GJBaseGameLayer::setupLayers @ 0x14020afd0", "GJBaseGameLayer::setupLayers @ 0x14020afc1", "<???> @ 0x140609de8", "<???> @ 0x1406dbb28"], "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"}