{"type": "func", "start": 6443159040, "end": 6443159546, "name": "cocos2d::CCTMXLayer::setTileGID", "pseudocode": "// \n// cocos2d::CCTMXLayer::setTileGID from 0x1800ace00 to 0x1800acffa (506 bytes)\n// \n// 5 xrefs:\n// > cocos2d::CCTMXLayer::setTileGID @ 0x1800acdf3\n// > <???> @ 0x18014050c\n// > <???> @ 0x180140570\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b81e4\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 cocos2d::CCTMXLayer::setTileGID(__int64 a1, int a2, struct cocos2d::CCPoint *a3, int a4)\n{\n  float v7; // xmm0_4\n  int v8; // ecx\n  unsigned int v9; // eax\n  int v10; // ecx\n  unsigned int v11; // edi\n  unsigned int v12; // r12d\n  cocos2d::CCSprite *v13; // r14\n  cocos2d::CCDirector *v14; // rax\n  float ContentScaleFactor; // xmm0_4\n  float v16; // xmm8_4\n  cocos2d::CCDirector *v17; // rax\n  float v18; // xmm0_4\n  float v19; // xmm7_4\n  cocos2d::CCDirector *v20; // rax\n  float v21; // xmm0_4\n  float v22; // xmm6_4\n  cocos2d::CCDirector *v23; // rax\n  float v24; // xmm0_4\n  cocos2d::CCRect *v25; // rax\n  _DWORD *v26; // rax\n  _DWORD *v27; // rax\n  float v28[2]; // [rsp+30h] [rbp-78h] BYREF\n  float v29[2]; // [rsp+38h] [rbp-70h] BYREF\n  cocos2d::CCRect v30; // [rsp+40h] [rbp-68h] BYREF\n  int v31; // [rsp+B0h] [rbp+8h] BYREF\n\n  v7 = (float)(*(float *)(a1 + 360) * a3->y) + a3->x;\n  v8 = *(_DWORD *)(*(_QWORD *)(a1 + 376) + 4LL * (int)v7);\n  v9 = v8 & 0xE0000000;\n  v10 = v8 & 0x1FFFFFFF;\n  if ( v10 != a2 || v9 != a4 )\n  {\n    v11 = a4 | a2;\n    if ( a2 )\n    {\n      if ( v10 )\n      {\n        v12 = (int)v7;\n        v13 = (cocos2d::CCSprite *)(*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 456LL))(\n                                     a1,\n                                     (unsigned int)(int)v7);\n        if ( v13 )\n        {\n          cocos2d::CCTMXTilesetInfo::rectForGID(*(struct cocos2d::CCRect **)(a1 + 384), (unsigned int)v28);\n          v14 = cocos2d::CCDirector::sharedDirector();\n          ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v14);\n          v16 = v29[1] / ContentScaleFactor;\n          v17 = cocos2d::CCDirector::sharedDirector();\n          v18 = cocos2d::CCDirector::getContentScaleFactor(v17);\n          v19 = v29[0] / v18;\n          v20 = cocos2d::CCDirector::sharedDirector();\n          v21 = cocos2d::CCDirector::getContentScaleFactor(v20);\n          v22 = v28[1] / v21;\n          v23 = cocos2d::CCDirector::sharedDirector();\n          v24 = cocos2d::CCDirector::getContentScaleFactor(v23);\n          v25 = cocos2d::CCRect::CCRect(&v30, v28[0] / v24, v22, v19, v16);\n          cocos2d::CCRect::operator=(v28, (float *)&v25->origin);\n          ((void (__fastcall *)(cocos2d::CCSprite *, float *, _QWORD, float *))v13->setTextureRect)(v13, v28, 0, v29);\n          if ( a4 )\n          {\n            v26 = (_DWORD *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v13->getPosition_0)(v13);\n            v27 = cocos2d::cc_timeval::operator=(&v31, v26);\n            cocos2d::CCTMXLayer::setupTileSprite((cocos2d::CCTMXLayer *)a1, v13, (struct cocos2d::CCPoint)v27, v11);\n          }\n          *(_DWORD *)(*(_QWORD *)(a1 + 376) + 4LL * v12) = v11;\n        }\n        else\n        {\n          cocos2d::CCTMXLayer::updateTileForGID((cocos2d::CCTMXLayer *)a1, v11, a3);\n        }\n      }\n      else\n      {\n        cocos2d::CCTMXLayer::insertTileForGID((cocos2d::CCTMXLayer *)a1, v11, a3);\n      }\n    }\n    else\n    {\n      cocos2d::CCTMXLayer::removeTileAt((cocos2d::CCTMXLayer *)a1, a3);\n    }\n  }\n}", "assembly": "; \n; cocos2d::CCTMXLayer::setTileGID from 0x1800ace00 to 0x1800acffa (506 bytes)\n; \n; 5 xrefs:\n; > cocos2d::CCTMXLayer::setTileGID @ 0x1800acdf3\n; > <???> @ 0x18014050c\n; > <???> @ 0x180140570\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b81e4\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, 0x1800ace00\npush    rbp                                                            ; +0x2, 0x1800ace02\npush    rsi                                                            ; +0x3, 0x1800ace03\npush    r15                                                            ; +0x4, 0x1800ace04\nsub     rsp, 88h                                                       ; +0x6, 0x1800ace06\nmovss   xmm0, dword ptr [rcx+168h]                                     ; +0xd, 0x1800ace0d\nmov     rbx, rcx                                                       ; +0x15, 0x1800ace15\nmulss   xmm0, dword ptr [r8+4]                                         ; +0x18, 0x1800ace18\nmov     r15d, r9d                                                      ; +0x1e, 0x1800ace1e\nmov     rsi, r8                                                        ; +0x21, 0x1800ace21\nmov     ebp, edx                                                       ; +0x24, 0x1800ace24\naddss   xmm0, dword ptr [r8]                                           ; +0x26, 0x1800ace26\ncvttss2si eax, xmm0                                                    ; +0x2b, 0x1800ace2b\nmovsxd  r10, eax                                                       ; +0x2f, 0x1800ace2f\nmov     rax, [rcx+178h]                                                ; +0x32, 0x1800ace32\nmov     ecx, [rax+r10*4]                                               ; +0x39, 0x1800ace39\nmov     eax, ecx                                                       ; +0x3d, 0x1800ace3d\nand     eax, 0E0000000h                                                ; +0x3f, 0x1800ace3f\nand     ecx, 1FFFFFFFh                                                 ; +0x44, 0x1800ace44\ncmp     ecx, edx                                                       ; +0x4a, 0x1800ace4a\njnz     short loc_1800ACE57                                            ; +0x4c, 0x1800ace4c\ncmp     eax, r9d                                                       ; +0x4e, 0x1800ace4e\njz      loc_1800ACFED                                                  ; +0x51, 0x1800ace51\nmov     [rsp+0A8h+arg_8], rdi                                          ; +0x57, 0x1800ace57\nmov     edi, ebp                                                       ; +0x5f, 0x1800ace5f\nor      edi, r15d                                                      ; +0x61, 0x1800ace61\ntest    ebp, ebp                                                       ; +0x64, 0x1800ace64\njnz     short loc_1800ACE78                                            ; +0x66, 0x1800ace66\nmov     rdx, rsi; struct cocos2d::CCPoint *                            ; +0x68, 0x1800ace68\nmov     rcx, rbx; this                                                 ; +0x6b, 0x1800ace6b\ncall    ?removeTileAt@CCTMXLayer@cocos2d@@QEAAXAEBVCCPoint@2@@Z; cocos2d::CCTMXLayer::removeTileAt(cocos2d::CCPoint const &) ; +0x6e, 0x1800ace6e\njmp     loc_1800ACFE5                                                  ; +0x73, 0x1800ace73\ntest    ecx, ecx                                                       ; +0x78, 0x1800ace78\nmov     rcx, rbx; this                                                 ; +0x7a, 0x1800ace7a\njnz     short loc_1800ACE8B                                            ; +0x7d, 0x1800ace7d\nmov     edx, edi; unsigned int                                         ; +0x7f, 0x1800ace7f\ncall    ?insertTileForGID@CCTMXLayer@cocos2d@@AEAAPEAVCCSprite@2@IAEBVCCPoint@2@@Z; cocos2d::CCTMXLayer::insertTileForGID(uint,cocos2d::CCPoint const &) ; +0x81, 0x1800ace81\njmp     loc_1800ACFE5                                                  ; +0x86, 0x1800ace86\nmov     rax, [rbx]                                                     ; +0x8b, 0x1800ace8b\nmov     [rsp+0A8h+arg_10], r12                                         ; +0x8e, 0x1800ace8e\ncvttss2si r12, xmm0                                                    ; +0x96, 0x1800ace96\nmov     [rsp+0A8h+var_28], r14                                         ; +0x9b, 0x1800ace9b\nmov     edx, r12d                                                      ; +0xa3, 0x1800acea3\ncall    qword ptr [rax+1C8h]                                           ; +0xa6, 0x1800acea6\nmov     r14, rax                                                       ; +0xac, 0x1800aceac\ntest    rax, rax                                                       ; +0xaf, 0x1800aceaf\njz      loc_1800ACFC8                                                  ; +0xb2, 0x1800aceb2\nmov     rcx, [rbx+180h]                                                ; +0xb8, 0x1800aceb8\nlea     rdx, [rsp+0A8h+var_78]                                         ; +0xbf, 0x1800acebf\nmovaps  [rsp+0A8h+var_38], xmm6                                        ; +0xc4, 0x1800acec4\nmov     r8d, ebp                                                       ; +0xc9, 0x1800acec9\nmovaps  [rsp+0A8h+var_48], xmm7                                        ; +0xcc, 0x1800acecc\nmovaps  [rsp+0A8h+var_58], xmm8                                        ; +0xd1, 0x1800aced1\ncall    ?rectForGID@CCTMXTilesetInfo@cocos2d@@QEAA?AVCCRect@2@I@Z; cocos2d::CCTMXTilesetInfo::rectForGID(uint) ; +0xd7, 0x1800aced7\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0xdc, 0x1800acedc\nmov     rcx, rax; this                                                 ; +0xe1, 0x1800acee1\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0xe4, 0x1800acee4\nmovss   xmm8, [rsp+0A8h+var_6C]                                        ; +0xe9, 0x1800acee9\ndivss   xmm8, xmm0                                                     ; +0xf0, 0x1800acef0\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0xf5, 0x1800acef5\nmov     rcx, rax; this                                                 ; +0xfa, 0x1800acefa\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0xfd, 0x1800acefd\nmovss   xmm7, [rsp+0A8h+var_70]                                        ; +0x102, 0x1800acf02\ndivss   xmm7, xmm0                                                     ; +0x108, 0x1800acf08\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x10c, 0x1800acf0c\nmov     rcx, rax; this                                                 ; +0x111, 0x1800acf11\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x114, 0x1800acf14\nmovss   xmm6, [rsp+0A8h+var_74]                                        ; +0x119, 0x1800acf19\ndivss   xmm6, xmm0                                                     ; +0x11f, 0x1800acf1f\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x123, 0x1800acf23\nmov     rcx, rax; this                                                 ; +0x128, 0x1800acf28\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x12b, 0x1800acf2b\nlea     rcx, [rsp+0A8h+var_68]; this                                   ; +0x130, 0x1800acf30\nmovss   xmm1, [rsp+0A8h+var_78]                                        ; +0x135, 0x1800acf35\nmovaps  xmm3, xmm7; float                                              ; +0x13b, 0x1800acf3b\ndivss   xmm1, xmm0; float                                              ; +0x13e, 0x1800acf3e\nmovaps  xmm2, xmm6; float                                              ; +0x142, 0x1800acf42\nmovss   [rsp+0A8h+var_88], xmm8; float                                 ; +0x145, 0x1800acf45\ncall    ??0CCRect@cocos2d@@QEAA@MMMM@Z; cocos2d::CCRect::CCRect(float,float,float,float) ; +0x14c, 0x1800acf4c\nmov     rdx, rax                                                       ; +0x151, 0x1800acf51\nlea     rcx, [rsp+0A8h+var_78]                                         ; +0x154, 0x1800acf54\ncall    ??4CCRect@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCRect::operator=(cocos2d::CCRect const &) ; +0x159, 0x1800acf59\nmov     rax, [r14]                                                     ; +0x15e, 0x1800acf5e\nlea     r9, [rsp+0A8h+var_70]                                          ; +0x161, 0x1800acf61\nxor     r8d, r8d                                                       ; +0x166, 0x1800acf66\nlea     rdx, [rsp+0A8h+var_78]                                         ; +0x169, 0x1800acf69\nmov     rcx, r14                                                       ; +0x16e, 0x1800acf6e\ncall    qword ptr [rax+3C8h]                                           ; +0x171, 0x1800acf71\nmovaps  xmm8, [rsp+0A8h+var_58]                                        ; +0x177, 0x1800acf77\nmovaps  xmm7, [rsp+0A8h+var_48]                                        ; +0x17d, 0x1800acf7d\nmovaps  xmm6, [rsp+0A8h+var_38]                                        ; +0x182, 0x1800acf82\ntest    r15d, r15d                                                     ; +0x187, 0x1800acf87\njz      short loc_1800ACFB9                                            ; +0x18a, 0x1800acf8a\nmov     rax, [r14]                                                     ; +0x18c, 0x1800acf8c\nmov     rcx, r14                                                       ; +0x18f, 0x1800acf8f\ncall    qword ptr [rax+0C8h]                                           ; +0x192, 0x1800acf92\nmov     rdx, rax                                                       ; +0x198, 0x1800acf98\nlea     rcx, [rsp+0A8h+arg_0]                                          ; +0x19b, 0x1800acf9b\ncall    ??4cc_timeval@cocos2d@@QEAAAEAU01@$$QEAU01@@Z; cocos2d::cc_timeval::operator=(cocos2d::cc_timeval &&) ; +0x1a3, 0x1800acfa3\nmov     r8, rax                                                        ; +0x1a8, 0x1800acfa8\nmov     r9d, edi                                                       ; +0x1ab, 0x1800acfab\nmov     rdx, r14                                                       ; +0x1ae, 0x1800acfae\nmov     rcx, rbx                                                       ; +0x1b1, 0x1800acfb1\ncall    ?setupTileSprite@CCTMXLayer@cocos2d@@AEAAXPEAVCCSprite@2@VCCPoint@2@I@Z; cocos2d::CCTMXLayer::setupTileSprite(cocos2d::CCSprite *,cocos2d::CCPoint,uint) ; +0x1b4, 0x1800acfb4\nmov     rax, [rbx+178h]                                                ; +0x1b9, 0x1800acfb9\nmov     ecx, r12d                                                      ; +0x1c0, 0x1800acfc0\nmov     [rax+rcx*4], edi                                               ; +0x1c3, 0x1800acfc3\njmp     short loc_1800ACFD5                                            ; +0x1c6, 0x1800acfc6\nmov     r8, rsi; struct cocos2d::CCPoint *                             ; +0x1c8, 0x1800acfc8\nmov     edx, edi; unsigned int                                         ; +0x1cb, 0x1800acfcb\nmov     rcx, rbx; this                                                 ; +0x1cd, 0x1800acfcd\ncall    ?updateTileForGID@CCTMXLayer@cocos2d@@AEAAPEAVCCSprite@2@IAEBVCCPoint@2@@Z; cocos2d::CCTMXLayer::updateTileForGID(uint,cocos2d::CCPoint const &) ; +0x1d0, 0x1800acfd0\nmov     r12, [rsp+0A8h+arg_10]                                         ; +0x1d5, 0x1800acfd5\nmov     r14, [rsp+0A8h+var_28]                                         ; +0x1dd, 0x1800acfdd\nmov     rdi, [rsp+0A8h+arg_8]                                          ; +0x1e5, 0x1800acfe5\nadd     rsp, 88h                                                       ; +0x1ed, 0x1800acfed\npop     r15                                                            ; +0x1f4, 0x1800acff4\npop     rsi                                                            ; +0x1f6, 0x1800acff6\npop     rbp                                                            ; +0x1f7, 0x1800acff7\npop     rbx                                                            ; +0x1f8, 0x1800acff8\nretn                                                                   ; +0x1f9, 0x1800acff9", "xrefs": ["cocos2d::CCTMXLayer::setTileGID @ 0x1800acdf3", "<???> @ 0x18014050c", "<???> @ 0x180140570", "<???> @ 0x1801438a8", "<???> @ 0x1801b81e4"], "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"}