Function at 0x140005350
Capabilities:
Write file on windows

Disassembly:
push rbp
push rsi
push rdi
push r14
push r15
lea rbp, [rsp - 0x37]
sub rsp, 0x90
mov qword [rbp - 0x19], 0xfffffffffffffffe
mov qword [rsp + 0xd0], rbx
mov rax, qword [0x140022008]
xor rax, rsp
mov qword [rbp + 0x27], rax
movzx r14d, dx
mov rbx, rcx
mov edi, 0xffff
cmp di, dx
jne 0x1400053a1
xor eax, eax
cmp dx, di
cmovne ax, dx
jmp 0x1400055ed
mov rax, qword [rcx + 0x40]
mov r8, qword [rax]
test r8, r8
je 0x1400053de
mov rax, qword [rcx + 0x58]
movsxd r9, dword [rax]
lea rdx, [r8 + r9*2]
cmp r8, rdx
jae 0x1400053de
lea ecx, [r9 - 1]
mov dword [rax], ecx
mov rdx, qword [rbx + 0x40]
mov r8, qword [rdx]
lea rcx, [r8 + 2]
mov qword [rdx], rcx
mov word [r8], r14w
movzx eax, r14w
jmp 0x1400055ed
cmp qword [rcx + 0x80], 0
je 0x1400055ea
mov r8, qword [rcx + 0x18]
lea rax, [rcx + 0x70]
cmp qword [r8], rax
jne 0x14000541d
mov rdx, qword [rcx + 0x90]
mov rcx, qword [rcx + 0x88]
mov qword [r8], rcx
mov rax, qword [rbx + 0x38]
mov qword [rax], rcx
sub rdx, rcx
sar rdx, 1
mov rax, qword [rbx + 0x50]
mov dword [rax], edx
cmp qword [rbx + 0x68], 0
jne 0x140005447
mov rdx, qword [rbx + 0x80]
movzx ecx, r14w
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputwc]
cmp ax, di
je 0x1400055ea
movzx edi, r14w
jmp 0x1400055ea
mov word [rbp - 1], r14w
mov edx, 0xf
mov qword [rbp + 0x1f], rdx
mov byte [rbp + 7], 0
xor ecx, ecx
mov qword [rbp + 7], rcx
mov qword [rbp + 0x17], 8
lea rax, [rbp + 7]
cmp rdx, 0x10
cmovae rax, rcx
mov byte [rax + 8], cl
mov r8, qword [rbp + 7]
mov r9, qword [rbp + 0x1f]
nop
lea rcx, [rbp + 7]
cmp r9, 0x10
cmovae rcx, r8
lea rdx, [rbp + 7]
cmovae rdx, r8
add rcx, qword [rbp + 0x17]
lea rax, [rbp - 0x11]
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], rcx
mov qword [rsp + 0x28], rdx
lea rax, [rbp - 9]
mov qword [rsp + 0x20], rax
lea r9, [rbp + 1]
lea r8, [rbp - 1]
lea rdx, [rbx + 0x74]
mov rcx, qword [rbx + 0x68]
call qword [sym.imp.MSVCP140.dll_public:_int___cdecl_std::codecvt_wchar_t__char__struct__Mbstatet_::out_struct__Mbstatet____ptr64__wchar_t_const____ptr64__wchar_t_const____ptr64__wchar_t_const____ptr64____ptr64__char____ptr64__char____ptr64__char____ptr64____ptr64_const___ptr64]
test eax, eax
js 0x14000557d
cmp eax, 1
jg 0x14000555e
lea rax, [rbp + 7]
mov r8, qword [rbp + 7]
mov r9, qword [rbp + 0x1f]
cmp r9, 0x10
cmovae rax, r8
mov rsi, qword [rbp - 0x11]
sub rsi, rax
je 0x140005526
lea rcx, [rbp + 7]
cmp r9, 0x10
cmovae rcx, r8
mov r9, qword [rbx + 0x80]
mov r8, rsi
mov edx, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
mov r9, qword [rbp + 0x1f]
mov r8, qword [rbp + 7]
cmp rsi, rax
jne 0x140005585
mov byte [rbx + 0x72], 1
lea rax, [rbp - 1]
cmp qword [rbp - 9], rax
jne 0x140005558
test rsi, rsi
jne 0x140005480
cmp qword [rbp + 0x17], 0x20
jae 0x140005585
xor r8d, r8d
lea edx, [rsi + 8]
lea rcx, [rbp + 7]
call fcn.140005da0
jmp 0x140005476
movzx edi, r14w
jmp 0x140005585
cmp eax, 3
jne 0x14000557d
mov rdx, qword [rbx + 0x80]
movzx ecx, word [rbp - 1]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputwc]
cmp ax, di
je 0x14000557d
movzx edi, r14w
mov r8, qword [rbp + 7]
mov r9, qword [rbp + 0x1f]
cmp r9, 0x10
jb 0x1400055ea
inc r9
cmp r9, 0xffffffffffffffff
jbe 0x14000559b
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
cmp r9, 0x1000
jb 0x1400055e1
test byte [rbp + 7], 0x1f
je 0x1400055b1
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
mov rax, qword [r8 - 8]
cmp rax, r8
jb 0x1400055c1
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
sub r8, rax
cmp r8, 8
jae 0x1400055d1
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
cmp r8, 0x27
jbe 0x1400055de
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
mov r8, rax
mov rcx, r8
call qword [sym.imp.mfc140u.dll_CMFCRibbonInfo::XElementButtonUndo::XElementButtonUndo]
movzx eax, di
mov rcx, qword [rbp + 0x27]
xor rcx, rsp
call fcn.14000f1e0
mov rbx, qword [rsp + 0xd0]
add rsp, 0x90
pop r15
pop r14
pop rdi
pop rsi
pop rbp
ret