Function at 0x14005c420
Capabilities:
Write file on windows

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rsi
push rdi
sub rsp, 0x20
mov rbx, qword [rcx + 8]
mov rdi, r8
mov rsi, rdx
and dword [rbx + 0x40], 0xfdffffff
cmp dword [rbx + 0xa4], 2
je 0x14005c459
mov rax, qword [rcx]
call qword [rax + 0x18]
mov dword [rbx + 0xa4], 2
mov r8, rdi
mov rdx, rsi
mov rcx, rbx
mov rbx, qword [rsp + 0x30]
mov rsi, qword [rsp + 0x38]
add rsp, 0x20
pop rdi
jmp 0x140062e70
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
push rsi
push rdi
push r14
sub rsp, 0x20
mov r14, qword [rcx + 0x18]
mov rdi, r8
mov rbp, rdx
mov rsi, rcx
test r8, r8
js 0x14005c5b7
xor ebx, ebx
test r8, r8
je 0x14005c5ab
cmp qword [rcx + 0x78], rbx
je 0x14005c4ff
nop dword [rax]
mov r9, qword [rsi + 0x78]
lea rcx, [rbx + rbp]
mov r8, rdi
mov edx, 1
sub r8, rbx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add rbx, rax
test rax, rax
jne 0x14005c4f1
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
xor ecx, ecx
cmp dword [rax], 4
sete cl
jmp 0x14005c4f9
xor ecx, ecx
cmp rbx, rdi
setl cl
test ecx, ecx
jne 0x14005c4c0
jmp 0x14005c541
cmp dword [rcx + 0xa0], 0xffffffff
je 0x14005c546
nop dword [rax + rax]
mov ecx, dword [rsi + 0xa0]
lea rdx, [rbx + rbp]
mov r8d, 0x7fffffff
mov rax, rdi
sub rax, rbx
cmp rax, r8
cmovb r8d, eax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__write]
test eax, eax
jle 0x14005c541
cdqe
add rbx, rax
cmp rbx, rdi
jl 0x14005c510
test rbx, rbx
jne 0x14005c5ab
mov rbx, 0xffffffffffffffff
lea rcx, [rsp + 0x40]
mov edx, ebx
call fcn.140053970
mov rdi, rax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov edx, 2
mov ecx, 4
mov r8, rdi
cmp dword [rax], 0x1c
cmove edx, ecx
mov rcx, r14
call fcn.140059d10
mov rcx, qword [rsp + 0x40]
mov eax, dword [rcx]
test eax, eax
je 0x14005c598
cmp eax, ebx
je 0x14005c5b2
sub eax, 1
mov dword [rcx], eax
jne 0x14005c5b2
mov rcx, qword [rsp + 0x40]
mov edx, 2
lea r8d, [rdx + 6]
call fcn.140016170
mov rax, rbx
jmp 0x14005c607
and dword [rsi + 0x40], 0xffdfffff
mov rax, rbx
jmp 0x14005c607
mov edx, 0x16
lea rcx, [rsp + 0x40]
call fcn.140053970
mov r8, rax
mov edx, 2
mov rcx, r14
call fcn.140059d10
mov rcx, qword [rsp + 0x40]
mov eax, dword [rcx]
test eax, eax
je 0x14005c5f2
cmp eax, 0xffffffff
je 0x14005c600
sub eax, 1
mov dword [rcx], eax
jne 0x14005c600
mov rcx, qword [rsp + 0x40]
mov edx, 2
lea r8d, [rdx + 6]
call fcn.140016170
mov rax, 0xffffffffffffffff
mov rbx, qword [rsp + 0x48]
mov rbp, qword [rsp + 0x50]
add rsp, 0x20
pop r14
pop rdi
pop rsi
ret
push rbp
push rsi
push r14
push r15
sub rsp, 0x38
cmp qword [rcx + 0x78], 0
mov rbp, r8
mov r15, qword [rcx + 0x18]
mov r14, rdx
mov rsi, rcx
jne 0x140062f7f
cmp dword [rcx + 0xa0], 0xffffffff
jne 0x140062f7f
cmp qword [rcx + 0x80], 0xffffffffffffffff
mov qword [rsp + 0x68], rbx
mov qword [rsp + 0x70], rdi
mov qword [rsp + 0x30], r12
je 0x140062f76
xor r12d, r12d
mov rdi, r8
mov ebx, r12d
nop word [rax + rax]
mov rcx, qword [rsi + 0x80]
lea rdx, [rbx + r14]
mov r8d, 0x2000000
mov qword [rsp + 0x20], r12
cmp rdi, r8
lea r9, [rsp + 0x60]
cmovl r8d, edi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x140062f2c
mov eax, dword [rsp + 0x60]
test eax, eax
je 0x140062f0f
add rbx, rax
sub rdi, rax
cmp rbx, rbp
jl 0x140062ed0
mov rax, rbx
mov rdi, qword [rsp + 0x70]
mov rbx, qword [rsp + 0x68]
mov r12, qword [rsp + 0x30]
add rsp, 0x38
pop r15
pop r14
pop rsi
pop rbp
ret
test rbx, rbx
jne 0x140062f0f
lea edx, [rbx - 1]
lea rcx, [rsp + 0x78]
call fcn.140053800
mov r8, rax
lea edx, [rbx + 2]
mov rcx, r15
call fcn.140059d10
mov rcx, qword [rsp + 0x78]
mov eax, dword [rcx]
test eax, eax
je 0x140062f68
cmp eax, 0xffffffff
je 0x140062f76
sub eax, 1
mov dword [rcx], eax
jne 0x140062f76
mov rcx, qword [rsp + 0x78]
mov edx, 2
lea r8d, [rdx + 6]
call fcn.140016170
mov rax, 0xffffffffffffffff
jmp 0x140062f12
add rsp, 0x38
pop r15
pop r14
pop rsi
pop rbp
jmp 0x14005c480