{"type": "func", "start": 5369068400, "end": 5369069132, "name": "CCTextInputNode::onTextFieldAttachWithIME", "pseudocode": "// \n// CCTextInputNode::onTextFieldAttachWithIME from 0x140057b70 to 0x140057e4c (732 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x14070d4f0\n// > <???> @ 0x14091040c\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:25:41 +0000\n// \n\n// Hidden C++ exception states: #wind=1\nchar __fastcall CCTextInputNode::onTextFieldAttachWithIME(__int64 a1, __int64 a2)\n{\n  _QWORD *v3; // rdi\n  __int64 v4; // rcx\n  const char *v5; // rax\n  _BYTE *v6; // rax\n  size_t v7; // r8\n  void **v8; // rcx\n  char *v9; // rsi\n  unsigned __int64 v10; // r15\n  size_t v11; // r8\n  int v12; // r14d\n  char *v13; // rax\n  __int64 v14; // rcx\n  __int64 v15; // rcx\n  __int64 v16; // rcx\n  __int64 v17; // rax\n  const struct cocos2d::CCPoint *v18; // rax\n  float *v19; // rax\n  __int64 v20; // rcx\n  char v22[4]; // [rsp+38h] [rbp-39h] BYREF\n  __int128 Buf2; // [rsp+40h] [rbp-31h] BYREF\n  __int64 v24; // [rsp+50h] [rbp-21h]\n  __int64 v25; // [rsp+58h] [rbp-19h]\n  char v26[8]; // [rsp+60h] [rbp-11h] BYREF\n  void *Buf1[2]; // [rsp+68h] [rbp-9h] BYREF\n  __int64 v28; // [rsp+78h] [rbp+7h]\n  unsigned __int64 v29; // [rsp+80h] [rbp+Fh]\n\n  v3 = (_QWORD *)(a1 - 416);\n  v4 = *(_QWORD *)(a1 - 416 + 584);\n  if ( v4 )\n  {\n    LOBYTE(a2) = 1;\n    (*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v4 + 336LL))(v4, a2);\n  }\n  *(_BYTE *)(a1 + 52) = 1;\n  qword_140909788 = (__int64)v3;\n  *(_BYTE *)(a1 + 276) = 0;\n  LOBYTE(v4) = 1;\n  sub_14008B9D0(v4);\n  if ( *(_BYTE *)(a1 + 8) )\n  {\n    v5 = (const char *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(*(_QWORD *)(a1 + 176) + 600LL) + 8LL))(*(_QWORD *)(a1 + 176) + 600LL);\n    if ( atof(v5) == 0.0 )\n    {\n      *(_OWORD *)Buf1 = 0;\n      v28 = 0;\n      v29 = 15;\n      LOBYTE(Buf1[0]) = 0;\n      CCTextInputNode::setString(v3, Buf1);\n    }\n  }\n  Buf2 = 0;\n  v24 = 0;\n  v25 = 15;\n  LOBYTE(Buf2) = 0;\n  v6 = (_BYTE *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(*(_QWORD *)(a1 + 176) + 600LL) + 8LL))(*(_QWORD *)(a1 + 176) + 600LL);\n  *(_OWORD *)Buf1 = 0;\n  v28 = 0;\n  v29 = 0;\n  v7 = -1;\n  do\n    ++v7;\n  while ( v6[v7] );\n  sub_14003D230(Buf1, v6, v7);\n  v8 = Buf1;\n  v9 = (char *)Buf1[0];\n  v10 = v29;\n  if ( v29 > 0xF )\n    v8 = (void **)Buf1[0];\n  v11 = v28;\n  if ( v28 )\n    v11 = 0;\n  v12 = memcmp(v8, &Buf2, v11);\n  if ( !v12 )\n    v12 = v28 != 0;\n  if ( v10 > 0xF )\n  {\n    v13 = v9;\n    if ( v10 + 1 >= 0x1000 )\n    {\n      v9 = *((char **)v9 - 1);\n      if ( (unsigned __int64)(v13 - v9 - 8) > 0x1F )\n        invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n    }\n    j_j_free(v9);\n  }\n  if ( !v12 )\n  {\n    v14 = *(_QWORD *)(a1 + 200);\n    if ( v14 )\n    {\n      (**(void (__fastcall ***)(__int64, const char *))(v14 + 360))(v14 + 360, \" \");\n    }\n    else\n    {\n      v15 = *(_QWORD *)(a1 + 216);\n      if ( v15 )\n      {\n        *(_OWORD *)Buf1 = 0;\n        v28 = 1;\n        v29 = 15;\n        LOWORD(Buf1[0]) = 32;\n        TextArea::setString(v15, Buf1);\n      }\n    }\n    CCTextInputNode::updateBlinkLabelToChar((__int64)v3, *(_DWORD *)(v3[74] + 760LL));\n  }\n  v16 = *(_QWORD *)(a1 + 184);\n  if ( v16 )\n    (*(void (__fastcall **)(__int64, _QWORD *))(*(_QWORD *)v16 + 8LL))(v16, v3);\n  if ( *(_BYTE *)(a1 + 210) )\n  {\n    v17 = cocos2d::CCDirector::sharedDirector();\n    cocos2d::CCDirector::getWinSize(v17, v22);\n    v18 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 176) + 296LL))(*(_QWORD *)(a1 + 176));\n    v19 = (float *)cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v26, v18);\n    sub_140054180((cocos2d::CCRect *)Buf1, (__int64)v3, v19);\n    *((float *)Buf1 + 1) = *((float *)Buf1 + 1) + -4.0;\n    cocos2d::CCRect::getMinY((cocos2d::CCRect *)Buf1);\n    v20 = *(_QWORD *)(a1 + 184);\n    if ( v20 )\n      (*(void (__fastcall **)(__int64, _QWORD *))(*(_QWORD *)v20 + 24LL))(v20, v3);\n  }\n  return 0;\n}", "assembly": "; \n; CCTextInputNode::onTextFieldAttachWithIME from 0x140057b70 to 0x140057e4c (732 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x14070d4f0\n; > <???> @ 0x14091040c\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:25:41 +0000\n; \nmov     rax, rsp                                                       ; +0x0, 0x140057b70\nmov     [rax+10h], rbx                                                 ; +0x3, 0x140057b73\nmov     [rax+18h], rsi                                                 ; +0x7, 0x140057b77\npush    rbp                                                            ; +0xb, 0x140057b7b\npush    rdi                                                            ; +0xc, 0x140057b7c\npush    r13                                                            ; +0xd, 0x140057b7d\npush    r14                                                            ; +0xf, 0x140057b7f\npush    r15                                                            ; +0x11, 0x140057b81\nlea     rbp, [rax-5Fh]                                                 ; +0x13, 0x140057b83\nsub     rsp, 0A0h                                                      ; +0x17, 0x140057b87\nmovaps  xmmword ptr [rax-38h], xmm6                                    ; +0x1e, 0x140057b8e\nmov     rax, cs:__security_cookie                                      ; +0x22, 0x140057b92\nxor     rax, rsp                                                       ; +0x29, 0x140057b99\nmov     [rbp+57h+var_40], rax                                          ; +0x2c, 0x140057b9c\nmov     rbx, rcx                                                       ; +0x30, 0x140057ba0\nlea     rdi, [rcx-1A0h]                                                ; +0x33, 0x140057ba3\nmov     rcx, [rdi+248h]                                                ; +0x3a, 0x140057baa\ntest    rcx, rcx                                                       ; +0x41, 0x140057bb1\njz      short loc_140057BC1                                            ; +0x44, 0x140057bb4\nmov     rax, [rcx]                                                     ; +0x46, 0x140057bb6\nmov     dl, 1                                                          ; +0x49, 0x140057bb9\ncall    qword ptr [rax+150h]                                           ; +0x4b, 0x140057bbb\nmov     byte ptr [rbx+34h], 1                                          ; +0x51, 0x140057bc1\nmov     cs:qword_140909788, rdi                                        ; +0x55, 0x140057bc5\nmov     byte ptr [rbx+114h], 0                                         ; +0x5c, 0x140057bcc\nmov     cl, 1                                                          ; +0x63, 0x140057bd3\ncall    sub_14008B9D0                                                  ; +0x65, 0x140057bd5\nxor     r13d, r13d                                                     ; +0x6a, 0x140057bda\ncmp     [rbx+8], r13b                                                  ; +0x6d, 0x140057bdd\njz      short loc_140057C2E                                            ; +0x71, 0x140057be1\nmov     rcx, [rbx+0B0h]                                                ; +0x73, 0x140057be3\nadd     rcx, 258h                                                      ; +0x7a, 0x140057bea\nmov     rax, [rcx]                                                     ; +0x81, 0x140057bf1\ncall    qword ptr [rax+8]                                              ; +0x84, 0x140057bf4\nmov     rcx, rax; String                                               ; +0x87, 0x140057bf7\ncall    cs:atof                                                        ; +0x8a, 0x140057bfa\nxorps   xmm1, xmm1                                                     ; +0x90, 0x140057c00\nucomisd xmm0, xmm1                                                     ; +0x93, 0x140057c03\njp      short loc_140057C2E                                            ; +0x97, 0x140057c07\njnz     short loc_140057C2E                                            ; +0x99, 0x140057c09\nxorps   xmm0, xmm0                                                     ; +0x9b, 0x140057c0b\nmovups  xmmword ptr [rbp+57h+Buf1], xmm0                               ; +0x9e, 0x140057c0e\nmov     [rbp+57h+var_50], r13                                          ; +0xa2, 0x140057c12\nmov     [rbp+57h+var_48], 0Fh                                          ; +0xa6, 0x140057c16\nmov     byte ptr [rbp+57h+Buf1], r13b                                  ; +0xae, 0x140057c1e\nlea     rdx, [rbp+57h+Buf1]                                            ; +0xb2, 0x140057c22\nmov     rcx, rdi                                                       ; +0xb6, 0x140057c26\ncall    CCTextInputNode__setString                                     ; +0xb9, 0x140057c29\nxorps   xmm0, xmm0                                                     ; +0xbe, 0x140057c2e\nmovups  [rbp+57h+Buf2], xmm0                                           ; +0xc1, 0x140057c31\nmov     [rbp+57h+var_78], r13                                          ; +0xc5, 0x140057c35\nmov     [rbp+57h+var_70], 0Fh                                          ; +0xc9, 0x140057c39\nmov     byte ptr [rbp+57h+Buf2], r13b                                  ; +0xd1, 0x140057c41\nmov     rcx, [rbx+0B0h]                                                ; +0xd5, 0x140057c45\nadd     rcx, 258h                                                      ; +0xdc, 0x140057c4c\nmov     rax, [rcx]                                                     ; +0xe3, 0x140057c53\ncall    qword ptr [rax+8]                                              ; +0xe6, 0x140057c56\nxorps   xmm0, xmm0                                                     ; +0xe9, 0x140057c59\nmovups  xmmword ptr [rbp+57h+Buf1], xmm0                               ; +0xec, 0x140057c5c\nmov     [rbp+57h+var_50], r13                                          ; +0xf0, 0x140057c60\nmov     [rbp+57h+var_48], r13                                          ; +0xf4, 0x140057c64\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0xf8, 0x140057c68\nnop                                                                    ; +0xff, 0x140057c6f\ninc     r8                                                             ; +0x100, 0x140057c70\ncmp     byte ptr [rax+r8], 0                                           ; +0x103, 0x140057c73\njnz     short loc_140057C70                                            ; +0x108, 0x140057c78\nmov     rdx, rax                                                       ; +0x10a, 0x140057c7a\nlea     rcx, [rbp+57h+Buf1]                                            ; +0x10d, 0x140057c7d\ncall    sub_14003D230                                                  ; +0x111, 0x140057c81\nlea     rcx, [rbp+57h+Buf1]                                            ; +0x116, 0x140057c86\nmov     rsi, [rbp+57h+Buf1]                                            ; +0x11a, 0x140057c8a\nmov     r15, [rbp+57h+var_48]                                          ; +0x11e, 0x140057c8e\ncmp     r15, 0Fh                                                       ; +0x122, 0x140057c92\ncmova   rcx, rsi; Buf1                                                 ; +0x126, 0x140057c96\nmov     r8, [rbp+57h+var_50]                                           ; +0x12a, 0x140057c9a\ntest    r8, r8                                                         ; +0x12e, 0x140057c9e\ncmova   r8, r13; Size                                                  ; +0x131, 0x140057ca1\nlea     rdx, [rbp+57h+Buf2]; Buf2                                      ; +0x135, 0x140057ca5\ncall    memcmp                                                         ; +0x139, 0x140057ca9\nmov     r14d, eax                                                      ; +0x13e, 0x140057cae\ntest    eax, eax                                                       ; +0x141, 0x140057cb1\njnz     short loc_140057CC0                                            ; +0x143, 0x140057cb3\nmov     r14d, r13d                                                     ; +0x145, 0x140057cb5\ncmp     [rbp+57h+var_50], r14                                          ; +0x148, 0x140057cb8\nsetnbe  r14b                                                           ; +0x14c, 0x140057cbc\ncmp     r15, 0Fh                                                       ; +0x150, 0x140057cc0\njbe     short loc_140057D0A                                            ; +0x154, 0x140057cc4\nlea     rdx, [r15+1]                                                   ; +0x156, 0x140057cc6\nmov     rax, rsi                                                       ; +0x15a, 0x140057cca\ncmp     rdx, 1000h                                                     ; +0x15d, 0x140057ccd\njb      short loc_140057D01                                            ; +0x164, 0x140057cd4\nadd     rdx, 27h ; '''                                                 ; +0x166, 0x140057cd6\nmov     rsi, [rsi-8]                                                   ; +0x16a, 0x140057cda\nsub     rax, rsi                                                       ; +0x16e, 0x140057cde\nsub     rax, 8                                                         ; +0x171, 0x140057ce1\ncmp     rax, 1Fh                                                       ; +0x175, 0x140057ce5\njbe     short loc_140057D01                                            ; +0x179, 0x140057ce9\nmov     [rsp+0C0h+Reserved], r13; Reserved                             ; +0x17b, 0x140057ceb\nxor     r9d, r9d; LineNo                                               ; +0x180, 0x140057cf0\nxor     r8d, r8d; FileName                                             ; +0x183, 0x140057cf3\nxor     edx, edx; FunctionName                                         ; +0x186, 0x140057cf6\nxor     ecx, ecx; Expression                                           ; +0x188, 0x140057cf8\ncall    cs:_invoke_watson                                              ; +0x18a, 0x140057cfa\ndb 0CCh                                                                ; +0x190, 0x140057d00\nmov     rcx, rsi; Block                                                ; +0x191, 0x140057d01\ncall    j_j_free                                                       ; +0x194, 0x140057d04\nnop                                                                    ; +0x199, 0x140057d09\ntest    r14d, r14d                                                     ; +0x19a, 0x140057d0a\njnz     short loc_140057D77                                            ; +0x19d, 0x140057d0d\nmov     rcx, [rbx+0C8h]                                                ; +0x19f, 0x140057d0f\ntest    rcx, rcx                                                       ; +0x1a6, 0x140057d16\njz      short loc_140057D30                                            ; +0x1a9, 0x140057d19\nadd     rcx, 168h                                                      ; +0x1ab, 0x140057d1b\nmov     rax, [rcx]                                                     ; +0x1b2, 0x140057d22\nlea     rdx, asc_1406ED6E4; \" \"                                        ; +0x1b5, 0x140057d25\ncall    qword ptr [rax]                                                ; +0x1bc, 0x140057d2c\njmp     short loc_140057D62                                            ; +0x1be, 0x140057d2e\nmov     rcx, [rbx+0D8h]                                                ; +0x1c0, 0x140057d30\ntest    rcx, rcx                                                       ; +0x1c7, 0x140057d37\njz      short loc_140057D62                                            ; +0x1ca, 0x140057d3a\nxorps   xmm0, xmm0                                                     ; +0x1cc, 0x140057d3c\nmovups  xmmword ptr [rbp+57h+Buf1], xmm0                               ; +0x1cf, 0x140057d3f\nmov     [rbp+57h+var_50], 1                                            ; +0x1d3, 0x140057d43\nmov     [rbp+57h+var_48], 0Fh                                          ; +0x1db, 0x140057d4b\nmov     word ptr [rbp+57h+Buf1], 20h ; ' '                             ; +0x1e3, 0x140057d53\nlea     rdx, [rbp+57h+Buf1]                                            ; +0x1e9, 0x140057d59\ncall    TextArea__setString                                            ; +0x1ed, 0x140057d5d\nmov     rdx, [rdi+250h]                                                ; +0x1f2, 0x140057d62\nmov     edx, [rdx+2F8h]                                                ; +0x1f9, 0x140057d69\nmov     rcx, rdi                                                       ; +0x1ff, 0x140057d6f\ncall    CCTextInputNode__updateBlinkLabelToChar                        ; +0x202, 0x140057d72\nmov     rcx, [rbx+0B8h]                                                ; +0x207, 0x140057d77\ntest    rcx, rcx                                                       ; +0x20e, 0x140057d7e\njz      short loc_140057D8C                                            ; +0x211, 0x140057d81\nmov     rax, [rcx]                                                     ; +0x213, 0x140057d83\nmov     rdx, rdi                                                       ; +0x216, 0x140057d86\ncall    qword ptr [rax+8]                                              ; +0x219, 0x140057d89\ncmp     byte ptr [rbx+0D2h], 0                                         ; +0x21c, 0x140057d8c\njz      loc_140057E1D                                                  ; +0x223, 0x140057d93\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x229, 0x140057d99\nmov     rcx, rax                                                       ; +0x22f, 0x140057d9f\nlea     rdx, [rbp+57h+var_90]                                          ; +0x232, 0x140057da2\ncall    cs:?getWinSize@CCDirector@cocos2d@@QEAA?AVCCSize@2@XZ; cocos2d::CCDirector::getWinSize(void) ; +0x236, 0x140057da6\nmov     rcx, [rbx+0B0h]                                                ; +0x23c, 0x140057dac\nmov     rax, [rcx]                                                     ; +0x243, 0x140057db3\ncall    qword ptr [rax+128h]                                           ; +0x246, 0x140057db6\nmov     rdx, rax                                                       ; +0x24c, 0x140057dbc\nlea     rcx, [rbp+57h+var_68]                                          ; +0x24f, 0x140057dbf\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x253, 0x140057dc3\nmov     r8, rax                                                        ; +0x259, 0x140057dc9\nmov     rdx, rdi                                                       ; +0x25c, 0x140057dcc\nlea     rcx, [rbp+57h+Buf1]                                            ; +0x25f, 0x140057dcf\ncall    sub_140054180                                                  ; +0x263, 0x140057dd3\nmovss   xmm0, dword ptr [rbp+57h+Buf1+4]                               ; +0x268, 0x140057dd8\naddss   xmm0, cs:dword_140835D50                                       ; +0x26d, 0x140057ddd\nmovss   dword ptr [rbp+57h+Buf1+4], xmm0                               ; +0x275, 0x140057de5\nmovss   xmm6, [rbp+57h+var_8C]                                         ; +0x27a, 0x140057dea\nmulss   xmm6, cs:dword_140834F20                                       ; +0x27f, 0x140057def\nlea     rcx, [rbp+57h+Buf1]                                            ; +0x287, 0x140057df7\ncall    cs:?getMinY@CCRect@cocos2d@@QEBAMXZ; cocos2d::CCRect::getMinY(void) ; +0x28b, 0x140057dfb\nsubss   xmm6, xmm0                                                     ; +0x291, 0x140057e01\nmov     rcx, [rbx+0B8h]                                                ; +0x295, 0x140057e05\ntest    rcx, rcx                                                       ; +0x29c, 0x140057e0c\njz      short loc_140057E1D                                            ; +0x29f, 0x140057e0f\nmov     rax, [rcx]                                                     ; +0x2a1, 0x140057e11\nmovaps  xmm2, xmm6                                                     ; +0x2a4, 0x140057e14\nmov     rdx, rdi                                                       ; +0x2a7, 0x140057e17\ncall    qword ptr [rax+18h]                                            ; +0x2aa, 0x140057e1a\nxor     al, al                                                         ; +0x2ad, 0x140057e1d\nmov     rcx, [rbp+57h+var_40]                                          ; +0x2af, 0x140057e1f\nxor     rcx, rsp; StackCookie                                          ; +0x2b3, 0x140057e23\ncall    __security_check_cookie                                        ; +0x2b6, 0x140057e26\nlea     r11, [rsp+0C0h+var_20]                                         ; +0x2bb, 0x140057e2b\nmov     rbx, [r11+38h]                                                 ; +0x2c3, 0x140057e33\nmov     rsi, [r11+40h]                                                 ; +0x2c7, 0x140057e37\nmovaps  xmm6, xmmword ptr [r11-10h]                                    ; +0x2cb, 0x140057e3b\nmov     rsp, r11                                                       ; +0x2d0, 0x140057e40\npop     r15                                                            ; +0x2d3, 0x140057e43\npop     r14                                                            ; +0x2d5, 0x140057e45\npop     r13                                                            ; +0x2d7, 0x140057e47\npop     rdi                                                            ; +0x2d9, 0x140057e49\npop     rbp                                                            ; +0x2da, 0x140057e4a\nretn                                                                   ; +0x2db, 0x140057e4b", "xrefs": ["<???> @ 0x14070d4f0", "<???> @ 0x14091040c"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}