Function at 0x140021a20
Capabilities:
Write file on windows

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0x68
lea rbp, [rsp + 0x60]
mov qword [rbp - 0x10], 0xfffffffffffffffe
mov edi, dword [rcx + 0x60]
test edi, edi
jle 0x140021cef
mov rsi, qword [rcx + 0x48]
test rsi, rsi
mov qword [rbp - 0x28], rcx
jne 0x140021a73
mov ecx, dword [rcx + 0x68]
test ecx, ecx
js 0x140021d0b
call sub.gc.dll_GC_malloc_atomic
mov rsi, rax
mov rcx, qword [rbp - 0x28]
mov qword [rcx + 0x48], rax
mov edi, dword [rcx + 0x60]
mov ecx, dword [rcx + 0x6c]
call sub.api_ms_win_crt_stdio_l1_1_0.dll__get_osfhandle
mov qword [rbp - 0x18], rax
mov rax, qword [rbp - 0x18]
cmp rax, 0xfffffffffffffffe
je 0x140021dfb
cmp rax, 0xffffffffffffffff
mov rcx, qword [rbp - 0x28]
je 0x140021e5d
movabs r14, 0x1ffffffff
test edi, edi
je 0x140021ce8
nop dword [rax]
cmp byte [rcx + 0x38], 1
jne 0x140021af0
mov qword [rsp + 0x20], 0
mov rcx, qword [rbp - 0x18]
mov rdx, rsi
mov r8d, edi
lea r9, [rbp - 0x2c]
call sub.KERNEL32.dll_WriteFile
test eax, eax
je 0x140021cd6
mov ebx, dword [rbp - 0x2c]
jmp 0x140021bc3
mov r12, qword [rcx + 0xa0]
mov r13, qword [rcx + 0x98]
mov r15d, dword [rcx + 0x90]
mov ecx, 0x50
call sub.gc.dll_GC_malloc
mov qword [rbp - 0x20], rax
mov rax, qword [rbp - 0x20]
mov dword [rax + 0x4c], 0
mov qword [rax + 0x44], 0
mov qword [rax + 0x3c], 0
mov qword [rax + 0x34], 0
mov qword [rax + 0x2c], 0
mov qword [rax + 0x24], 0
mov qword [rax + 0x1c], 0
mov qword [rax + 0x14], 0
mov qword [rax + 0xc], 0
mov qword [rax + 4], 0
mov dword [rax], 0x76
call fcn.140019fa0
mov rcx, rax
call fcn.14001a600
mov rax, qword [rax + 0x30]
mov rbx, qword [rbp - 0x20]
mov qword [rbx + 8], rax
mov dword [rbx + 0x10], 1
add rbx, 0x28
mov qword [rsp + 0x20], rbx
mov rcx, qword [rbp - 0x18]
mov rdx, rsi
mov r8d, edi
lea r9, [rbp - 0x34]
call sub.KERNEL32.dll_WriteFile
test eax, eax
je 0x140021c03
mov ebx, dword [rbp - 0x34]
mov rcx, qword [rbp - 0x20]
mov byte [rcx + 0x48], 1
mov rdx, qword [rbp - 0x18]
call fcn.14001a910
mov dword [rbp - 0x2c], ebx
test edi, edi
js 0x140021d10
cmp edi, ebx
jb 0x140021d10
mov edi, edi
mov eax, ebx
sub rdi, rax
mov rcx, rdi
and rcx, r14
movsxd rdx, edi
and rdx, r14
cmp rcx, rdx
jne 0x140021d06
add rsi, rax
mov rcx, qword [rbp - 0x28]
test edi, edi
jne 0x140021ab0
jmp 0x140021ce8
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x6c
jle 0x140021c6a
cmp eax, 0x6d
je 0x140021c87
cmp eax, 0x3e5
jne 0x140021de1
mov ecx, r15d
mov rdx, r13
mov r8, r12
call fcn.140022210
mov rax, qword [rbp - 0x20]
mov ecx, dword [rax + 0x10]
lea eax, [rcx - 1]
cmp eax, 2
jae 0x140021d8e
mov rcx, qword [rbp - 0x18]
mov rdx, rbx
lea r8, [rbp - 0x30]
xor r9d, r9d
call sub.KERNEL32.dll_GetOverlappedResult
test eax, eax
je 0x140021c9b
mov ebx, dword [rbp - 0x30]
mov rcx, qword [rbp - 0x20]
mov rdx, qword [rbp - 0x18]
call fcn.14001a910
jmp 0x140021bc0
cmp eax, 0x26
jne 0x140021d62
xor ebx, ebx
mov rcx, qword [rbp - 0x20]
mov rdx, qword [rbp - 0x18]
call fcn.14001a910
jmp 0x140021bc0
xor ebx, ebx
mov rcx, qword [rbp - 0x20]
mov rdx, qword [rbp - 0x18]
call fcn.14001a910
jmp 0x140021bc0
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x26
je 0x140021cc2
cmp eax, 0x6d
jne 0x140021e92
xor ebx, ebx
mov rcx, qword [rbp - 0x20]
mov rdx, qword [rbp - 0x18]
call fcn.14001a910
jmp 0x140021bc0
xor ebx, ebx
mov rcx, qword [rbp - 0x20]
mov rdx, qword [rbp - 0x18]
call fcn.14001a910
jmp 0x140021bc0
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x6d
mov rcx, qword [rbp - 0x28]
jne 0x140021e71
mov dword [rcx + 0x60], 0
call fcn.140022370
nop
add rsp, 0x68
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
call fcn.140003430
call fcn.140003430
mov ecx, 0x30
call sub.gc.dll_GC_malloc
mov qword [rax + 0xc], 0
mov qword [rax + 4], 0
mov dword [rax + 0x2c], 0
mov qword [rax + 0x24], 0
mov qword [rax + 0x1c], 0
mov qword [rax + 0x14], 0
mov dword [rax], 0x21
lea rcx, [0x1400275a0]
mov qword [rax + 8], rcx
mov rcx, rax
call fcn.140005420
cmp eax, 5
jne 0x140021de1
lea rcx, [0x140028550]
lea rdx, [0x140028570]
call fcn.140014260
mov rcx, rax
mov rdx, qword [rbp - 0x28]
call fcn.140021fb0
mov rcx, rax
call fcn.140019950
call fcn.140019cd0
mov rsi, rax
mov ecx, 0x30
call sub.gc.dll_GC_malloc
mov qword [rax + 0xc], 0
mov qword [rax + 4], 0
mov dword [rax + 0x2c], 0
mov qword [rax + 0x24], 0
mov qword [rax + 0x1c], 0
mov qword [rax + 0x14], 0
mov dword [rax], 0x43
mov qword [rax + 8], rsi
mov rcx, rax
call fcn.1400054f0
lea rcx, [0x140028380]
mov edx, eax
mov r8, qword [rbp - 0x28]
call fcn.1400221b0
mov rcx, rax
call fcn.140019950
mov ecx, 0x40
call sub.gc.dll_GC_malloc
mov qword [rax + 0xc], 0
mov qword [rax + 4], 0
mov dword [rax + 0x3c], 0
mov qword [rax + 0x34], 0
mov qword [rax + 0x2c], 0
mov qword [rax + 0x24], 0
mov qword [rax + 0x1c], 0
mov qword [rax + 0x14], 0
mov dword [rax], 0x2a
lea rcx, [0x1400282b0]
mov qword [rax + 8], rcx
mov rcx, rax
call fcn.140007430
lea rcx, [0x140028270]
call fcn.1400193d0
mov rcx, rax
call fcn.140007430
cmp eax, 5
jne 0x140021f16
lea rcx, [0x1400282e0]
mov rdx, qword [rbp - 0x28]
call fcn.140021fb0
mov rcx, rax
call fcn.140019950
cmp eax, 0x3e4
jne 0x140021f30
lea rcx, [0x140028380]
lea rdx, [0x1400286b0]
call fcn.140014260
mov rsi, rax
mov ecx, 0x48
call sub.gc.dll_GC_malloc
mov qword [rax + 0xc], 0
mov qword [rax + 4], 0
mov dword [rax + 0x3c], 0
mov qword [rax + 0x34], 0
mov qword [rax + 0x2c], 0
mov qword [rax + 0x24], 0
mov qword [rax + 0x1c], 0
mov qword [rax + 0x14], 0
mov dword [rax], 0x2d
mov qword [rax + 0x40], 0
mov qword [rax + 8], rsi
mov rcx, rax
call fcn.14001c3e0
lea rcx, [0x140028340]
mov edx, eax
mov r8, qword [rbp - 0x28]
call fcn.1400221b0
mov rcx, rax
call fcn.140019950
lea rcx, [0x1400286d0]
mov edx, eax
call fcn.14001c430
mov rcx, rax
call fcn.140019950
int3