Function at 0x100401208
Capabilities:
Write file on windows

Disassembly:
push rbp
push rbx
sub rsp, 0x98
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x30], rcx
lea rax, [rbp - 0x11]
mov rcx, rax
call fcn.1004551c0
lea rdx, [rbp - 0x11]
lea rax, [rbp - 0x30]
mov r8, rdx
mov edx, 0x1000
mov rcx, rax
call fcn.1004782e0
lea rax, [rbp - 0x11]
mov rcx, rax
call fcn.1004551f0
lea rax, [rbp - 0x40]
mov qword [rbp], rax
mov qword [rbp + 8], 0
cmp qword [rbp + 8], 7
ja 0x10040127a
mov rax, qword [rbp]
lea rdx, [rax + 1]
mov qword [rbp], rdx
mov byte [rax], 0
add qword [rbp + 8], 1
jmp 0x10040125d
mov rax, qword [rbp + 0x30]
add rax, 0x20
mov rcx, rax
call fcn.100401b24
mov rax, qword [rbp + 0x30]
mov eax, dword [rax + 0x2c]
test eax, eax
setne al
test al, al
je 0x1004012ab
lea rcx, str.InputHandler:_shutting_down
call fcn.1004059cb
jmp 0x1004014db
mov rax, qword [rbp + 0x30]
add rax, 0x20
mov rcx, rax
call fcn.100411f70
mov dword [rbp - 0x10], eax
mov rax, qword [rbp + 0x30]
lea rcx, [rax + 8]
lea rax, [rbp - 0x10]
mov rdx, rax
call fcn.100488600
mov eax, dword [rax]
mov dword [rbp - 4], eax
mov rax, qword [rbp + 0x30]
mov eax, dword [rax + 8]
cdqe
shr rax, 6
mov r8, qword [rbp + rax*8 - 0x40]
mov rdx, qword [rbp + 0x30]
mov edx, dword [rdx + 8]
and edx, 0x3f
mov r9d, 1
mov ecx, edx
shl r9, cl
mov rdx, r9
or rdx, r8
mov qword [rbp + rax*8 - 0x40], rdx
mov rax, qword [rbp + 0x30]
add rax, 0x20
mov rcx, rax
call fcn.100411f70
and eax, 0x3f
mov edx, 1
mov rbx, rdx
mov ecx, eax
shl rbx, cl
mov rax, qword [rbp + 0x30]
add rax, 0x20
mov rcx, rax
call fcn.100411f70
cdqe
shr rax, 6
mov rdx, qword [rbp + rax*8 - 0x40]
mov rcx, rbx
or rdx, rcx
mov qword [rbp + rax*8 - 0x40], rdx
mov eax, dword [rbp - 4]
add eax, 1
lea rdx, [rbp - 0x40]
mov r8, rdx
mov edx, eax
lea rcx, str.InputHandler
call fcn.10040194a
mov rax, qword [rbp + 0x30]
mov eax, dword [rax + 8]
cdqe
shr rax, 6
mov rdx, qword [rbp + rax*8 - 0x40]
mov rax, qword [rbp + 0x30]
mov eax, dword [rax + 8]
and eax, 0x3f
mov r8d, 1
mov ecx, eax
shl r8, cl
mov rax, r8
and rax, rdx
test rax, rax
je 0x1004014f8
lea rax, [rbp - 0x30]
mov rcx, rax
call fcn.10041d290
mov rbx, rax
lea rax, [rbp - 0x30]
mov edx, 0
mov rcx, rax
call fcn.1004783a0
mov rdx, rax
mov rax, qword [rbp + 0x30]
mov eax, dword [rax + 8]
mov r8, rbx
mov ecx, eax
call sub.msys_2.0.dll_read
mov dword [rbp - 8], eax
cmp dword [rbp - 8], 0xffffffff
jne 0x1004013f0
call sub.msys_2.0.dll___errno
mov eax, dword [rax]
cmp eax, 4
jne 0x1004013f0
mov eax, 1
jmp 0x1004013f5
mov eax, 0
test al, al
jne 0x1004014fe
cmp dword [rbp - 8], 0
jg 0x100401419
mov eax, dword [rbp - 8]
mov edx, eax
lea rcx, str.InputHandler:_tty_read_failed:_numRead_d
call fcn.1004059cb
jmp 0x1004014db
mov dword [rbp - 0x44], 0
mov ebx, dword [rbp - 8]
lea rax, [rbp - 0x30]
mov edx, 0
mov rcx, rax
call fcn.1004783a0
mov rcx, rax
mov rax, qword [rbp + 0x30]
mov rax, qword [rax]
lea rdx, [rbp - 0x44]
mov qword [rsp + 0x20], 0
mov r9, rdx
mov r8d, ebx
mov rdx, rcx
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_WriteFile]
call rax
mov dword [rbp - 0xc], eax
cmp dword [rbp - 0xc], 0
je 0x100401477
mov edx, dword [rbp - 0x44]
mov eax, dword [rbp - 8]
cmp edx, eax
je 0x10040127a
cmp dword [rbp - 0xc], 0
jne 0x100401492
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
cmp eax, 0x6d
jne 0x100401492
mov eax, 1
jmp 0x100401497
mov eax, 0
test al, al
je 0x1004014ae
mov eax, dword [rbp - 0x44]
mov edx, eax
lea rcx, str.InputHandler:_pipe_closed:_written_u
call fcn.1004059cb
jmp 0x1004014da
mov ebx, dword [rbp - 0x44]
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov ecx, eax
mov edx, dword [rbp - 8]
mov eax, dword [rbp - 0xc]
mov dword [rsp + 0x20], ebx
mov r9d, edx
mov r8d, ecx
mov edx, eax
lea rcx, str.InputHandler:_write_failed:_ret_d_lastError0x_x_numRead_d_written_u
call fcn.1004059cb
nop
mov rax, qword [rbp + 0x30]
mov dword [rax + 0x30], 1
mov rax, qword [rbp + 0x30]
mov rax, qword [rax + 0x18]
mov rcx, rax
call fcn.100401ace
jmp 0x100401504
nop
jmp 0x10040127a
nop
jmp 0x10040127a
lea rax, [rbp - 0x30]
mov rcx, rax
call fcn.100478350
jmp 0x100401547
add rsp, 0x98
pop rbx
pop rbp
ret