{"type": "func", "start": 4071368, "end": 4071536, "name": "CCTextInputNode::displayToRawIndex", "pseudocode": "// \n// CCTextInputNode::displayToRawIndex from 0x3e1fc8 to 0x3e2070 (168 bytes)\n// \n// 3 xrefs:\n// > CCTextInputNode::updateCursorPosition @ 0x3e2308\n// > CCTextInputNode::updateCursorPosition @ 0x3e23ec\n// > CCTextInputNode::updateCursorPosition @ 0x3e2414\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:02 +0000\n// \n\nint __fastcall CCTextInputNode::displayToRawIndex(CCTextInputNode *this, int a2)\n{\n  unsigned int v4; // r4\n  const char *v5; // r0\n  const char *v6; // r7\n  size_t v7; // r0\n  const char *v8; // r1\n  int v9; // r7\n  int v10; // r2\n  int *v11; // r11\n  int v12; // r0\n  int v13; // r2\n  int v14; // r3\n  int v16[3]; // [sp+0h] [bp-14h] BYREF\n\n  v4 = 0;\n  v5 = (const char *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 104) + 624))(*((_DWORD *)this + 104));\n  memset(v16, 0, sizeof(v16));\n  v6 = v5;\n  v7 = strlen(v5);\n  v8 = v6;\n  v9 = a2;\n  std::string::__init(v16, v8, v7);\n  while ( 1 )\n  {\n    v10 = *((_DWORD *)this + 94);\n    if ( v4 >= -1431655765 * ((*((_DWORD *)this + 95) - v10) >> 2) )\n      break;\n    v11 = (int *)(v10 + 12 * v4);\n    v12 = sub_3DC19C((unsigned __int8 *)v16, *v11);\n    if ( CCTextInputNode::rawToDisplayIndex((int **)this, v12, v13, v14) >= a2 )\n      break;\n    ++v4;\n    v9 += v11[1] - 1;\n  }\n  std::string::~string((int)v16);\n  return v9;\n}", "assembly": "; \n; CCTextInputNode::displayToRawIndex from 0x3e1fc8 to 0x3e2070 (168 bytes)\n; \n; 3 xrefs:\n; > CCTextInputNode::updateCursorPosition @ 0x3e2308\n; > CCTextInputNode::updateCursorPosition @ 0x3e23ec\n; > CCTextInputNode::updateCursorPosition @ 0x3e2414\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:02 +0000\n; \nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x3e1fc8\nMOV             R6, R0                                                 ; +0x4, 0x3e1fcc\nLDR.W           R9, =(__stack_chk_guard_ptr - 0x3E1FDE)                ; +0x6, 0x3e1fce\nSUB             SP, SP, #0x14                                          ; +0xa, 0x3e1fd2\nLDR.W           R0, [R0,#0x1A0]                                        ; +0xc, 0x3e1fd4\nMOV             R8, R1                                                 ; +0x10, 0x3e1fd8\nADD             R9, PC; __stack_chk_guard_ptr                          ; +0x12, 0x3e1fda\nLDR.W           R9, [R9]; __stack_chk_guard                            ; +0x14, 0x3e1fdc\nMOVS            R4, #0                                                 ; +0x18, 0x3e1fe0\nMOV             R5, SP                                                 ; +0x1a, 0x3e1fe2\nMOV.W           R10, #0xC                                              ; +0x1c, 0x3e1fe4\nLDR.W           R3, [R9]                                               ; +0x20, 0x3e1fe8\nSTR             R3, [SP,#0x14+var_8]                                   ; +0x24, 0x3e1fec\nLDR             R3, [R0]                                               ; +0x26, 0x3e1fee\nLDR.W           R3, [R3,#0x270]                                        ; +0x28, 0x3e1ff0\nBLX             R3                                                     ; +0x2c, 0x3e1ff4\nSTR             R4, [SP,#0x14+var_14]                                  ; +0x2e, 0x3e1ff6\nSTR             R4, [SP,#0x14+var_10]                                  ; +0x30, 0x3e1ff8\nSTR             R4, [SP,#0x14+var_C]                                   ; +0x32, 0x3e1ffa\nMOV             R7, R0                                                 ; +0x34, 0x3e1ffc\nBLX             strlen                                                 ; +0x36, 0x3e1ffe\nMOV             R1, R7                                                 ; +0x3a, 0x3e2002\nMOV             R7, R8                                                 ; +0x3c, 0x3e2004\nMOV             R2, R0                                                 ; +0x3e, 0x3e2006\nMOV             R0, SP                                                 ; +0x40, 0x3e2008\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x42, 0x3e200a\nLDR.W           R2, [R6,#0x178]                                        ; +0x46, 0x3e200e\nLDR.W           R3, [R6,#0x17C]                                        ; +0x4a, 0x3e2012\nLDR             R1, =0xAAAAAAAB                                        ; +0x4e, 0x3e2016\nSUBS            R3, R3, R2                                             ; +0x50, 0x3e2018\nASRS            R3, R3, #2                                             ; +0x52, 0x3e201a\nMULS            R3, R1                                                 ; +0x54, 0x3e201c\nCMP             R4, R3                                                 ; +0x56, 0x3e201e\nBCS             loc_3E203E                                             ; +0x58, 0x3e2020\nMUL             R3, R10, R4                                            ; +0x5a, 0x3e2022\nMOV             R0, R5                                                 ; +0x5e, 0x3e2026\nADD.W           R11, R2, R3                                            ; +0x60, 0x3e2028\nLDR             R1, [R2,R3]                                            ; +0x64, 0x3e202c\nBL              sub_3DC19C                                             ; +0x66, 0x3e202e\nMOV             R1, R0; int                                            ; +0x6a, 0x3e2032\nMOV             R0, R6; this                                           ; +0x6c, 0x3e2034\nBL              _ZN15CCTextInputNode17rawToDisplayIndexEi; CCTextInputNode::rawToDisplayIndex(int) ; +0x6e, 0x3e2036\nCMP             R0, R8                                                 ; +0x72, 0x3e203a\nBLT             loc_3E2054                                             ; +0x74, 0x3e203c\nMOV             R0, R5                                                 ; +0x76, 0x3e203e\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x78, 0x3e2040\nLDR             R2, [SP,#0x14+var_8]                                   ; +0x7c, 0x3e2044\nLDR.W           R3, [R9]                                               ; +0x7e, 0x3e2046\nMOV             R0, R7                                                 ; +0x82, 0x3e204a\nCMP             R2, R3                                                 ; +0x84, 0x3e204c\nBEQ             loc_3E206A                                             ; +0x86, 0x3e204e\nBLX             __stack_chk_fail                                       ; +0x88, 0x3e2050\nLDR.W           R3, [R11,#4]                                           ; +0x8c, 0x3e2054\nADDS            R4, #1                                                 ; +0x90, 0x3e2058\nSUBS            R3, #1                                                 ; +0x92, 0x3e205a\nADD             R7, R3                                                 ; +0x94, 0x3e205c\nB               loc_3E200E                                             ; +0x96, 0x3e205e\nMOV             R0, R5                                                 ; +0x98, 0x3e2060\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x9a, 0x3e2062\nBL              __cxa_end_cleanup                                      ; +0x9e, 0x3e2066\nADD             SP, SP, #0x14                                          ; +0xa2, 0x3e206a\nPOP.W           {R4-R11,PC}                                            ; +0xa4, 0x3e206c", "xrefs": ["CCTextInputNode::updateCursorPosition @ 0x3e2308", "CCTextInputNode::updateCursorPosition @ 0x3e23ec", "CCTextInputNode::updateCursorPosition @ 0x3e2414"], "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"}