{"type": "func", "start": 6443160528, "end": 6443161107, "name": "cocos2d::CCTMXLayer::tileAt", "pseudocode": "// \n// cocos2d::CCTMXLayer::tileAt from 0x1800ad3d0 to 0x1800ad613 (579 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b8280\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\nstruct cocos2d::CCSprite *__fastcall cocos2d::CCTMXLayer::tileAt(\n        cocos2d::CCTMXLayer *this,\n        struct cocos2d::CCPoint *a2)\n{\n  struct cocos2d::CCSprite *v4; // rsi\n  float v5; // ebp\n  struct cocos2d::CCSprite *result; // rax\n  cocos2d::CCDirector *v7; // rax\n  float ContentScaleFactor; // xmm0_4\n  float v9; // xmm8_4\n  cocos2d::CCDirector *v10; // rax\n  float v11; // xmm0_4\n  float v12; // xmm7_4\n  cocos2d::CCDirector *v13; // rax\n  float v14; // xmm0_4\n  float v15; // xmm6_4\n  cocos2d::CCDirector *v16; // rax\n  float v17; // xmm0_4\n  cocos2d::CCRect *v18; // rax\n  cocos2d::CCSprite *v19; // rax\n  cocos2d::CCSprite_vtbl *v20; // rbx\n  __int64 v21; // rax\n  cocos2d::CCSprite_vtbl *v22; // rbx\n  struct cocos2d::CCPoint *v23; // rax\n  cocos2d::CCSprite_vtbl *v24; // rbx\n  void *v25; // rax\n  float v26[4]; // [rsp+30h] [rbp-68h] BYREF\n  cocos2d::CCRect v27; // [rsp+40h] [rbp-58h] BYREF\n  cocos2d::CCSprite *Key; // [rsp+A0h] [rbp+8h] BYREF\n\n  v4 = nullptr;\n  LODWORD(v5) = (int)(float)((float)(*((float *)this + 90) * a2->y) + a2->x);\n  if ( (*(_DWORD *)(*((_QWORD *)this + 47) + 4LL * SLODWORD(v5)) & 0x1FFFFFFF) != 0 )\n  {\n    result = (struct cocos2d::CCSprite *)((__int64 (__fastcall *)(cocos2d::CCTMXLayer *, _QWORD))this->getChildByTag)(\n                                           this,\n                                           LODWORD(v5));\n    if ( result )\n      return result;\n    cocos2d::CCTMXTilesetInfo::rectForGID(*((struct cocos2d::CCRect **)this + 48), (unsigned int)v26);\n    v7 = cocos2d::CCDirector::sharedDirector();\n    ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v7);\n    v9 = v26[3] / ContentScaleFactor;\n    v10 = cocos2d::CCDirector::sharedDirector();\n    v11 = cocos2d::CCDirector::getContentScaleFactor(v10);\n    v12 = v26[2] / v11;\n    v13 = cocos2d::CCDirector::sharedDirector();\n    v14 = cocos2d::CCDirector::getContentScaleFactor(v13);\n    v15 = v26[1] / v14;\n    v16 = cocos2d::CCDirector::sharedDirector();\n    v17 = cocos2d::CCDirector::getContentScaleFactor(v16);\n    v18 = cocos2d::CCRect::CCRect(&v27, v26[0] / v17, v15, v12, v9);\n    cocos2d::CCRect::operator=(v26, (float *)&v18->origin);\n    v19 = (cocos2d::CCSprite *)operator new(0x258u);\n    Key = v19;\n    if ( v19 )\n      v4 = cocos2d::CCSprite::CCSprite(v19);\n    v20 = v4->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    v21 = ((__int64 (__fastcall *)(cocos2d::CCTextureProtocol *))this->getTexture)(&this->cocos2d::CCTextureProtocol);\n    ((void (__fastcall *)(struct cocos2d::CCSprite *, __int64, float *))v20->initWithTexture_0)(v4, v21, v26);\n    ((void (__fastcall *)(struct cocos2d::CCSprite *, cocos2d::CCTMXLayer *))v4->setBatchNode)(v4, this);\n    v22 = v4->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    v23 = cocos2d::CCTMXLayer::positionAt(this, (struct cocos2d::CCPoint *)&Key, (float *)a2);\n    ((void (__fastcall *)(struct cocos2d::CCSprite *, struct cocos2d::CCPoint *))v22->setPosition_0)(v4, v23);\n    v24 = v4->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    cocos2d::CCTMXLayer::vertexZForPos(this, a2);\n    ((void (__fastcall *)(struct cocos2d::CCSprite *))v24->setVertexZ)(v4);\n    ((void (__fastcall *)(struct cocos2d::CCSprite *, struct cocos2d::CCSize *))v4->setAnchorPoint)(v4, &unk_1801A9AC8);\n    ((void (__fastcall *)(cocos2d::CCRGBAProtocol *, _QWORD))v4->setOpacity)(\n      &v4->cocos2d::CCRGBAProtocol,\n      *((unsigned __int8 *)this + 440));\n    *(float *)&Key = v5;\n    v25 = bsearch(\n            &Key,\n            *(const void **)(*((_QWORD *)this + 59) + 16LL),\n            **((unsigned int **)this + 59),\n            8u,\n            (_CoreCrtNonSecureSearchSortCompareFunction)CompareFunction);\n    cocos2d::CCSpriteBatchNode::addSpriteWithoutQuad(\n      this,\n      v4,\n      ((unsigned __int64)v25 - *(_QWORD *)(*((_QWORD *)this + 59) + 16LL)) >> 3,\n      SLODWORD(v5));\n    cocos2d::CCObject::release(v4);\n  }\n  return v4;\n}", "assembly": "; \n; cocos2d::CCTMXLayer::tileAt from 0x1800ad3d0 to 0x1800ad613 (579 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b8280\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\nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x1800ad3d0\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x1800ad3d5\npush    rsi                                                            ; +0xa, 0x1800ad3da\npush    rdi                                                            ; +0xb, 0x1800ad3db\npush    r14                                                            ; +0xc, 0x1800ad3dc\nsub     rsp, 80h                                                       ; +0xe, 0x1800ad3de\nmovaps  [rsp+98h+var_28], xmm6                                         ; +0x15, 0x1800ad3e5\nmovaps  [rsp+98h+var_38], xmm7                                         ; +0x1a, 0x1800ad3ea\nmovaps  [rsp+98h+var_48], xmm8                                         ; +0x1f, 0x1800ad3ef\nmov     r14, rdx                                                       ; +0x25, 0x1800ad3f5\nmov     rdi, rcx                                                       ; +0x28, 0x1800ad3f8\nxor     esi, esi                                                       ; +0x2b, 0x1800ad3fb\nmovss   xmm0, dword ptr [rcx+168h]                                     ; +0x2d, 0x1800ad3fd\nmulss   xmm0, dword ptr [rdx+4]                                        ; +0x35, 0x1800ad405\naddss   xmm0, dword ptr [rdx]                                          ; +0x3a, 0x1800ad40a\ncvttss2si ebp, xmm0                                                    ; +0x3e, 0x1800ad40e\nmovsxd  r8, ebp                                                        ; +0x42, 0x1800ad412\nmov     rax, [rcx+178h]                                                ; +0x45, 0x1800ad415\nmov     ebx, [rax+r8*4]                                                ; +0x4c, 0x1800ad41c\nand     ebx, 1FFFFFFFh                                                 ; +0x50, 0x1800ad420\njz      loc_1800AD5E9                                                  ; +0x56, 0x1800ad426\nmov     rax, [rcx]                                                     ; +0x5c, 0x1800ad42c\nmov     edx, ebp                                                       ; +0x5f, 0x1800ad42f\ncall    qword ptr [rax+1C8h]                                           ; +0x61, 0x1800ad431\ntest    rax, rax                                                       ; +0x67, 0x1800ad437\njnz     loc_1800AD5EC                                                  ; +0x6a, 0x1800ad43a\nmov     r8d, ebx                                                       ; +0x70, 0x1800ad440\nlea     rdx, [rsp+98h+var_68]                                          ; +0x73, 0x1800ad443\nmov     rcx, [rdi+180h]                                                ; +0x78, 0x1800ad448\ncall    ?rectForGID@CCTMXTilesetInfo@cocos2d@@QEAA?AVCCRect@2@I@Z; cocos2d::CCTMXTilesetInfo::rectForGID(uint) ; +0x7f, 0x1800ad44f\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x84, 0x1800ad454\nmov     rcx, rax; this                                                 ; +0x89, 0x1800ad459\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x8c, 0x1800ad45c\nmovss   xmm8, [rsp+98h+var_5C]                                         ; +0x91, 0x1800ad461\ndivss   xmm8, xmm0                                                     ; +0x98, 0x1800ad468\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x9d, 0x1800ad46d\nmov     rcx, rax; this                                                 ; +0xa2, 0x1800ad472\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0xa5, 0x1800ad475\nmovss   xmm7, [rsp+98h+var_60]                                         ; +0xaa, 0x1800ad47a\ndivss   xmm7, xmm0                                                     ; +0xb0, 0x1800ad480\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0xb4, 0x1800ad484\nmov     rcx, rax; this                                                 ; +0xb9, 0x1800ad489\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0xbc, 0x1800ad48c\nmovss   xmm6, [rsp+98h+var_64]                                         ; +0xc1, 0x1800ad491\ndivss   xmm6, xmm0                                                     ; +0xc7, 0x1800ad497\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0xcb, 0x1800ad49b\nmov     rcx, rax; this                                                 ; +0xd0, 0x1800ad4a0\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0xd3, 0x1800ad4a3\nmovss   xmm1, [rsp+98h+var_68]                                         ; +0xd8, 0x1800ad4a8\ndivss   xmm1, xmm0; float                                              ; +0xde, 0x1800ad4ae\nmovss   dword ptr [rsp+98h+CompareFunction], xmm8; float               ; +0xe2, 0x1800ad4b2\nmovaps  xmm3, xmm7; float                                              ; +0xe9, 0x1800ad4b9\nmovaps  xmm2, xmm6; float                                              ; +0xec, 0x1800ad4bc\nlea     rcx, [rsp+98h+var_58]; this                                    ; +0xef, 0x1800ad4bf\ncall    ??0CCRect@cocos2d@@QEAA@MMMM@Z; cocos2d::CCRect::CCRect(float,float,float,float) ; +0xf4, 0x1800ad4c4\nmov     rdx, rax                                                       ; +0xf9, 0x1800ad4c9\nlea     rcx, [rsp+98h+var_68]                                          ; +0xfc, 0x1800ad4cc\ncall    ??4CCRect@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCRect::operator=(cocos2d::CCRect const &) ; +0x101, 0x1800ad4d1\nmov     ecx, 258h; Size                                                ; +0x106, 0x1800ad4d6\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x10b, 0x1800ad4db\nmov     [rsp+98h+Key], rax                                             ; +0x110, 0x1800ad4e0\ntest    rax, rax                                                       ; +0x118, 0x1800ad4e8\njz      short loc_1800AD4F8                                            ; +0x11b, 0x1800ad4eb\nmov     rcx, rax; this                                                 ; +0x11d, 0x1800ad4ed\ncall    ??0CCSprite@cocos2d@@QEAA@XZ; cocos2d::CCSprite::CCSprite(void) ; +0x120, 0x1800ad4f0\nmov     rsi, rax                                                       ; +0x125, 0x1800ad4f5\nmov     rbx, [rsi]                                                     ; +0x128, 0x1800ad4f8\nlea     rcx, [rdi+140h]                                                ; +0x12b, 0x1800ad4fb\nmov     rax, [rcx]                                                     ; +0x132, 0x1800ad502\ncall    qword ptr [rax+10h]                                            ; +0x135, 0x1800ad505\nmov     rdx, rax                                                       ; +0x138, 0x1800ad508\nlea     r8, [rsp+98h+var_68]                                           ; +0x13b, 0x1800ad50b\nmov     rcx, rsi                                                       ; +0x140, 0x1800ad510\ncall    qword ptr [rbx+370h]                                           ; +0x143, 0x1800ad513\nmov     rax, [rsi]                                                     ; +0x149, 0x1800ad519\nmov     rdx, rdi                                                       ; +0x14c, 0x1800ad51c\nmov     rcx, rsi                                                       ; +0x14f, 0x1800ad51f\ncall    qword ptr [rax+3B8h]                                           ; +0x152, 0x1800ad522\nmov     rbx, [rsi]                                                     ; +0x158, 0x1800ad528\nmov     r8, r14                                                        ; +0x15b, 0x1800ad52b\nlea     rdx, [rsp+98h+Key]                                             ; +0x15e, 0x1800ad52e\nmov     rcx, rdi                                                       ; +0x166, 0x1800ad536\ncall    ?positionAt@CCTMXLayer@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCTMXLayer::positionAt(cocos2d::CCPoint const &) ; +0x169, 0x1800ad539\nmov     rdx, rax                                                       ; +0x16e, 0x1800ad53e\nmov     rcx, rsi                                                       ; +0x171, 0x1800ad541\ncall    qword ptr [rbx+0B8h]                                           ; +0x174, 0x1800ad544\nmov     rbx, [rsi]                                                     ; +0x17a, 0x1800ad54a\nmov     rdx, r14; struct cocos2d::CCPoint *                            ; +0x17d, 0x1800ad54d\nmov     rcx, rdi; this                                                 ; +0x180, 0x1800ad550\ncall    ?vertexZForPos@CCTMXLayer@cocos2d@@AEAAHAEBVCCPoint@2@@Z; cocos2d::CCTMXLayer::vertexZForPos(cocos2d::CCPoint const &) ; +0x183, 0x1800ad553\nmovd    xmm1, eax                                                      ; +0x188, 0x1800ad558\ncvtdq2ps xmm1, xmm1                                                    ; +0x18c, 0x1800ad55c\nmov     rcx, rsi                                                       ; +0x18f, 0x1800ad55f\ncall    qword ptr [rbx+68h]                                            ; +0x192, 0x1800ad562\nmov     rax, [rsi]                                                     ; +0x195, 0x1800ad565\nlea     rdx, unk_1801A9AC8                                             ; +0x198, 0x1800ad568\nmov     rcx, rsi                                                       ; +0x19f, 0x1800ad56f\ncall    qword ptr [rax+110h]                                           ; +0x1a2, 0x1800ad572\nlea     rcx, [rsi+140h]                                                ; +0x1a8, 0x1800ad578\nmov     rax, [rcx]                                                     ; +0x1af, 0x1800ad57f\nmovzx   edx, byte ptr [rdi+1B8h]                                       ; +0x1b2, 0x1800ad582\ncall    qword ptr [rax+28h]                                            ; +0x1b9, 0x1800ad589\nmov     dword ptr [rsp+98h+Key], ebp                                   ; +0x1bc, 0x1800ad58c\nmov     rdx, [rdi+1D8h]                                                ; +0x1c3, 0x1800ad593\nmov     r8d, [rdx]; NumOfElements                                      ; +0x1ca, 0x1800ad59a\nlea     rax, CompareFunction                                           ; +0x1cd, 0x1800ad59d\nmov     [rsp+98h+CompareFunction], rax; CompareFunction                ; +0x1d4, 0x1800ad5a4\nmov     r9d, 8; SizeOfElements                                         ; +0x1d9, 0x1800ad5a9\nmov     rdx, [rdx+10h]; Base                                           ; +0x1df, 0x1800ad5af\nlea     rcx, [rsp+98h+Key]; Key                                        ; +0x1e3, 0x1800ad5b3\ncall    cs:bsearch                                                     ; +0x1eb, 0x1800ad5bb\nmov     rcx, [rdi+1D8h]                                                ; +0x1f1, 0x1800ad5c1\nsub     rax, [rcx+10h]                                                 ; +0x1f8, 0x1800ad5c8\nshr     rax, 3                                                         ; +0x1fc, 0x1800ad5cc\nmov     r9d, ebp; int                                                  ; +0x200, 0x1800ad5d0\nmov     r8d, eax; unsigned int                                         ; +0x203, 0x1800ad5d3\nmov     rdx, rsi; struct cocos2d::CCSprite *                           ; +0x206, 0x1800ad5d6\nmov     rcx, rdi; this                                                 ; +0x209, 0x1800ad5d9\ncall    ?addSpriteWithoutQuad@CCSpriteBatchNode@cocos2d@@IEAAPEAV12@PEAVCCSprite@2@IH@Z; cocos2d::CCSpriteBatchNode::addSpriteWithoutQuad(cocos2d::CCSprite *,uint,int) ; +0x20c, 0x1800ad5dc\nmov     rcx, rsi; this                                                 ; +0x211, 0x1800ad5e1\ncall    ?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0x214, 0x1800ad5e4\nmov     rax, rsi                                                       ; +0x219, 0x1800ad5e9\nlea     r11, [rsp+98h+var_18]                                          ; +0x21c, 0x1800ad5ec\nmov     rbx, [r11+28h]                                                 ; +0x224, 0x1800ad5f4\nmov     rbp, [r11+30h]                                                 ; +0x228, 0x1800ad5f8\nmovaps  xmm6, [rsp+98h+var_28]                                         ; +0x22c, 0x1800ad5fc\nmovaps  xmm7, [rsp+98h+var_38]                                         ; +0x231, 0x1800ad601\nmovaps  xmm8, xmmword ptr [r11-30h]                                    ; +0x236, 0x1800ad606\nmov     rsp, r11                                                       ; +0x23b, 0x1800ad60b\npop     r14                                                            ; +0x23e, 0x1800ad60e\npop     rdi                                                            ; +0x240, 0x1800ad610\npop     rsi                                                            ; +0x241, 0x1800ad611\nretn                                                                   ; +0x242, 0x1800ad612", "xrefs": ["<???> @ 0x1801438a8", "<???> @ 0x1801b8280"], "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"}