{"type": "func", "start": 4298557536, "end": 4298557896, "name": "GJGarageLayer::textInputClosed", "pseudocode": "// \n// GJGarageLayer::textInputClosed from 0x10036c860 to 0x10036c9c8 (360 bytes)\n// \n// 2 xrefs:\n// > sub_10036CA10 @ 0x10036ca15\n// > <???> @ 0x10091baf0\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\nvoid __fastcall GJGarageLayer::textInputClosed(GJGarageLayer *a1, CCTextInputNode *a2)\n{\n  __m128 v2; // xmm0\n  GameManager *v3; // r14\n  const char *data; // r14\n  size_t v5; // rax\n  size_t v6; // r15\n  char *v7; // r12\n  size_t v8; // r13\n  std::string __str; // [rsp+0h] [rbp-70h] BYREF\n  _QWORD __dst[2]; // [rsp+18h] [rbp-58h] BYREF\n  void *__p; // [rsp+28h] [rbp-48h]\n  std::string v12; // [rsp+30h] [rbp-40h] BYREF\n\n  CCTextInputNode::getString(&v12, (__int64)a2, *(double *)v2.i64);\n  if ( (*(_BYTE *)&v12.__r_.__value_.__s.0 & 1) != 0 )\n  {\n    if ( v12.__r_.__value_.__l.__size_ )\n      goto LABEL_6;\n  }\n  else if ( *(_BYTE *)&v12.__r_.__value_.__l.0 >> 1 )\n  {\n    goto LABEL_6;\n  }\n  std::string::assign(&v12, \"Player\");\nLABEL_6:\n  GameManager::sharedState()->m_scoreValid = 0;\n  v3 = GameManager::sharedState();\n  if ( (*(_BYTE *)&v12.__r_.__value_.__s.0 & 1) != 0 )\n  {\n    sub_100006B70(&__str, v12.__r_.__value_.__l.__data_, v12.__r_.__value_.__l.__size_, *(double *)v2.i64);\n  }\n  else\n  {\n    __str = v12;\n    v2 = *(__m128 *)&v12.__r_.__value_.__l.0;\n  }\n  std::string::operator=((std::string *)&v3->m_playerName, &__str);\n  if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )\n    operator delete(__str.__r_.__value_.__l.__data_);\n  if ( (*(_BYTE *)&v12.__r_.__value_.__s.0 & 1) != 0 )\n    data = v12.__r_.__value_.__l.__data_;\n  else\n    data = v12.__r_.__value_.__s.__data_;\n  v5 = strlen(data);\n  if ( v5 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100006BF0(*(double *)v2.i64);\n  v6 = v5;\n  if ( v5 >= 0x17 )\n  {\n    v8 = 26;\n    if ( (v5 | 7) != 0x17 )\n      v8 = (v5 | 7) + 1;\n    v7 = (char *)operator new(v8);\n    __p = v7;\n    __dst[0] = v8 | 1;\n    __dst[1] = v6;\n    goto LABEL_21;\n  }\n  LOBYTE(__dst[0]) = 2 * v5;\n  v7 = (char *)__dst + 1;\n  if ( v5 )\nLABEL_21:\n    memmove(v7, data, v6);\n  v7[v6] = 0;\n  CCTextInputNode::setString(a2, (__int64)__dst, v2);\n  if ( (__dst[0] & 1) != 0 )\n    operator delete(__p);\n  if ( (*(_BYTE *)&v12.__r_.__value_.__s.0 & 1) != 0 )\n    operator delete(v12.__r_.__value_.__l.__data_);\n}", "assembly": "; \n; GJGarageLayer::textInputClosed from 0x10036c860 to 0x10036c9c8 (360 bytes)\n; \n; 2 xrefs:\n; > sub_10036CA10 @ 0x10036ca15\n; > <???> @ 0x10091baf0\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\npush    rbp                                                            ; +0x0, 0x10036c860\nmov     rbp, rsp                                                       ; +0x1, 0x10036c861\npush    r15                                                            ; +0x4, 0x10036c864\npush    r14                                                            ; +0x6, 0x10036c866\npush    r13                                                            ; +0x8, 0x10036c868\npush    r12                                                            ; +0xa, 0x10036c86a\npush    rbx                                                            ; +0xc, 0x10036c86c\nsub     rsp, 48h                                                       ; +0xd, 0x10036c86d\nmov     rbx, rsi                                                       ; +0x11, 0x10036c871\nlea     rdi, [rbp+var_40]                                              ; +0x14, 0x10036c874\ncall    CCTextInputNode__getString                                     ; +0x18, 0x10036c878\nmovzx   eax, byte ptr [rbp+var_40.__r_.__value_]                       ; +0x1d, 0x10036c87d\ntest    al, 1                                                          ; +0x21, 0x10036c881\njz      short loc_10036C890                                            ; +0x23, 0x10036c883\nmov     rax, qword ptr [rbp+var_40.__r_.__value_+8]                    ; +0x25, 0x10036c885\ntest    rax, rax                                                       ; +0x29, 0x10036c889\njnz     short loc_10036C8A7                                            ; +0x2c, 0x10036c88c\njmp     short loc_10036C897                                            ; +0x2e, 0x10036c88e\nshr     eax, 1                                                         ; +0x30, 0x10036c890\ntest    rax, rax                                                       ; +0x32, 0x10036c892\njnz     short loc_10036C8A7                                            ; +0x35, 0x10036c895\nlea     rsi, aPlayer; \"Player\"                                         ; +0x37, 0x10036c897\nlea     rdi, [rbp+var_40]; this                                        ; +0x3e, 0x10036c89e\ncall    __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc; std::string::assign(char const*) ; +0x42, 0x10036c8a2\ncall    GameManager__sharedState                                       ; +0x47, 0x10036c8a7\nmov     byte ptr [rax+268h], 0                                         ; +0x4c, 0x10036c8ac\ncall    GameManager__sharedState                                       ; +0x53, 0x10036c8b3\nmov     r14, rax                                                       ; +0x58, 0x10036c8b8\ntest    byte ptr [rbp+var_40.__r_.__value_], 1                         ; +0x5b, 0x10036c8bb\njnz     short loc_10036C8D3                                            ; +0x5f, 0x10036c8bf\nmov     rax, qword ptr [rbp+var_40.__r_.__value_+10h]                  ; +0x61, 0x10036c8c1\nmov     qword ptr [rbp+__str.__r_.__value_+10h], rax                   ; +0x65, 0x10036c8c5\nmovups  xmm0, xmmword ptr [rbp+var_40.__r_.__value_]                   ; +0x69, 0x10036c8c9\nmovaps  xmmword ptr [rbp+__str.__r_.__value_], xmm0                    ; +0x6d, 0x10036c8cd\njmp     short loc_10036C8E4                                            ; +0x71, 0x10036c8d1\nmov     rdx, qword ptr [rbp+var_40.__r_.__value_+8]                    ; +0x73, 0x10036c8d3\nmov     rsi, qword ptr [rbp+var_40.__r_.__value_+10h]                  ; +0x77, 0x10036c8d7\nlea     rdi, [rbp+__str]                                               ; +0x7b, 0x10036c8db\ncall    sub_100006B70                                                  ; +0x7f, 0x10036c8df\nadd     r14, 250h                                                      ; +0x84, 0x10036c8e4\nlea     rsi, [rbp+__str]; __str                                        ; +0x8b, 0x10036c8eb\nmov     rdi, r14; this                                                 ; +0x8f, 0x10036c8ef\ncall    __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_; std::string::operator=(std::string const&) ; +0x92, 0x10036c8f2\ntest    byte ptr [rbp+__str.__r_.__value_], 1                          ; +0x97, 0x10036c8f7\njz      short loc_10036C906                                            ; +0x9b, 0x10036c8fb\nmov     rdi, qword ptr [rbp+__str.__r_.__value_+10h]; __p              ; +0x9d, 0x10036c8fd\ncall    __ZdlPv; operator delete(void *)                               ; +0xa1, 0x10036c901\ntest    byte ptr [rbp+var_40.__r_.__value_], 1                         ; +0xa6, 0x10036c906\njz      short loc_10036C912                                            ; +0xaa, 0x10036c90a\nmov     r14, qword ptr [rbp+var_40.__r_.__value_+10h]                  ; +0xac, 0x10036c90c\njmp     short loc_10036C916                                            ; +0xb0, 0x10036c910\nlea     r14, [rbp+var_40.__r_.__value_+1]                              ; +0xb2, 0x10036c912\nmov     rdi, r14; __s                                                  ; +0xb6, 0x10036c916\ncall    _strlen                                                        ; +0xb9, 0x10036c919\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xbe, 0x10036c91e\njnb     loc_10036C9C3                                                  ; +0xc2, 0x10036c922\nmov     r15, rax                                                       ; +0xc8, 0x10036c928\ncmp     rax, 17h                                                       ; +0xcb, 0x10036c92b\njnb     short loc_10036C943                                            ; +0xcf, 0x10036c92f\nlea     eax, [r15+r15]                                                 ; +0xd1, 0x10036c931\nmov     byte ptr [rbp+__dst], al                                       ; +0xd5, 0x10036c935\nlea     r12, [rbp+__dst+1]                                             ; +0xd8, 0x10036c938\ntest    r15, r15                                                       ; +0xdc, 0x10036c93c\njnz     short loc_10036C977                                            ; +0xdf, 0x10036c93f\njmp     short loc_10036C985                                            ; +0xe1, 0x10036c941\nmov     rax, r15                                                       ; +0xe3, 0x10036c943\nor      rax, 7                                                         ; +0xe6, 0x10036c946\nlea     rcx, [rax+1]                                                   ; +0xea, 0x10036c94a\ncmp     rax, 17h                                                       ; +0xee, 0x10036c94e\nmov     r13d, 1Ah                                                      ; +0xf2, 0x10036c952\ncmovnz  r13, rcx                                                       ; +0xf8, 0x10036c958\nmov     rdi, r13; __sz                                                 ; +0xfc, 0x10036c95c\ncall    __Znwm; operator new(ulong)                                    ; +0xff, 0x10036c95f\nmov     r12, rax                                                       ; +0x104, 0x10036c964\nmov     [rbp+__p], rax                                                 ; +0x107, 0x10036c967\nor      r13, 1                                                         ; +0x10b, 0x10036c96b\nmov     [rbp+__dst], r13                                               ; +0x10f, 0x10036c96f\nmov     [rbp+var_50], r15                                              ; +0x113, 0x10036c973\nmov     rdi, r12; __dst                                                ; +0x117, 0x10036c977\nmov     rsi, r14; __src                                                ; +0x11a, 0x10036c97a\nmov     rdx, r15; __len                                                ; +0x11d, 0x10036c97d\ncall    _memmove                                                       ; +0x120, 0x10036c980\nmov     byte ptr [r12+r15], 0                                          ; +0x125, 0x10036c985\nlea     rsi, [rbp+__dst]                                               ; +0x12a, 0x10036c98a\nmov     rdi, rbx                                                       ; +0x12e, 0x10036c98e\ncall    CCTextInputNode__setString                                     ; +0x131, 0x10036c991\ntest    byte ptr [rbp+__dst], 1                                        ; +0x136, 0x10036c996\njz      short loc_10036C9A5                                            ; +0x13a, 0x10036c99a\nmov     rdi, [rbp+__p]; __p                                            ; +0x13c, 0x10036c99c\ncall    __ZdlPv; operator delete(void *)                               ; +0x140, 0x10036c9a0\ntest    byte ptr [rbp+var_40.__r_.__value_], 1                         ; +0x145, 0x10036c9a5\njz      short loc_10036C9B4                                            ; +0x149, 0x10036c9a9\nmov     rdi, qword ptr [rbp+var_40.__r_.__value_+10h]; __p             ; +0x14b, 0x10036c9ab\ncall    __ZdlPv; operator delete(void *)                               ; +0x14f, 0x10036c9af\nadd     rsp, 48h                                                       ; +0x154, 0x10036c9b4\npop     rbx                                                            ; +0x158, 0x10036c9b8\npop     r12                                                            ; +0x159, 0x10036c9b9\npop     r13                                                            ; +0x15b, 0x10036c9bb\npop     r14                                                            ; +0x15d, 0x10036c9bd\npop     r15                                                            ; +0x15f, 0x10036c9bf\npop     rbp                                                            ; +0x161, 0x10036c9c1\nretn                                                                   ; +0x162, 0x10036c9c2\ncall    sub_100006BF0                                                  ; +0x163, 0x10036c9c3", "xrefs": ["sub_10036CA10 @ 0x10036ca15", "<???> @ 0x10091baf0"], "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"}