; ; __acrt_wcs_to_mbs_cp<__crt_win32_buffer_internal_dynamic_resizing> from 0x1801398b4 to 0x180139a3e (394 bytes) ; ; 2 xrefs: ; > _wsetlocale_set_cat @ 0x180139ff9 ; > @ 0x180203800 ; ; This function is hookable on this platform! ; ; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA ; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings ; mov rax, rsp ; +0x0, 0x1801398b4 mov [rax+8], rbx ; +0x3, 0x1801398b7 mov [rax+10h], rbp ; +0x7, 0x1801398bb mov [rax+18h], rsi ; +0xb, 0x1801398bf mov [rax+20h], rdi ; +0xf, 0x1801398c3 push r14 ; +0x13, 0x1801398c7 sub rsp, 40h ; +0x15, 0x1801398c9 xor ebx, ebx ; +0x19, 0x1801398cd mov r14d, r8d ; +0x1b, 0x1801398cf mov rdi, rdx ; +0x1e, 0x1801398d2 mov rsi, rcx ; +0x21, 0x1801398d5 test rcx, rcx ; +0x24, 0x1801398d8 jnz short loc_1801398FF ; +0x27, 0x1801398db cmp [rdx+28h], bl ; +0x29, 0x1801398dd jz short loc_1801398EE ; +0x2c, 0x1801398e0 mov rcx, [rdx+10h]; Block ; +0x2e, 0x1801398e2 call _free_base ; +0x32, 0x1801398e6 mov [rdi+28h], bl ; +0x37, 0x1801398eb mov [rdi+10h], rbx ; +0x3a, 0x1801398ee mov [rdi+18h], rbx ; +0x3e, 0x1801398f2 mov [rdi+20h], rbx ; +0x42, 0x1801398f6 jmp loc_180139A21 ; +0x46, 0x1801398fa cmp [rcx], bx ; +0x4b, 0x1801398ff jnz short loc_180139958 ; +0x4e, 0x180139902 cmp [rdx+18h], rbx ; +0x50, 0x180139904 jnz short loc_180139950 ; +0x54, 0x180139908 cmp [rdx+28h], bl ; +0x56, 0x18013990a jz short loc_18013991B ; +0x59, 0x18013990d mov rcx, [rdx+10h]; Block ; +0x5b, 0x18013990f call _free_base ; +0x5f, 0x180139913 mov [rdi+28h], bl ; +0x64, 0x180139918 mov ecx, 1; Size ; +0x67, 0x18013991b call _malloc_base ; +0x6c, 0x180139920 mov [rdi+10h], rax ; +0x71, 0x180139925 mov rcx, rbx ; +0x75, 0x180139929 neg rax ; +0x78, 0x18013992c sbb edx, edx ; +0x7b, 0x18013992f not edx ; +0x7d, 0x180139931 and edx, 0Ch ; +0x7f, 0x180139933 setz cl ; +0x82, 0x180139936 test edx, edx ; +0x85, 0x180139939 setz al ; +0x87, 0x18013993b mov [rdi+28h], al ; +0x8a, 0x18013993e mov [rdi+18h], rcx ; +0x8d, 0x180139941 test edx, edx ; +0x91, 0x180139945 jz short loc_180139950 ; +0x93, 0x180139947 mov ebx, edx ; +0x95, 0x180139949 jmp loc_180139A21 ; +0x97, 0x18013994b mov rax, [rdi+10h] ; +0x9c, 0x180139950 mov [rax], bl ; +0xa0, 0x180139954 jmp short loc_1801398F6 ; +0xa2, 0x180139956 mov [rsp+48h+var_10], rbx ; +0xa4, 0x180139958 or r9d, 0FFFFFFFFh ; +0xa9, 0x18013995d mov [rsp+48h+var_18], rbx ; +0xad, 0x180139961 mov r8, rsi ; +0xb2, 0x180139966 mov [rsp+48h+var_20], ebx ; +0xb5, 0x180139969 xor edx, edx ; +0xb9, 0x18013996d mov ecx, r14d ; +0xbb, 0x18013996f mov [rsp+48h+var_28], rbx ; +0xbe, 0x180139972 call __acrt_WideCharToMultiByte ; +0xc3, 0x180139977 movsxd rbp, eax ; +0xc8, 0x18013997c test eax, eax ; +0xcb, 0x18013997f jnz short loc_18013999C ; +0xcd, 0x180139981 call cs:GetLastError ; +0xcf, 0x180139983 mov ecx, eax ; +0xd5, 0x180139989 call __acrt_errno_map_os_error ; +0xd7, 0x18013998b call _errno ; +0xdc, 0x180139990 mov ebx, [rax] ; +0xe1, 0x180139995 jmp loc_180139A21 ; +0xe3, 0x180139997 mov rcx, [rdi+18h] ; +0xe8, 0x18013999c cmp rbp, rcx ; +0xec, 0x1801399a0 jbe short loc_1801399E7 ; +0xef, 0x1801399a3 cmp [rdi+28h], bl ; +0xf1, 0x1801399a5 jz short loc_1801399B6 ; +0xf4, 0x1801399a8 mov rcx, [rdi+10h]; Block ; +0xf6, 0x1801399aa call _free_base ; +0xfa, 0x1801399ae mov [rdi+28h], bl ; +0xff, 0x1801399b3 mov rcx, rbp; Size ; +0x102, 0x1801399b6 call _malloc_base ; +0x105, 0x1801399b9 mov [rdi+10h], rax ; +0x10a, 0x1801399be mov rcx, rbx ; +0x10e, 0x1801399c2 neg rax ; +0x111, 0x1801399c5 sbb edx, edx ; +0x114, 0x1801399c8 not edx ; +0x116, 0x1801399ca and edx, 0Ch ; +0x118, 0x1801399cc cmovz rcx, rbp ; +0x11b, 0x1801399cf test edx, edx ; +0x11f, 0x1801399d3 setz al ; +0x121, 0x1801399d5 mov [rdi+28h], al ; +0x124, 0x1801399d8 mov [rdi+18h], rcx ; +0x127, 0x1801399db test edx, edx ; +0x12b, 0x1801399df jnz loc_180139949 ; +0x12d, 0x1801399e1 mov rax, [rdi+10h] ; +0x133, 0x1801399e7 or r9d, 0FFFFFFFFh ; +0x137, 0x1801399eb mov [rsp+48h+var_10], rbx ; +0x13b, 0x1801399ef mov r8, rsi ; +0x140, 0x1801399f4 mov [rsp+48h+var_18], rbx ; +0x143, 0x1801399f7 xor edx, edx ; +0x148, 0x1801399fc mov [rsp+48h+var_20], ecx ; +0x14a, 0x1801399fe mov ecx, r14d ; +0x14e, 0x180139a02 mov [rsp+48h+var_28], rax ; +0x151, 0x180139a05 call __acrt_WideCharToMultiByte ; +0x156, 0x180139a0a movsxd rcx, eax ; +0x15b, 0x180139a0f test eax, eax ; +0x15e, 0x180139a12 jz loc_180139983 ; +0x160, 0x180139a14 dec rcx ; +0x166, 0x180139a1a mov [rdi+20h], rcx ; +0x169, 0x180139a1d mov rbp, [rsp+48h+arg_8] ; +0x16d, 0x180139a21 mov eax, ebx ; +0x172, 0x180139a26 mov rbx, [rsp+48h+arg_0] ; +0x174, 0x180139a28 mov rsi, [rsp+48h+arg_10] ; +0x179, 0x180139a2d mov rdi, [rsp+48h+arg_18] ; +0x17e, 0x180139a32 add rsp, 40h ; +0x183, 0x180139a37 pop r14 ; +0x187, 0x180139a3b retn ; +0x189, 0x180139a3d