{"type": "func", "start": 6443764608, "end": 6443764756, "name": "_mbsdec_l", "pseudocode": "// \n// _mbsdec_l from 0x180140b80 to 0x180140c14 (148 bytes)\n// \n// 2 xrefs:\n// > _mbsdec @ 0x180140b7b\n// > <???> @ 0x180203c44\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\nunsigned __int8 *__cdecl mbsdec_l(const unsigned __int8 *Start, const unsigned __int8 *Pos, _locale_t Locale)\n{\n  unsigned __int8 *v6; // rdx\n  __int64 v7; // [rsp+20h] [rbp-28h] BYREF\n  __int64 v8; // [rsp+30h] [rbp-18h]\n  char v9; // [rsp+38h] [rbp-10h]\n\n  if ( !Start || !Pos )\n  {\n    *errno() = 22;\n    invalid_parameter_noinfo();\n    return nullptr;\n  }\n  if ( Start >= Pos )\n    return nullptr;\n  _LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)&v7, Locale);\n  v6 = (unsigned __int8 *)(Pos - 1);\n  if ( *(_DWORD *)(v8 + 8) )\n  {\n    do\n      --v6;\n    while ( Start <= v6 && (*(_BYTE *)(*v6 + v8 + 25) & 4) != 0 );\n    v6 = (unsigned __int8 *)&Pos[-(((_BYTE)Pos - (_BYTE)v6) & 1) - 1];\n  }\n  if ( v9 )\n    *(_DWORD *)(v7 + 936) &= ~2u;\n  return v6;\n}", "assembly": "; \n; _mbsdec_l from 0x180140b80 to 0x180140c14 (148 bytes)\n; \n; 2 xrefs:\n; > _mbsdec @ 0x180140b7b\n; > <???> @ 0x180203c44\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_0], rbx                                               ; +0x0, 0x180140b80\npush    rdi                                                            ; +0x5, 0x180140b85\nsub     rsp, 40h                                                       ; +0x6, 0x180140b86\nmov     rbx, rdx                                                       ; +0xa, 0x180140b8a\nmov     rdi, rcx                                                       ; +0xd, 0x180140b8d\ntest    rcx, rcx                                                       ; +0x10, 0x180140b90\njnz     short loc_180140BA9                                            ; +0x13, 0x180140b93\ncall    _errno                                                         ; +0x15, 0x180140b95\nmov     dword ptr [rax], 16h                                           ; +0x1a, 0x180140b9a\ncall    _invalid_parameter_noinfo                                      ; +0x20, 0x180140ba0\nxor     eax, eax                                                       ; +0x25, 0x180140ba5\njmp     short loc_180140C09                                            ; +0x27, 0x180140ba7\ntest    rbx, rbx                                                       ; +0x29, 0x180140ba9\njz      short loc_180140B95                                            ; +0x2c, 0x180140bac\ncmp     rdi, rbx                                                       ; +0x2e, 0x180140bae\njnb     short loc_180140BA5                                            ; +0x31, 0x180140bb1\nmov     rdx, r8; struct __crt_locale_pointers *                        ; +0x33, 0x180140bb3\nlea     rcx, [rsp+48h+var_28]; this                                    ; +0x36, 0x180140bb6\ncall    ??0_LocaleUpdate@@QEAA@QEAU__crt_locale_pointers@@@Z           ; +0x3b, 0x180140bbb\nmov     rcx, [rsp+48h+var_18]                                          ; +0x40, 0x180140bc0\nlea     rdx, [rbx-1]                                                   ; +0x45, 0x180140bc5\ncmp     dword ptr [rcx+8], 0                                           ; +0x49, 0x180140bc9\njz      short loc_180140BF3                                            ; +0x4d, 0x180140bcd\ndec     rdx                                                            ; +0x4f, 0x180140bcf\ncmp     rdi, rdx                                                       ; +0x52, 0x180140bd2\nja      short loc_180140BE1                                            ; +0x55, 0x180140bd5\nmovzx   eax, byte ptr [rdx]                                            ; +0x57, 0x180140bd7\ntest    byte ptr [rax+rcx+19h], 4                                      ; +0x5a, 0x180140bda\njnz     short loc_180140BCF                                            ; +0x5f, 0x180140bdf\nmov     rcx, rbx                                                       ; +0x61, 0x180140be1\nsub     rcx, rdx                                                       ; +0x64, 0x180140be4\nmov     rdx, rbx                                                       ; +0x67, 0x180140be7\nand     ecx, 1                                                         ; +0x6a, 0x180140bea\nsub     rdx, rcx                                                       ; +0x6d, 0x180140bed\ndec     rdx                                                            ; +0x70, 0x180140bf0\ncmp     [rsp+48h+var_10], 0                                            ; +0x73, 0x180140bf3\njz      short loc_180140C06                                            ; +0x78, 0x180140bf8\nmov     rcx, [rsp+48h+var_28]                                          ; +0x7a, 0x180140bfa\nand     dword ptr [rcx+3A8h], 0FFFFFFFDh                               ; +0x7f, 0x180140bff\nmov     rax, rdx                                                       ; +0x86, 0x180140c06\nmov     rbx, [rsp+48h+arg_0]                                           ; +0x89, 0x180140c09\nadd     rsp, 40h                                                       ; +0x8e, 0x180140c0e\npop     rdi                                                            ; +0x92, 0x180140c12\nretn                                                                   ; +0x93, 0x180140c13", "xrefs": ["_mbsdec @ 0x180140b7b", "<???> @ 0x180203c44"], "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"}