{"type": "func", "start": 6443738972, "end": 6443739156, "name": "update_thread_multibyte_data_internal", "pseudocode": "// \n// update_thread_multibyte_data_internal from 0x18013a75c to 0x18013a814 (184 bytes)\n// \n// 3 xrefs:\n// > setmbcp_internal @ 0x18013a5c0\n// > __acrt_update_thread_multibyte_data @ 0x18013a88b\n// > <???> @ 0x18020386c\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\nstruct __crt_multibyte_data *__fastcall update_thread_multibyte_data_internal(\n        struct __acrt_ptd *const a1,\n        struct __crt_multibyte_data **const a2)\n{\n  volatile signed __int32 *v4; // rbx\n  volatile signed __int32 *v5; // rax\n\n  if ( (dword_1801B1F90 & *((_DWORD *)a1 + 234)) != 0 && *((_QWORD *)a1 + 18) )\n  {\n    v4 = *((volatile signed __int32 **)a1 + 17);\n  }\n  else\n  {\n    sub_1801346AC(5);\n    v4 = *((volatile signed __int32 **)a1 + 17);\n    if ( v4 != (volatile signed __int32 *)*a2 )\n    {\n      if ( v4 && _InterlockedExchangeAdd(v4, 0xFFFFFFFF) == 1 && v4 != (volatile signed __int32 *)&unk_1801B1A50 )\n        free_base((void *)v4);\n      v5 = (volatile signed __int32 *)*a2;\n      *((_QWORD *)a1 + 17) = *a2;\n      _InterlockedIncrement(v5);\n      v4 = v5;\n    }\n    sub_180134700(5);\n  }\n  if ( !v4 )\n    abort();\n  return (struct __crt_multibyte_data *)v4;\n}", "assembly": "; \n; update_thread_multibyte_data_internal from 0x18013a75c to 0x18013a814 (184 bytes)\n; \n; 3 xrefs:\n; > setmbcp_internal @ 0x18013a5c0\n; > __acrt_update_thread_multibyte_data @ 0x18013a88b\n; > <???> @ 0x18020386c\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\nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x18013a75c\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x18013a761\npush    rdi                                                            ; +0xa, 0x18013a766\nsub     rsp, 20h                                                       ; +0xb, 0x18013a767\nmov     rsi, rdx                                                       ; +0xf, 0x18013a76b\nmov     rdi, rcx                                                       ; +0x12, 0x18013a76e\nmov     eax, cs:dword_1801B1F90                                        ; +0x15, 0x18013a771\ntest    [rcx+3A8h], eax                                                ; +0x1b, 0x18013a777\njz      short loc_18013A792                                            ; +0x21, 0x18013a77d\ncmp     qword ptr [rcx+90h], 0                                         ; +0x23, 0x18013a77f\njz      short loc_18013A792                                            ; +0x2b, 0x18013a787\nmov     rbx, [rcx+88h]                                                 ; +0x2d, 0x18013a789\njmp     short loc_18013A7F6                                            ; +0x34, 0x18013a790\nmov     ecx, 5                                                         ; +0x36, 0x18013a792\ncall    sub_1801346AC                                                  ; +0x3b, 0x18013a797\nnop                                                                    ; +0x40, 0x18013a79c\nmov     rbx, [rdi+88h]                                                 ; +0x41, 0x18013a79d\nmov     [rsp+28h+Block], rbx                                           ; +0x48, 0x18013a7a4\ncmp     rbx, [rsi]                                                     ; +0x4d, 0x18013a7a9\njz      short loc_18013A7EC                                            ; +0x50, 0x18013a7ac\ntest    rbx, rbx                                                       ; +0x52, 0x18013a7ae\njz      short loc_18013A7D5                                            ; +0x55, 0x18013a7b1\nor      eax, 0FFFFFFFFh                                                ; +0x57, 0x18013a7b3\nlock xadd [rbx], eax                                                   ; +0x5a, 0x18013a7b6\ncmp     eax, 1                                                         ; +0x5e, 0x18013a7ba\njnz     short loc_18013A7D5                                            ; +0x61, 0x18013a7bd\nlea     rax, unk_1801B1A50                                             ; +0x63, 0x18013a7bf\nmov     rcx, [rsp+28h+Block]; Block                                    ; +0x6a, 0x18013a7c6\ncmp     rcx, rax                                                       ; +0x6f, 0x18013a7cb\njz      short loc_18013A7D5                                            ; +0x72, 0x18013a7ce\ncall    _free_base                                                     ; +0x74, 0x18013a7d0\nmov     rax, [rsi]                                                     ; +0x79, 0x18013a7d5\nmov     [rdi+88h], rax                                                 ; +0x7c, 0x18013a7d8\nmov     [rsp+28h+Block], rax                                           ; +0x83, 0x18013a7df\nlock inc dword ptr [rax]                                               ; +0x88, 0x18013a7e4\nmov     rbx, [rsp+28h+Block]                                           ; +0x8b, 0x18013a7e7\nmov     ecx, 5                                                         ; +0x90, 0x18013a7ec\ncall    sub_180134700                                                  ; +0x95, 0x18013a7f1\ntest    rbx, rbx                                                       ; +0x9a, 0x18013a7f6\njz      short loc_18013A80E                                            ; +0x9d, 0x18013a7f9\nmov     rax, rbx                                                       ; +0x9f, 0x18013a7fb\nmov     rbx, [rsp+28h+arg_8]                                           ; +0xa2, 0x18013a7fe\nmov     rsi, [rsp+28h+arg_10]                                          ; +0xa7, 0x18013a803\nadd     rsp, 20h                                                       ; +0xac, 0x18013a808\npop     rdi                                                            ; +0xb0, 0x18013a80c\nretn                                                                   ; +0xb1, 0x18013a80d\ncall    abort                                                          ; +0xb2, 0x18013a80e\nalign 4                                                                ; +0xb7, 0x18013a813", "xrefs": ["setmbcp_internal @ 0x18013a5c0", "__acrt_update_thread_multibyte_data @ 0x18013a88b", "<???> @ 0x18020386c"], "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"}