{"type": "func", "start": 4070180, "end": 4070324, "name": "CCTextInputNode::rawToDisplayIndex", "pseudocode": "// \n// CCTextInputNode::rawToDisplayIndex from 0x3e1b24 to 0x3e1bb4 (144 bytes)\n// \n// 2 xrefs:\n// > CCTextInputNode::updateBlinkLabelToChar @ 0x3e1c82\n// > CCTextInputNode::displayToRawIndex @ 0x3e2036\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::rawToDisplayIndex(int **this, int a2, int a3, int a4)\n{\n  int v6; // r4\n  const char *v7; // r0\n  const char *v8; // r5\n  size_t v9; // r0\n  int *v10; // r5\n  int v11; // r3\n  int v12; // r7\n  int v13; // r10\n  int v14; // r0\n  int v15; // r2\n  CCTextInputNode *v17; // [sp+0h] [bp-10h] BYREF\n  int v18; // [sp+4h] [bp-Ch]\n  int v19; // [sp+8h] [bp-8h]\n  int v20; // [sp+Ch] [bp-4h]\n\n  v17 = (CCTextInputNode *)this;\n  v18 = a2;\n  v19 = a3;\n  v20 = a4;\n  v6 = 0;\n  v7 = (const char *)(*(int (__fastcall **)(_DWORD))(**(this + 104) + 624))(*(this + 104));\n  v17 = nullptr;\n  v18 = 0;\n  v19 = 0;\n  v8 = v7;\n  v9 = strlen(v7);\n  std::string::__init((int *)&v17, v8, v9);\n  v10 = *(this + 94);\n  v11 = (int)*(this + 95);\n  v12 = a2;\n  v13 = -1431655765 * ((v11 - (int)v10) >> 2);\n  while ( v6 != v13 )\n  {\n    v14 = sub_3DC19C((unsigned __int8 *)&v17, *v10);\n    v15 = v10[1];\n    v10 += 3;\n    if ( v14 + v15 > a2 )\n    {\n      if ( a2 > v14 )\n        v12 += v14 - a2;\n      break;\n    }\n    ++v6;\n    v12 += 1 - v15;\n  }\n  std::string::~string((int)&v17);\n  return v12;\n}", "assembly": "; \n; CCTextInputNode::rawToDisplayIndex from 0x3e1b24 to 0x3e1bb4 (144 bytes)\n; \n; 2 xrefs:\n; > CCTextInputNode::updateBlinkLabelToChar @ 0x3e1c82\n; > CCTextInputNode::displayToRawIndex @ 0x3e2036\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          {R0-R10,LR}                                            ; +0x0, 0x3e1b24\nMOV             R7, R0                                                 ; +0x4, 0x3e1b28\nLDR             R6, =(__stack_chk_guard_ptr - 0x3E1B38)                ; +0x6, 0x3e1b2a\nMOV             R9, R1                                                 ; +0x8, 0x3e1b2c\nLDR.W           R0, [R0,#0x1A0]                                        ; +0xa, 0x3e1b2e\nMOVS            R4, #0                                                 ; +0xe, 0x3e1b32\nADD             R6, PC; __stack_chk_guard_ptr                          ; +0x10, 0x3e1b34\nLDR             R6, [R6]; __stack_chk_guard                            ; +0x12, 0x3e1b36\nMOV             R8, SP                                                 ; +0x14, 0x3e1b38\nLDR             R3, [R6]                                               ; +0x16, 0x3e1b3a\nSTR             R3, [SP,#0x10+var_4]                                   ; +0x18, 0x3e1b3c\nLDR             R3, [R0]                                               ; +0x1a, 0x3e1b3e\nLDR.W           R3, [R3,#0x270]                                        ; +0x1c, 0x3e1b40\nBLX             R3                                                     ; +0x20, 0x3e1b44\nSTR             R4, [SP,#0x10+var_10]                                  ; +0x22, 0x3e1b46\nSTR             R4, [SP,#0x10+var_C]                                   ; +0x24, 0x3e1b48\nSTR             R4, [SP,#0x10+var_8]                                   ; +0x26, 0x3e1b4a\nMOV             R5, R0                                                 ; +0x28, 0x3e1b4c\nBLX             strlen                                                 ; +0x2a, 0x3e1b4e\nMOV             R1, R5                                                 ; +0x2e, 0x3e1b52\nMOV             R2, R0                                                 ; +0x30, 0x3e1b54\nMOV             R0, SP                                                 ; +0x32, 0x3e1b56\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x34, 0x3e1b58\nLDR.W           R5, [R7,#0x178]                                        ; +0x38, 0x3e1b5c\nLDR.W           R3, [R7,#0x17C]                                        ; +0x3c, 0x3e1b60\nMOV             R7, R9                                                 ; +0x40, 0x3e1b64\nLDR             R1, =0xAAAAAAAB                                        ; +0x42, 0x3e1b66\nSUBS            R3, R3, R5                                             ; +0x44, 0x3e1b68\nASRS            R3, R3, #2                                             ; +0x46, 0x3e1b6a\nMUL             R10, R1, R3                                            ; +0x48, 0x3e1b6c\nCMP             R4, R10                                                ; +0x4c, 0x3e1b70\nBEQ             loc_3E1B9A                                             ; +0x4e, 0x3e1b72\nLDR             R1, [R5]                                               ; +0x50, 0x3e1b74\nMOV             R0, R8                                                 ; +0x52, 0x3e1b76\nBL              sub_3DC19C                                             ; +0x54, 0x3e1b78\nLDR             R2, [R5,#4]                                            ; +0x58, 0x3e1b7c\nADDS            R5, #0xC                                               ; +0x5a, 0x3e1b7e\nADDS            R3, R0, R2                                             ; +0x5c, 0x3e1b80\nCMP             R3, R9                                                 ; +0x5e, 0x3e1b82\nBGT             loc_3E1B90                                             ; +0x60, 0x3e1b84\nRSB.W           R2, R2, #1                                             ; +0x62, 0x3e1b86\nADDS            R4, #1                                                 ; +0x66, 0x3e1b8a\nADD             R7, R2                                                 ; +0x68, 0x3e1b8c\nB               loc_3E1B70                                             ; +0x6a, 0x3e1b8e\nCMP             R9, R0                                                 ; +0x6c, 0x3e1b90\nBLE             loc_3E1B9A                                             ; +0x6e, 0x3e1b92\nRSB.W           R0, R9, R0                                             ; +0x70, 0x3e1b94\nADD             R7, R0                                                 ; +0x74, 0x3e1b98\nMOV             R0, R8                                                 ; +0x76, 0x3e1b9a\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x78, 0x3e1b9c\nLDR             R2, [SP,#0x10+var_4]                                   ; +0x7c, 0x3e1ba0\nLDR             R3, [R6]                                               ; +0x7e, 0x3e1ba2\nMOV             R0, R7                                                 ; +0x80, 0x3e1ba4\nCMP             R2, R3                                                 ; +0x82, 0x3e1ba6\nBEQ             loc_3E1BAE                                             ; +0x84, 0x3e1ba8\nBLX             __stack_chk_fail                                       ; +0x86, 0x3e1baa\nADD             SP, SP, #0x10                                          ; +0x8a, 0x3e1bae\nPOP.W           {R4-R10,PC}                                            ; +0x8c, 0x3e1bb0", "xrefs": ["CCTextInputNode::updateBlinkLabelToChar @ 0x3e1c82", "CCTextInputNode::displayToRawIndex @ 0x3e2036"], "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"}