{"type": "func", "start": 4077132, "end": 4077574, "name": "CCTextInputNode::onTextFieldAttachWithIME", "pseudocode": "// \n// CCTextInputNode::onTextFieldAttachWithIME from 0x3e364c to 0x3e3806 (442 bytes)\n// \n// 1 xrefs:\n// > `non-virtual thunk to'CCTextInputNode::onTextFieldAttachWithIME @ 0x3e3824\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:47:03 +0000\n// \n\nint __fastcall CCTextInputNode::onTextFieldAttachWithIME(CCTextInputNode *this, cocos2d::CCTextFieldTTF *a2)\n{\n  int v3; // r0\n  const char *v4; // r0\n  const char *v5; // r0\n  const char *v6; // r9\n  size_t v7; // r0\n  _BOOL4 v8; // r6\n  int v9; // r1\n  int v10; // r2\n  int v11; // r0\n  int v12; // r6\n  cocos2d::CCDirector *v13; // r0\n  const cocos2d::CCPoint *v14; // r0\n  float v15; // s16\n  float v16; // s15\n  int v17; // r0\n  _BYTE v19[4]; // [sp+4h] [bp-40h] BYREF\n  float v20; // [sp+8h] [bp-3Ch]\n  float v21[2]; // [sp+Ch] [bp-38h] BYREF\n  int v22[3]; // [sp+14h] [bp-30h] BYREF\n  int v23; // [sp+20h] [bp-24h] BYREF\n  int v24; // [sp+24h] [bp-20h]\n  int v25; // [sp+28h] [bp-1Ch]\n  _BYTE v26[4]; // [sp+2Ch] [bp-18h] BYREF\n  float v27; // [sp+30h] [bp-14h]\n\n  v3 = *((_DWORD *)this + 103);\n  if ( v3 )\n    (*(void (__fastcall **)(int, int))(*(_DWORD *)v3 + 172))(v3, 1);\n  *((_BYTE *)this + 344) = (unsigned __int8)&dword_0 + 1;\n  *((_BYTE *)this + 484) = 0;\n  CCTextInputNode::s_activeInput = (int)this;\n  PlatformToolbox::setKeyboardState((PlatformToolbox *)((char *)&dword_0 + 1), (bool)a2);\n  if ( *((_BYTE *)this + 324) )\n  {\n    v4 = (const char *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 104) + 624))(*((_DWORD *)this + 104));\n    if ( atof(v4) == 0.0 )\n    {\n      v23 = 0;\n      v24 = 0;\n      v25 = 0;\n      std::string::__init(&v23, &unk_B6B226, 0);\n      CCTextInputNode::setString((int)this, (int)&v23);\n      std::string::~string((int)&v23);\n    }\n  }\n  v5 = (const char *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 104) + 624))(*((_DWORD *)this + 104));\n  memset(v22, 0, sizeof(v22));\n  v6 = v5;\n  v7 = strlen(v5);\n  std::string::__init(v22, v6, v7);\n  v23 = 0;\n  v24 = 0;\n  v25 = 0;\n  std::string::__init(&v23, &unk_B6B226, 0);\n  v8 = sub_3DC1CE((unsigned __int8 *)v22, (unsigned __int8 *)&v23);\n  std::string::~string((int)&v23);\n  std::string::~string((int)v22);\n  if ( v8 )\n  {\n    v11 = *((_DWORD *)this + 107);\n    if ( v11 )\n    {\n      (*(void (__fastcall **)(int, const char *))(*(_DWORD *)v11 + 464))(v11, \" \");\n    }\n    else\n    {\n      v12 = *((_DWORD *)this + 109);\n      if ( v12 )\n      {\n        v23 = *((_DWORD *)this + 107);\n        v24 = 0;\n        v25 = 0;\n        std::string::__init(&v23, \" \", 1u);\n        TextArea::setString(v12, &v23);\n        std::string::~string((int)&v23);\n      }\n    }\n    CCTextInputNode::updateBlinkLabel(this, v9, v10);\n  }\n  v13 = *((cocos2d::CCDirector **)this + 105);\n  if ( v13 )\n    v13 = (cocos2d::CCDirector *)(*(int (__fastcall **)(cocos2d::CCDirector *, CCTextInputNode *))(*(_DWORD *)v13 + 4))(\n                                   v13,\n                                   this);\n  if ( *((_BYTE *)this + 434) )\n  {\n    cocos2d::CCDirector::sharedDirector(v13);\n    cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v19);\n    v14 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 104) + 152))(*((_DWORD *)this + 104));\n    cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v21, v14);\n    sub_3DC220((cocos2d::CCRect *)v26, this, v21);\n    v15 = v20;\n    v27 = v27 - 4.0;\n    v16 = COERCE_FLOAT(cocos2d::CCRect::getMinY((cocos2d::CCRect *)v26));\n    v17 = *((_DWORD *)this + 105);\n    if ( v17 )\n      (*(void (__fastcall **)(int, CCTextInputNode *, _DWORD))(*(_DWORD *)v17 + 12))(\n        v17,\n        this,\n        (float)(v15 * 0.5) - v16);\n  }\n  return 0;\n}", "assembly": "; \n; CCTextInputNode::onTextFieldAttachWithIME from 0x3e364c to 0x3e3806 (442 bytes)\n; \n; 1 xrefs:\n; > `non-virtual thunk to'CCTextInputNode::onTextFieldAttachWithIME @ 0x3e3824\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:47:03 +0000\n; \nPUSH.W          {R4-R9,LR}                                             ; +0x0, 0x3e364c\nMOV             R4, R0                                                 ; +0x4, 0x3e3650\nVPUSH           {D8}                                                   ; +0x6, 0x3e3652\nLDR             R3, =(__stack_chk_guard_ptr - 0x3E365C)                ; +0xa, 0x3e3656\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0xc, 0x3e3658\nLDR             R3, [R3]; __stack_chk_guard                            ; +0xe, 0x3e365a\nLDR.W           R0, [R0,#0x19C]                                        ; +0x10, 0x3e365c\nSUB             SP, SP, #0x44                                          ; +0x14, 0x3e3660\nLDR             R2, [R3]                                               ; +0x16, 0x3e3662\nMOV             R8, R3                                                 ; +0x18, 0x3e3664\nSTR             R2, [SP,#0x44+var_8]                                   ; +0x1a, 0x3e3666\nCBZ             R0, loc_3E3674                                         ; +0x1c, 0x3e3668\nLDR             R3, [R0]                                               ; +0x1e, 0x3e366a\nMOVS            R1, #1                                                 ; +0x20, 0x3e366c\nLDR.W           R3, [R3,#0xAC]                                         ; +0x22, 0x3e366e\nBLX             R3                                                     ; +0x26, 0x3e3672\nLDR             R3, =(_ZN15CCTextInputNode13s_activeInputE_ptr - 0x3E3682) ; +0x28, 0x3e3674\nMOVS            R0, #(dword_0+1); this                                 ; +0x2a, 0x3e3676\nMOVS            R6, #0                                                 ; +0x2c, 0x3e3678\nSTRB.W          R0, [R4,#0x158]                                        ; +0x2e, 0x3e367a\nADD             R3, PC; _ZN15CCTextInputNode13s_activeInputE_ptr       ; +0x32, 0x3e367e\nLDR             R3, [R3]; CCTextInputNode::s_activeInput ...           ; +0x34, 0x3e3680\nSTRB.W          R6, [R4,#0x1E4]                                        ; +0x36, 0x3e3682\nADD             R5, SP, #0x44+var_24                                   ; +0x3a, 0x3e3686\nSTR             R4, [R3]; CCTextInputNode::s_activeInput               ; +0x3c, 0x3e3688\nBL              _ZN15PlatformToolbox16setKeyboardStateEb; PlatformToolbox::setKeyboardState(bool) ; +0x3e, 0x3e368a\nLDRB.W          R3, [R4,#0x144]                                        ; +0x42, 0x3e368e\nCBZ             R3, loc_3E36D2                                         ; +0x46, 0x3e3692\nLDR.W           R0, [R4,#0x1A0]                                        ; +0x48, 0x3e3694\nLDR             R3, [R0]                                               ; +0x4c, 0x3e3698\nLDR.W           R3, [R3,#0x270]                                        ; +0x4e, 0x3e369a\nBLX             R3                                                     ; +0x52, 0x3e369e\nBLX             atof                                                   ; +0x54, 0x3e36a0\nVMOV            D7, R0, R1                                             ; +0x58, 0x3e36a4\nVCMP.F64        D7, #0.0                                               ; +0x5c, 0x3e36a8\nVMRS            APSR_nzcv, FPSCR                                       ; +0x60, 0x3e36ac\nBNE             loc_3E36D2                                             ; +0x64, 0x3e36b0\nLDR             R1, =(unk_B6B226 - 0x3E36BE)                           ; +0x66, 0x3e36b2\nMOV             R0, R5                                                 ; +0x68, 0x3e36b4\nMOV             R2, R6                                                 ; +0x6a, 0x3e36b6\nSTR             R6, [SP,#0x44+var_24]                                  ; +0x6c, 0x3e36b8\nADD             R1, PC; unk_B6B226                                     ; +0x6e, 0x3e36ba\nSTR             R6, [SP,#0x44+var_20]                                  ; +0x70, 0x3e36bc\nSTR             R6, [SP,#0x44+var_1C]                                  ; +0x72, 0x3e36be\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x74, 0x3e36c0\nMOV             R0, R4                                                 ; +0x78, 0x3e36c4\nMOV             R1, R5                                                 ; +0x7a, 0x3e36c6\nBL              _ZN15CCTextInputNode9setStringENSt6__ndk112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE; CCTextInputNode::setString(std::string) ; +0x7c, 0x3e36c8\nMOV             R0, R5                                                 ; +0x80, 0x3e36cc\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x82, 0x3e36ce\nLDR.W           R0, [R4,#0x1A0]                                        ; +0x86, 0x3e36d2\nMOVS            R6, #0                                                 ; +0x8a, 0x3e36d6\nADD             R7, SP, #0x44+var_30                                   ; +0x8c, 0x3e36d8\nLDR             R3, [R0]                                               ; +0x8e, 0x3e36da\nLDR.W           R3, [R3,#0x270]                                        ; +0x90, 0x3e36dc\nBLX             R3                                                     ; +0x94, 0x3e36e0\nSTR             R6, [SP,#0x44+var_30]                                  ; +0x96, 0x3e36e2\nSTR             R6, [SP,#0x44+var_2C]                                  ; +0x98, 0x3e36e4\nSTR             R6, [SP,#0x44+var_28]                                  ; +0x9a, 0x3e36e6\nMOV             R9, R0                                                 ; +0x9c, 0x3e36e8\nBLX             strlen                                                 ; +0x9e, 0x3e36ea\nMOV             R1, R9                                                 ; +0xa2, 0x3e36ee\nMOV             R2, R0                                                 ; +0xa4, 0x3e36f0\nMOV             R0, R7                                                 ; +0xa6, 0x3e36f2\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0xa8, 0x3e36f4\nLDR             R1, =(unk_B6B226 - 0x3E3702)                           ; +0xac, 0x3e36f8\nMOV             R0, R5                                                 ; +0xae, 0x3e36fa\nMOV             R2, R6                                                 ; +0xb0, 0x3e36fc\nADD             R1, PC; unk_B6B226                                     ; +0xb2, 0x3e36fe\nSTR             R6, [SP,#0x44+var_24]                                  ; +0xb4, 0x3e3700\nSTR             R6, [SP,#0x44+var_20]                                  ; +0xb6, 0x3e3702\nSTR             R6, [SP,#0x44+var_1C]                                  ; +0xb8, 0x3e3704\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0xba, 0x3e3706\nMOV             R1, R5                                                 ; +0xbe, 0x3e370a\nMOV             R0, R7                                                 ; +0xc0, 0x3e370c\nBL              sub_3DC1CE                                             ; +0xc2, 0x3e370e\nMOV             R6, R0                                                 ; +0xc6, 0x3e3712\nMOV             R0, R5                                                 ; +0xc8, 0x3e3714\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xca, 0x3e3716\nMOV             R0, R7                                                 ; +0xce, 0x3e371a\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xd0, 0x3e371c\nCBZ             R6, loc_3E3762                                         ; +0xd4, 0x3e3720\nLDR.W           R0, [R4,#0x1AC]                                        ; +0xd6, 0x3e3722\nCBZ             R0, loc_3E3736                                         ; +0xda, 0x3e3726\nLDR             R3, [R0]                                               ; +0xdc, 0x3e3728\nLDR             R1, =(asc_B7533B - 0x3E3734); \" \"                      ; +0xde, 0x3e372a\nLDR.W           R3, [R3,#0x1D0]                                        ; +0xe0, 0x3e372c\nADD             R1, PC; \" \"                                            ; +0xe4, 0x3e3730\nBLX             R3                                                     ; +0xe6, 0x3e3732\nB               loc_3E375C                                             ; +0xe8, 0x3e3734\nLDR.W           R6, [R4,#0x1B4]                                        ; +0xea, 0x3e3736\nCBZ             R6, loc_3E375C                                         ; +0xee, 0x3e373a\nLDR             R1, =(asc_B7533B - 0x3E3748); \" \"                      ; +0xf0, 0x3e373c\nMOVS            R2, #1                                                 ; +0xf2, 0x3e373e\nSTR             R0, [SP,#0x44+var_24]                                  ; +0xf4, 0x3e3740\nSTR             R0, [SP,#0x44+var_20]                                  ; +0xf6, 0x3e3742\nADD             R1, PC; \" \"                                            ; +0xf8, 0x3e3744\nSTR             R0, [SP,#0x44+var_1C]                                  ; +0xfa, 0x3e3746\nMOV             R0, R5                                                 ; +0xfc, 0x3e3748\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0xfe, 0x3e374a\nMOV             R0, R6                                                 ; +0x102, 0x3e374e\nMOV             R1, R5                                                 ; +0x104, 0x3e3750\nBL              _ZN8TextArea9setStringENSt6__ndk112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE; TextArea::setString(std::string) ; +0x106, 0x3e3752\nMOV             R0, R5                                                 ; +0x10a, 0x3e3756\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x10c, 0x3e3758\nMOV             R0, R4; this                                           ; +0x110, 0x3e375c\nBL              _ZN15CCTextInputNode16updateBlinkLabelEv; CCTextInputNode::updateBlinkLabel(void) ; +0x112, 0x3e375e\nLDR.W           R0, [R4,#0x1A4]                                        ; +0x116, 0x3e3762\nCBZ             R0, loc_3E3770                                         ; +0x11a, 0x3e3766\nLDR             R3, [R0]                                               ; +0x11c, 0x3e3768\nMOV             R1, R4                                                 ; +0x11e, 0x3e376a\nLDR             R3, [R3,#4]                                            ; +0x120, 0x3e376c\nBLX             R3                                                     ; +0x122, 0x3e376e\nLDRB.W          R3, [R4,#0x1B2]                                        ; +0x124, 0x3e3770\nCBZ             R3, loc_3E37DC                                         ; +0x128, 0x3e3774\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x12a, 0x3e3776\nADD             R6, SP, #0x44+var_38                                   ; +0x12e, 0x3e377a\nADD             R5, SP, #0x44+var_18                                   ; +0x130, 0x3e377c\nMOV             R1, R0                                                 ; +0x132, 0x3e377e\nADD             R0, SP, #0x44+var_40; this                             ; +0x134, 0x3e3780\nBL              _ZN7cocos2d10CCDirector10getWinSizeEv; cocos2d::CCDirector::getWinSize(void) ; +0x136, 0x3e3782\nLDR.W           R0, [R4,#0x1A0]                                        ; +0x13a, 0x3e3786\nLDR             R3, [R0]                                               ; +0x13e, 0x3e378a\nLDR.W           R3, [R3,#0x98]                                         ; +0x140, 0x3e378c\nBLX             R3                                                     ; +0x144, 0x3e3790\nMOV             R1, R0; cocos2d::CCPoint *                             ; +0x146, 0x3e3792\nMOV             R0, R6; this                                           ; +0x148, 0x3e3794\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x14a, 0x3e3796\nMOV             R0, R5                                                 ; +0x14e, 0x3e379a\nMOV             R1, R4                                                 ; +0x150, 0x3e379c\nMOV             R2, R6                                                 ; +0x152, 0x3e379e\nBL              sub_3DC220                                             ; +0x154, 0x3e37a0\nVMOV.F32        S14, #4.0                                              ; +0x158, 0x3e37a4\nVLDR            S15, [SP,#0x44+var_14]                                 ; +0x15c, 0x3e37a8\nMOV             R0, R5; this                                           ; +0x160, 0x3e37ac\nVLDR            S16, [SP,#0x44+var_3C]                                 ; +0x162, 0x3e37ae\nVSUB.F32        S15, S15, S14                                          ; +0x166, 0x3e37b2\nVSTR            S15, [SP,#0x44+var_14]                                 ; +0x16a, 0x3e37b6\nBL              _ZNK7cocos2d6CCRect7getMinYEv; cocos2d::CCRect::getMinY(void) ; +0x16e, 0x3e37ba\nVMOV            S15, R0                                                ; +0x172, 0x3e37be\nLDR.W           R0, [R4,#0x1A4]                                        ; +0x176, 0x3e37c2\nCBZ             R0, loc_3E37DC                                         ; +0x17a, 0x3e37c6\nVMOV.F32        S14, #0.5                                              ; +0x17c, 0x3e37c8\nLDR             R3, [R0]                                               ; +0x180, 0x3e37cc\nMOV             R1, R4                                                 ; +0x182, 0x3e37ce\nLDR             R3, [R3,#0xC]                                          ; +0x184, 0x3e37d0\nVNMLS.F32       S15, S16, S14                                          ; +0x186, 0x3e37d2\nVMOV            R2, S15                                                ; +0x18a, 0x3e37d6\nBLX             R3                                                     ; +0x18e, 0x3e37da\nLDR             R2, [SP,#0x44+var_8]                                   ; +0x190, 0x3e37dc\nMOVS            R0, #0                                                 ; +0x192, 0x3e37de\nLDR.W           R3, [R8]                                               ; +0x194, 0x3e37e0\nCMP             R2, R3                                                 ; +0x198, 0x3e37e4\nBEQ             loc_3E37FC                                             ; +0x19a, 0x3e37e6\nBLX             __stack_chk_fail                                       ; +0x19c, 0x3e37e8\nMOV             R0, R7                                                 ; +0x1a0, 0x3e37ec\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x1a2, 0x3e37ee\nBL              __cxa_end_cleanup                                      ; +0x1a6, 0x3e37f2\nMOV             R0, R5                                                 ; +0x1aa, 0x3e37f6\nB               loc_3E37EE                                             ; +0x1ac, 0x3e37f8\nB               loc_3E37F6                                             ; +0x1ae, 0x3e37fa\nADD             SP, SP, #0x44 ; 'D'                                    ; +0x1b0, 0x3e37fc\nVPOP            {D8}                                                   ; +0x1b2, 0x3e37fe\nPOP.W           {R4-R9,PC}                                             ; +0x1b6, 0x3e3802", "xrefs": ["`non-virtual thunk to'CCTextInputNode::onTextFieldAttachWithIME @ 0x3e3824"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "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"}