{"type": "func", "start": 3125264, "end": 3125666, "name": "CCTextInputNode::onTextFieldAttachWithIME", "pseudocode": "// \n// CCTextInputNode::onTextFieldAttachWithIME from 0x2fb010 to 0x2fb1a2 (402 bytes)\n// \n// 1 xrefs:\n// > `non-virtual thunk to'CCTextInputNode::onTextFieldAttachWithIME @ 0x2fb1bc\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\nbool CCTextInputNode::onTextFieldAttachWithIME(CCTextInputNode *a1, cocos2d::CCTextFieldTTF *a2)\n{\n  cocos2d::CCLabelBMFont *m_cursor; // r0\n  const char *v4; // r0\n  char *v5; // r2\n  char *v6; // r0\n  int v7; // r9\n  cocos2d::CCLabelBMFont *m_textLabel; // r0\n  TextArea *m_textArea; // r9\n  TextInputDelegate *m_delegate; // r0\n  cocos2d::CCDirector *v11; // r0\n  const cocos2d::CCPoint *v12; // r0\n  float height; // s16\n  float v14; // s15\n  TextInputDelegate *v15; // r0\n  cocos2d::CCSize v17; // [sp+4h] [bp-28h] BYREF\n  cocos2d::CCPoint v18; // [sp+Ch] [bp-20h] BYREF\n  cocos2d::CCRect v19; // [sp+14h] [bp-18h] BYREF\n\n  m_cursor = a1->m_cursor;\n  if ( m_cursor )\n    m_cursor->setVisible(m_cursor, 1);\n  a1->m_selected = (unsigned __int8)&dword_0 + 1;\n  PlatformToolbox::setKeyboardState((bool)&dword_0 + 1);\n  if ( a1->m_numberInput )\n  {\n    v4 = (const char *)a1->m_textField->getString(a1->m_textField);\n    if ( atof(v4) == 0.0 )\n    {\n      sub_776584((int)&v19, (char *)&unk_939830);\n      CCTextInputNode::setString((int)a1, (char *)&v19, v5);\n      sub_774008(&v19);\n    }\n  }\n  v6 = (char *)a1->m_textField->getString(a1->m_textField);\n  sub_776584((int)&v18, v6);\n  sub_776584((int)&v19, (char *)&unk_939830);\n  v7 = sub_774DBC(&v18, &v19);\n  sub_774008(&v19);\n  sub_774008(&v18);\n  if ( !v7 )\n  {\n    m_textLabel = a1->m_textLabel;\n    if ( m_textLabel )\n    {\n      m_textLabel->setString(m_textLabel, \" \");\n    }\n    else\n    {\n      m_textArea = a1->m_textArea;\n      if ( m_textArea )\n      {\n        sub_776584((int)&v19, \" \");\n        TextArea::setString((int)m_textArea, &v19);\n        sub_774008(&v19);\n      }\n    }\n    CCTextInputNode::updateBlinkLabel(a1);\n  }\n  m_delegate = a1->m_delegate;\n  if ( m_delegate )\n    m_delegate->textInputOpened(m_delegate, a1);\n  if ( a1->m_forceOffset )\n  {\n    v11 = cocos2d::CCDirector::sharedDirector();\n    cocos2d::CCDirector::getWinSize(&v17, v11);\n    v12 = a1->m_textField->getAnchorPoint(a1->m_textField);\n    cocos2d::CCPoint::CCPoint(&v18, v12);\n    sub_2F62CC(&v19, (int)a1, &v18.x);\n    height = v17.height;\n    v19.origin.y = v19.origin.y - 4.0;\n    v14 = COERCE_FLOAT(cocos2d::CCRect::getMinY(&v19));\n    v15 = a1->m_delegate;\n    if ( v15 )\n      ((void (__fastcall *)(TextInputDelegate *, CCTextInputNode *, _DWORD))v15->textInputShouldOffset)(\n        v15,\n        a1,\n        (float)(height * 0.5) - v14);\n  }\n  return 0;\n}", "assembly": "; \n; CCTextInputNode::onTextFieldAttachWithIME from 0x2fb010 to 0x2fb1a2 (402 bytes)\n; \n; 1 xrefs:\n; > `non-virtual thunk to'CCTextInputNode::onTextFieldAttachWithIME @ 0x2fb1bc\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\nLDR             R3, =(__stack_chk_guard_ptr - 0x2FB01A)                ; +0x0, 0x2fb010\nPUSH.W          {R4-R9,LR}                                             ; +0x2, 0x2fb012\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0x6, 0x2fb016\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x8, 0x2fb018\nVPUSH           {D8}                                                   ; +0xa, 0x2fb01a\nMOV             R4, R0                                                 ; +0xe, 0x2fb01e\nLDR             R2, [R3]                                               ; +0x10, 0x2fb020\nMOV             R7, R3                                                 ; +0x12, 0x2fb022\nLDR.W           R0, [R0,#0x178]                                        ; +0x14, 0x2fb024\nSUB             SP, SP, #0x2C                                          ; +0x18, 0x2fb028\nSTR             R2, [SP,#0x2C+var_8]                                   ; +0x1a, 0x2fb02a\nCBZ             R0, loc_2FB038                                         ; +0x1c, 0x2fb02c\nLDR             R3, [R0]                                               ; +0x1e, 0x2fb02e\nMOVS            R1, #1                                                 ; +0x20, 0x2fb030\nLDR.W           R3, [R3,#0xA4]                                         ; +0x22, 0x2fb032\nBLX             R3                                                     ; +0x26, 0x2fb036\nMOVS            R0, #(dword_0+1); this                                 ; +0x28, 0x2fb038\nSTRB.W          R0, [R4,#0x150]                                        ; +0x2a, 0x2fb03a\nBL              _ZN15PlatformToolbox16setKeyboardStateEb; PlatformToolbox::setKeyboardState(bool) ; +0x2e, 0x2fb03e\nLDRB.W          R3, [R4,#0x144]                                        ; +0x32, 0x2fb042\nADD             R5, SP, #0x2C+var_18                                   ; +0x36, 0x2fb046\nADD             R6, SP, #0x2C+var_20                                   ; +0x38, 0x2fb048\nCBZ             R3, loc_2FB084                                         ; +0x3a, 0x2fb04a\nLDR.W           R0, [R4,#0x17C]                                        ; +0x3c, 0x2fb04c\nLDR             R3, [R0]                                               ; +0x40, 0x2fb050\nLDR.W           R3, [R3,#0x268]                                        ; +0x42, 0x2fb052\nBLX             R3                                                     ; +0x46, 0x2fb056\nBLX             atof                                                   ; +0x48, 0x2fb058\nVMOV            D7, R0, R1                                             ; +0x4c, 0x2fb05c\nVCMP.F64        D7, #0.0                                               ; +0x50, 0x2fb060\nVMRS            APSR_nzcv, FPSCR                                       ; +0x54, 0x2fb064\nBNE             loc_2FB084                                             ; +0x58, 0x2fb068\nLDR             R1, =(unk_939830 - 0x2FB074)                           ; +0x5a, 0x2fb06a\nMOV             R0, R5; int                                            ; +0x5c, 0x2fb06c\nMOV             R2, R6                                                 ; +0x5e, 0x2fb06e\nADD             R1, PC; unk_939830 ; char *                            ; +0x60, 0x2fb070\nBL              sub_776584                                             ; +0x62, 0x2fb072\nMOV             R0, R4                                                 ; +0x66, 0x2fb076\nMOV             R1, R5                                                 ; +0x68, 0x2fb078\nBL              _ZN15CCTextInputNode9setStringESs; CCTextInputNode::setString(std::string) ; +0x6a, 0x2fb07a\nMOV             R0, R5                                                 ; +0x6e, 0x2fb07e\nBL              sub_774008                                             ; +0x70, 0x2fb080\nLDR.W           R0, [R4,#0x17C]                                        ; +0x74, 0x2fb084\nADD.W           R8, SP, #0x2C+var_28                                   ; +0x78, 0x2fb088\nLDR             R3, [R0]                                               ; +0x7c, 0x2fb08c\nLDR.W           R3, [R3,#0x268]                                        ; +0x7e, 0x2fb08e\nBLX             R3                                                     ; +0x82, 0x2fb092\nMOV             R2, SP                                                 ; +0x84, 0x2fb094\nMOV             R1, R0; char *                                         ; +0x86, 0x2fb096\nMOV             R0, R6; int                                            ; +0x88, 0x2fb098\nBL              sub_776584                                             ; +0x8a, 0x2fb09a\nLDR             R1, =(unk_939830 - 0x2FB0A8)                           ; +0x8e, 0x2fb09e\nMOV             R0, R5; int                                            ; +0x90, 0x2fb0a0\nMOV             R2, R8                                                 ; +0x92, 0x2fb0a2\nADD             R1, PC; unk_939830 ; char *                            ; +0x94, 0x2fb0a4\nBL              sub_776584                                             ; +0x96, 0x2fb0a6\nMOV             R1, R5                                                 ; +0x9a, 0x2fb0aa\nMOV             R0, R6                                                 ; +0x9c, 0x2fb0ac\nBL              sub_774DBC                                             ; +0x9e, 0x2fb0ae\nMOV             R9, R0                                                 ; +0xa2, 0x2fb0b2\nMOV             R0, R5                                                 ; +0xa4, 0x2fb0b4\nBL              sub_774008                                             ; +0xa6, 0x2fb0b6\nMOV             R0, R6                                                 ; +0xaa, 0x2fb0ba\nBL              sub_774008                                             ; +0xac, 0x2fb0bc\nCMP.W           R9, #0                                                 ; +0xb0, 0x2fb0c0\nBNE             loc_2FB104                                             ; +0xb4, 0x2fb0c4\nLDR.W           R0, [R4,#0x188]                                        ; +0xb6, 0x2fb0c6\nCBZ             R0, loc_2FB0DA                                         ; +0xba, 0x2fb0ca\nLDR             R3, [R0]                                               ; +0xbc, 0x2fb0cc\nLDR             R1, =(asc_943A02 - 0x2FB0D8); \" \"                      ; +0xbe, 0x2fb0ce\nLDR.W           R3, [R3,#0x1C8]                                        ; +0xc0, 0x2fb0d0\nADD             R1, PC; \" \"                                            ; +0xc4, 0x2fb0d4\nBLX             R3                                                     ; +0xc6, 0x2fb0d6\nB               loc_2FB0FE                                             ; +0xc8, 0x2fb0d8\nLDR.W           R9, [R4,#0x190]                                        ; +0xca, 0x2fb0da\nCMP.W           R9, #0                                                 ; +0xce, 0x2fb0de\nBEQ             loc_2FB0FE                                             ; +0xd2, 0x2fb0e2\nLDR             R1, =(asc_943A02 - 0x2FB0EE); \" \"                      ; +0xd4, 0x2fb0e4\nMOV             R0, R5; int                                            ; +0xd6, 0x2fb0e6\nMOV             R2, R6                                                 ; +0xd8, 0x2fb0e8\nADD             R1, PC; \" \"                                            ; +0xda, 0x2fb0ea\nBL              sub_776584                                             ; +0xdc, 0x2fb0ec\nMOV             R0, R9                                                 ; +0xe0, 0x2fb0f0\nMOV             R1, R5                                                 ; +0xe2, 0x2fb0f2\nBL              _ZN8TextArea9setStringESs; TextArea::setString(std::string) ; +0xe4, 0x2fb0f4\nMOV             R0, R5                                                 ; +0xe8, 0x2fb0f8\nBL              sub_774008                                             ; +0xea, 0x2fb0fa\nMOV             R0, R4; this                                           ; +0xee, 0x2fb0fe\nBL              _ZN15CCTextInputNode16updateBlinkLabelEv; CCTextInputNode::updateBlinkLabel(void) ; +0xf0, 0x2fb100\nLDR.W           R0, [R4,#0x180]                                        ; +0xf4, 0x2fb104\nCBZ             R0, loc_2FB112                                         ; +0xf8, 0x2fb108\nLDR             R3, [R0]                                               ; +0xfa, 0x2fb10a\nMOV             R1, R4                                                 ; +0xfc, 0x2fb10c\nLDR             R3, [R3,#4]                                            ; +0xfe, 0x2fb10e\nBLX             R3                                                     ; +0x100, 0x2fb110\nLDRB.W          R3, [R4,#0x18E]                                        ; +0x102, 0x2fb112\nCBZ             R3, loc_2FB17A                                         ; +0x106, 0x2fb116\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x108, 0x2fb118\nMOV             R1, R0                                                 ; +0x10c, 0x2fb11c\nMOV             R0, R8; this                                           ; +0x10e, 0x2fb11e\nBL              _ZN7cocos2d10CCDirector10getWinSizeEv; cocos2d::CCDirector::getWinSize(void) ; +0x110, 0x2fb120\nLDR.W           R0, [R4,#0x17C]                                        ; +0x114, 0x2fb124\nLDR             R3, [R0]                                               ; +0x118, 0x2fb128\nLDR.W           R3, [R3,#0x90]                                         ; +0x11a, 0x2fb12a\nBLX             R3                                                     ; +0x11e, 0x2fb12e\nMOV             R1, R0; cocos2d::CCPoint *                             ; +0x120, 0x2fb130\nMOV             R0, R6; this                                           ; +0x122, 0x2fb132\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x124, 0x2fb134\nMOV             R0, R5                                                 ; +0x128, 0x2fb138\nMOV             R1, R4                                                 ; +0x12a, 0x2fb13a\nMOV             R2, R6                                                 ; +0x12c, 0x2fb13c\nBL              sub_2F62CC                                             ; +0x12e, 0x2fb13e\nVMOV.F32        S14, #4.0                                              ; +0x132, 0x2fb142\nVLDR            S15, [SP,#0x2C+var_14]                                 ; +0x136, 0x2fb146\nMOV             R0, R5; this                                           ; +0x13a, 0x2fb14a\nVLDR            S16, [SP,#0x2C+var_24]                                 ; +0x13c, 0x2fb14c\nVSUB.F32        S15, S15, S14                                          ; +0x140, 0x2fb150\nVSTR            S15, [SP,#0x2C+var_14]                                 ; +0x144, 0x2fb154\nBL              _ZNK7cocos2d6CCRect7getMinYEv; cocos2d::CCRect::getMinY(void) ; +0x148, 0x2fb158\nVMOV            S15, R0                                                ; +0x14c, 0x2fb15c\nLDR.W           R0, [R4,#0x180]                                        ; +0x150, 0x2fb160\nCBZ             R0, loc_2FB17A                                         ; +0x154, 0x2fb164\nVMOV.F32        S14, #0.5                                              ; +0x156, 0x2fb166\nLDR             R3, [R0]                                               ; +0x15a, 0x2fb16a\nMOV             R1, R4                                                 ; +0x15c, 0x2fb16c\nLDR             R3, [R3,#0xC]                                          ; +0x15e, 0x2fb16e\nVNMLS.F32       S15, S16, S14                                          ; +0x160, 0x2fb170\nVMOV            R2, S15                                                ; +0x164, 0x2fb174\nBLX             R3                                                     ; +0x168, 0x2fb178\nLDR             R2, [SP,#0x2C+var_8]                                   ; +0x16a, 0x2fb17a\nMOVS            R0, #0                                                 ; +0x16c, 0x2fb17c\nLDR             R3, [R7]                                               ; +0x16e, 0x2fb17e\nCMP             R2, R3                                                 ; +0x170, 0x2fb180\nBEQ             loc_2FB198                                             ; +0x172, 0x2fb182\nBLX             __stack_chk_fail                                       ; +0x174, 0x2fb184\nMOV             R0, R6                                                 ; +0x178, 0x2fb188\nBL              sub_774008                                             ; +0x17a, 0x2fb18a\nBL              __cxa_end_cleanup                                      ; +0x17e, 0x2fb18e\nMOV             R0, R5                                                 ; +0x182, 0x2fb192\nB               loc_2FB18A                                             ; +0x184, 0x2fb194\nB               loc_2FB192                                             ; +0x186, 0x2fb196\nADD             SP, SP, #0x2C ; ','                                    ; +0x188, 0x2fb198\nVPOP            {D8}                                                   ; +0x18a, 0x2fb19a\nPOP.W           {R4-R9,PC}                                             ; +0x18e, 0x2fb19e", "xrefs": ["`non-virtual thunk to'CCTextInputNode::onTextFieldAttachWithIME @ 0x2fb1bc"], "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"}