{"type": "func", "start": 5373452880, "end": 5373453757, "name": "ShaderLayer::prepareTargetContainer", "pseudocode": "// \n// ShaderLayer::prepareTargetContainer from 0x140486250 to 0x1404865bd (877 bytes)\n// \n// 5 xrefs:\n// > ShaderLayer::visit @ 0x140488abe\n// > <???> @ 0x1406a6644\n// > <???> @ 0x1406a6654\n// > <???> @ 0x1406dbd14\n// > <???> @ 0x1406dbd20\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\ncocos2d::CCPoint ShaderLayer::prepareTargetContainer(ShaderLayer *a1)\n{\n  cocos2d::CCPoint *v1; // rdx\n  cocos2d::CCPoint *v3; // r14\n  GJBaseGameLayer *m_gameLayer; // rcx\n  GJBaseGameLayer *v6; // rax\n  cocos2d::CCNode *m_objectParent; // r15\n  float m_scaleFactor; // xmm7_4\n  GJBaseGameLayer *v9; // rcx\n  double v10; // xmm0_8\n  float v11; // xmm8_4\n  float v12; // xmm0_4\n  float v13; // xmm8_4\n  float v14; // xmm8_4\n  float v15; // xmm7_4\n  float v16; // xmm0_4\n  __int64 v17; // rax\n  cocos2d::CCSprite_vtbl *v18; // rbx\n  const cocos2d::CCRect *v19; // rax\n  __int64 v20; // rax\n  float v21; // xmm0_4\n  float x; // xmm1_4\n  float v23; // xmm1_4\n  cocos2d::CCNode_vtbl *v24; // rbx\n  const cocos2d::CCPoint *v25; // rax\n  char v26[8]; // [rsp+30h] [rbp-19h] BYREF\n  cocos2d::CCRect v27; // [rsp+38h] [rbp-11h] BYREF\n  cocos2d::CCPoint v28; // [rsp+B0h] [rbp+67h] BYREF\n  cocos2d::CCSize v29; // [rsp+C0h] [rbp+77h] BYREF\n  cocos2d::CCPoint v30; // [rsp+C8h] [rbp+7Fh] BYREF\n\n  v3 = v1;\n  m_gameLayer = a1->m_gameLayer;\n  if ( m_gameLayer )\n  {\n    m_gameLayer->m_objectLayer->getPosition_0(m_gameLayer->m_objectLayer);\n    cocos2d::CCPoint::CCPoint(&v30);\n    v6 = a1->m_gameLayer;\n    if ( a1->m_state.m_minBlendingLayer <= 1 )\n      m_objectParent = v6->m_objectParent;\n    else\n      m_objectParent = v6->m_inShaderParent;\n    cocos2d::CCPoint::CCPoint(&v28);\n    if ( a1->m_state.m_pixelateSnapGrid && a1->m_state.m_pixelatePixelating )\n    {\n      m_scaleFactor = a1->m_scaleFactor;\n      if ( a1->m_state.m_pixelateRelative && (v9 = a1->m_gameLayer) != nullptr )\n      {\n        v10 = ((double (__fastcall *)(cocos2d::CCLayer *))v9->m_objectLayer->getScale)(v9->m_objectLayer);\n        v11 = *(float *)&v10;\n        v12 = a1->m_scaleFactor;\n        v13 = fabs(v11);\n      }\n      else\n      {\n        v13 = 1.0;\n        v12 = a1->m_scaleFactor;\n      }\n      if ( a1->m_state.m_pixelatePixelating )\n        v14 = v13 * m_scaleFactor;\n      else\n        v14 = 1.0;\n      v15 = (float)(v14 * a1->m_state.m_pixelateTargetX) / v12;\n      floorf(v30.y / (float)((float)(v14 * a1->m_state.m_pixelateTargetY) / v12));\n      v16 = floorf(v30.x / v15) * v15;\n      cocos2d::CCPoint::CCPoint(v16, v16);\n      cocos2d::CCPoint::operator-(&v30, &v27, v26);\n      cocos2d::CCPoint::operator=(&v28, &v27);\n    }\n    cocos2d::CCPoint::operator=(&dword_1406C2C78, &v28);\n    v17 = (__int64)m_objectParent->getPosition_0(m_objectParent);\n    cocos2d::CCPoint::operator=(&a1->m_savedCameraPosition, v17);\n    ((void (__fastcall *)(cocos2d::CCNode *))m_objectParent->setScaleX)(m_objectParent);\n    ((void (__fastcall *)(cocos2d::CCNode *))m_objectParent->setScaleY)(m_objectParent);\n    a1->m_savedCameraRotation = m_objectParent->getRotation(m_objectParent);\n    cocos2d::CCSize::CCSize(&v29, &a1->m_screenSize);\n    v18 = a1->m_sprite->__vftable;\n    cocos2d::CCRect::CCRect(&v27, -1.0, -1.0, v29.width + 2.0, v29.height + 2.0);\n    v18->setTextureRect_0(a1->m_sprite, v19);\n    cocos2d::CCSize::CCSize(\n      (cocos2d::CCSize *)&v27,\n      a1->m_targetTextureSize.width - v29.width,\n      a1->m_targetTextureSize.height - v29.height);\n    cocos2d::CCSize::operator=(&a1->m_targetTextureSizeExtra, v20);\n    v21 = a1->m_targetTextureSizeExtra.height * 0.5;\n    x = a1->m_savedCameraPosition.x;\n    v28.x = v28.x - (float)(a1->m_targetTextureSizeExtra.width * 0.5);\n    v23 = (float)(x - v28.x) * a1->m_state.m_textureScaleX;\n    v28.y = v28.y - v21;\n    v24 = m_objectParent->__vftable;\n    cocos2d::CCPoint::CCPoint(v21, v23);\n    v24->setPosition_0(m_objectParent, v25);\n    cocos2d::CCPoint::CCPoint(v3);\n    return (cocos2d::CCPoint)v3;\n  }\n  else\n  {\n    cocos2d::CCPoint::CCPoint(v1);\n    return (cocos2d::CCPoint)v3;\n  }\n}", "assembly": "; \n; ShaderLayer::prepareTargetContainer from 0x140486250 to 0x1404865bd (877 bytes)\n; \n; 5 xrefs:\n; > ShaderLayer::visit @ 0x140488abe\n; > <???> @ 0x1406a6644\n; > <???> @ 0x1406a6654\n; > <???> @ 0x1406dbd14\n; > <???> @ 0x1406dbd20\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, 0x140486250\npush    rsi                                                            ; +0x2, 0x140486252\npush    r14                                                            ; +0x3, 0x140486253\nlea     rbp, [rsp-47h]                                                 ; +0x5, 0x140486255\nsub     rsp, 90h                                                       ; +0xa, 0x14048625a\nmov     rsi, rcx                                                       ; +0x11, 0x140486261\nmov     r14, rdx                                                       ; +0x14, 0x140486264\nmov     rcx, [rcx+490h]                                                ; +0x17, 0x140486267\ntest    rcx, rcx                                                       ; +0x1e, 0x14048626e\njnz     short loc_140486292                                            ; +0x21, 0x140486271\nlea     rdx, stru_1406C2C50                                            ; +0x23, 0x140486273\nmov     rcx, r14                                                       ; +0x2a, 0x14048627a\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x2d, 0x14048627d\nmov     rax, r14                                                       ; +0x33, 0x140486283\nadd     rsp, 90h                                                       ; +0x36, 0x140486286\npop     r14                                                            ; +0x3d, 0x14048628d\npop     rsi                                                            ; +0x3f, 0x14048628f\npop     rbp                                                            ; +0x40, 0x140486290\nretn                                                                   ; +0x41, 0x140486291\nmov     rcx, [rcx+0FE8h]                                               ; +0x42, 0x140486292\nmov     [rsp+0A0h+arg_8], rbx                                          ; +0x49, 0x140486299\nmov     [rsp+0A0h+var_18], rdi                                         ; +0x51, 0x1404862a1\nmov     [rsp+0A0h+var_20], r15                                         ; +0x59, 0x1404862a9\nmov     rax, [rcx]                                                     ; +0x61, 0x1404862b1\ncall    qword ptr [rax+0C8h]                                           ; +0x64, 0x1404862b4\nmov     rdx, rax                                                       ; +0x6a, 0x1404862ba\nlea     rcx, [rbp+57h+arg_18]                                          ; +0x6d, 0x1404862bd\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x71, 0x1404862c1\ncmp     dword ptr [rsi+454h], 1                                        ; +0x77, 0x1404862c7\nmov     rax, [rsi+490h]                                                ; +0x7e, 0x1404862ce\njle     short loc_1404862E0                                            ; +0x85, 0x1404862d5\nmov     r15, [rax+0FD8h]                                               ; +0x87, 0x1404862d7\njmp     short loc_1404862E7                                            ; +0x8e, 0x1404862de\nmov     r15, [rax+0FD0h]                                               ; +0x90, 0x1404862e0\nlea     rdx, stru_1406C2C50                                            ; +0x97, 0x1404862e7\nlea     rcx, [rbp+57h+arg_0]                                           ; +0x9e, 0x1404862ee\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0xa2, 0x1404862f2\ncmp     byte ptr [rsi+33Ch], 0                                         ; +0xa8, 0x1404862f8\njz      loc_140486412                                                  ; +0xaf, 0x1404862ff\ncmp     byte ptr [rsi+33Dh], 0                                         ; +0xb5, 0x140486305\njz      loc_140486412                                                  ; +0xbc, 0x14048630c\ncmp     byte ptr [rsi+33Eh], 0                                         ; +0xc2, 0x140486312\nmovaps  [rsp+0A0h+var_30], xmm6                                        ; +0xc9, 0x140486319\nmovss   xmm6, cs:flt_140622C24                                         ; +0xce, 0x14048631e\nmovaps  [rsp+0A0h+var_40], xmm7                                        ; +0xd6, 0x140486326\nmovss   xmm7, dword ptr [rsi+4A8h]                                     ; +0xdb, 0x14048632b\nmovaps  [rsp+0A0h+var_50], xmm8                                        ; +0xe3, 0x140486333\njz      short loc_14048636D                                            ; +0xe9, 0x140486339\nmov     rcx, [rsi+490h]                                                ; +0xeb, 0x14048633b\ntest    rcx, rcx                                                       ; +0xf2, 0x140486342\njz      short loc_14048636D                                            ; +0xf5, 0x140486345\nmov     rcx, [rcx+0FE8h]                                               ; +0xf7, 0x140486347\nmov     rax, [rcx]                                                     ; +0xfe, 0x14048634e\ncall    qword ptr [rax+0A8h]                                           ; +0x101, 0x140486351\nmovaps  xmm8, xmm0                                                     ; +0x107, 0x140486357\nmovss   xmm0, dword ptr [rsi+4A8h]                                     ; +0x10b, 0x14048635b\nandps   xmm8, cs:xmmword_1406243C0                                     ; +0x113, 0x140486363\njmp     short loc_140486374                                            ; +0x11b, 0x14048636b\nmovaps  xmm8, xmm6                                                     ; +0x11d, 0x14048636d\nmovaps  xmm0, xmm7                                                     ; +0x121, 0x140486371\ncmp     byte ptr [rsi+33Dh], 0                                         ; +0x124, 0x140486374\njz      short loc_140486384                                            ; +0x12b, 0x14048637b\nmulss   xmm8, xmm7                                                     ; +0x12d, 0x14048637d\njmp     short loc_140486388                                            ; +0x132, 0x140486382\nmovaps  xmm8, xmm6                                                     ; +0x134, 0x140486384\nmovaps  xmm7, xmm8                                                     ; +0x138, 0x140486388\nmulss   xmm8, dword ptr [rsi+338h]                                     ; +0x13c, 0x14048638c\nmulss   xmm7, dword ptr [rsi+334h]                                     ; +0x145, 0x140486395\ndivss   xmm8, xmm0                                                     ; +0x14d, 0x14048639d\ndivss   xmm7, xmm0                                                     ; +0x152, 0x1404863a2\nmovss   xmm0, [rbp+57h+arg_1C]                                         ; +0x156, 0x1404863a6\ndivss   xmm0, xmm8; X                                                  ; +0x15e, 0x1404863ae\ncall    floorf                                                         ; +0x163, 0x1404863b3\nmovaps  xmm6, xmm0                                                     ; +0x168, 0x1404863b8\nmovss   xmm0, [rbp+57h+arg_18]                                         ; +0x16b, 0x1404863bb\ndivss   xmm0, xmm7; X                                                  ; +0x170, 0x1404863c0\nmulss   xmm6, xmm8                                                     ; +0x174, 0x1404863c4\ncall    floorf                                                         ; +0x179, 0x1404863c9\nmulss   xmm0, xmm7                                                     ; +0x17e, 0x1404863ce\nlea     rcx, [rbp+57h+var_70]                                          ; +0x182, 0x1404863d2\nmovaps  xmm2, xmm6                                                     ; +0x186, 0x1404863d6\nmovaps  xmm1, xmm0                                                     ; +0x189, 0x1404863d9\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x18c, 0x1404863dc\nlea     r8, [rbp+57h+var_70]                                           ; +0x192, 0x1404863e2\nlea     rdx, [rbp+57h+var_68]                                          ; +0x196, 0x1404863e6\nlea     rcx, [rbp+57h+arg_18]                                          ; +0x19a, 0x1404863ea\ncall    cs:??GCCPoint@cocos2d@@QEBA?AV01@AEBV01@@Z; cocos2d::CCPoint::operator-(cocos2d::CCPoint const &) ; +0x19e, 0x1404863ee\nlea     rdx, [rbp+57h+var_68]                                          ; +0x1a4, 0x1404863f4\nlea     rcx, [rbp+57h+arg_0]                                           ; +0x1a8, 0x1404863f8\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0x1ac, 0x1404863fc\nmovaps  xmm8, [rsp+0A0h+var_50]                                        ; +0x1b2, 0x140486402\nmovaps  xmm7, [rsp+0A0h+var_40]                                        ; +0x1b8, 0x140486408\nmovaps  xmm6, [rsp+0A0h+var_30]                                        ; +0x1bd, 0x14048640d\nlea     rdx, [rbp+57h+arg_0]                                           ; +0x1c2, 0x140486412\nlea     rcx, dword_1406C2C78                                           ; +0x1c6, 0x140486416\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0x1cd, 0x14048641d\nmov     rax, [r15]                                                     ; +0x1d3, 0x140486423\nmov     rcx, r15                                                       ; +0x1d6, 0x140486426\ncall    qword ptr [rax+0C8h]                                           ; +0x1d9, 0x140486429\nmov     rdx, rax                                                       ; +0x1df, 0x14048642f\nlea     rcx, [rsi+498h]                                                ; +0x1e2, 0x140486432\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0x1e9, 0x140486439\nmov     rax, [r15]                                                     ; +0x1ef, 0x14048643f\nmov     rcx, r15                                                       ; +0x1f2, 0x140486442\nmovss   xmm1, dword ptr [rsi+230h]                                     ; +0x1f5, 0x140486445\ncall    qword ptr [rax+78h]                                            ; +0x1fd, 0x14048644d\nmov     rax, [r15]                                                     ; +0x200, 0x140486450\nmov     rcx, r15                                                       ; +0x203, 0x140486453\nmovss   xmm1, dword ptr [rsi+234h]                                     ; +0x206, 0x140486456\ncall    qword ptr [rax+88h]                                            ; +0x20e, 0x14048645e\nmov     rax, [r15]                                                     ; +0x214, 0x140486464\nmov     rcx, r15                                                       ; +0x217, 0x140486467\ncall    qword ptr [rax+158h]                                           ; +0x21a, 0x14048646a\nlea     rdx, [rsi+4B0h]                                                ; +0x220, 0x140486470\nmovss   dword ptr [rsi+4A0h], xmm0                                     ; +0x227, 0x140486477\nlea     rcx, [rbp+57h+arg_10]                                          ; +0x22f, 0x14048647f\ncall    cs:??0CCSize@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCSize::CCSize(cocos2d::CCSize const &) ; +0x233, 0x140486483\nmovss   xmm1, [rbp+57h+arg_14]                                         ; +0x239, 0x140486489\nlea     rcx, [rbp+57h+var_68]                                          ; +0x23e, 0x14048648e\naddss   xmm1, cs:width                                                 ; +0x242, 0x140486492\nmovss   xmm3, [rbp+57h+arg_10]                                         ; +0x24a, 0x14048649a\nmov     rax, [rsi+478h]                                                ; +0x24f, 0x14048649f\naddss   xmm3, cs:width                                                 ; +0x256, 0x1404864a6\nmovss   [rsp+0A0h+var_80], xmm1                                        ; +0x25e, 0x1404864ae\nmovss   xmm1, cs:dword_1406236F0                                       ; +0x264, 0x1404864b4\nmov     rbx, [rax]                                                     ; +0x26c, 0x1404864bc\nmovaps  xmm2, xmm1                                                     ; +0x26f, 0x1404864bf\ncall    cs:??0CCRect@cocos2d@@QEAA@MMMM@Z; cocos2d::CCRect::CCRect(float,float,float,float) ; +0x272, 0x1404864c2\nmov     rcx, [rsi+478h]                                                ; +0x278, 0x1404864c8\nmov     rdx, rax                                                       ; +0x27f, 0x1404864cf\ncall    qword ptr [rbx+3D0h]                                           ; +0x282, 0x1404864d2\nmovss   xmm2, dword ptr [rsi+4C4h]                                     ; +0x288, 0x1404864d8\nlea     rcx, [rbp+57h+var_68]                                          ; +0x290, 0x1404864e0\nmovss   xmm1, dword ptr [rsi+4C0h]                                     ; +0x294, 0x1404864e4\nsubss   xmm2, [rbp+57h+arg_14]                                         ; +0x29c, 0x1404864ec\nsubss   xmm1, [rbp+57h+arg_10]                                         ; +0x2a1, 0x1404864f1\ncall    cs:??0CCSize@cocos2d@@QEAA@MM@Z; cocos2d::CCSize::CCSize(float,float) ; +0x2a6, 0x1404864f6\nmov     rdx, rax                                                       ; +0x2ac, 0x1404864fc\nlea     rcx, [rsi+4C8h]                                                ; +0x2af, 0x1404864ff\ncall    cs:??4CCSize@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCSize::operator=(cocos2d::CCSize const &) ; +0x2b6, 0x140486506\nmovss   xmm0, dword ptr [rsi+4C8h]                                     ; +0x2bc, 0x14048650c\nlea     rcx, [rbp+57h+var_68]                                          ; +0x2c4, 0x140486514\nmulss   xmm0, cs:dword_140622B08                                       ; +0x2c8, 0x140486518\nmovss   xmm4, [rbp+57h+arg_0]                                          ; +0x2d0, 0x140486520\nmovss   xmm3, [rbp+57h+arg_4]                                          ; +0x2d5, 0x140486525\nmovss   xmm2, dword ptr [rsi+49Ch]                                     ; +0x2da, 0x14048652a\nsubss   xmm4, xmm0                                                     ; +0x2e2, 0x140486532\nmovss   xmm0, dword ptr [rsi+4CCh]                                     ; +0x2e6, 0x140486536\nmulss   xmm0, cs:dword_140622B08                                       ; +0x2ee, 0x14048653e\nmovss   xmm1, dword ptr [rsi+498h]                                     ; +0x2f6, 0x140486546\nsubss   xmm1, xmm4                                                     ; +0x2fe, 0x14048654e\nmovss   [rbp+57h+arg_0], xmm4                                          ; +0x302, 0x140486552\nsubss   xmm3, xmm0                                                     ; +0x307, 0x140486557\nmulss   xmm1, dword ptr [rsi+230h]                                     ; +0x30b, 0x14048655b\nsubss   xmm2, xmm3                                                     ; +0x313, 0x140486563\nmovss   [rbp+57h+arg_4], xmm3                                          ; +0x317, 0x140486567\nmov     rbx, [r15]                                                     ; +0x31c, 0x14048656c\nmulss   xmm2, dword ptr [rsi+234h]                                     ; +0x31f, 0x14048656f\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x327, 0x140486577\nmov     rdx, rax                                                       ; +0x32d, 0x14048657d\nmov     rcx, r15                                                       ; +0x330, 0x140486580\ncall    qword ptr [rbx+0B8h]                                           ; +0x333, 0x140486583\nlea     rdx, [rbp+57h+arg_0]                                           ; +0x339, 0x140486589\nmov     rcx, r14                                                       ; +0x33d, 0x14048658d\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x340, 0x140486590\nmov     r15, [rsp+0A0h+var_20]                                         ; +0x346, 0x140486596\nmov     rax, r14                                                       ; +0x34e, 0x14048659e\nmov     rdi, [rsp+0A0h+var_18]                                         ; +0x351, 0x1404865a1\nmov     rbx, [rsp+0A0h+arg_8]                                          ; +0x359, 0x1404865a9\nadd     rsp, 90h                                                       ; +0x361, 0x1404865b1\npop     r14                                                            ; +0x368, 0x1404865b8\npop     rsi                                                            ; +0x36a, 0x1404865ba\npop     rbp                                                            ; +0x36b, 0x1404865bb\nretn                                                                   ; +0x36c, 0x1404865bc", "xrefs": ["ShaderLayer::visit @ 0x140488abe", "<???> @ 0x1406a6644", "<???> @ 0x1406a6654", "<???> @ 0x1406dbd14", "<???> @ 0x1406dbd20"], "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"}