Function at 0x140064978
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x5f]
sub rsp, 0x100
mov qword [rbp - 1], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov rax, qword [0x1400a1df8]
xor rax, rsp
mov qword [rbp + 0x1f], rax
mov r15, r8
mov qword [rbp - 0x21], r8
movsxd rsi, edx
mov qword [rbp - 9], rcx
mov rax, rsi
mov qword [rbp - 0x11], rax
mov r12, rsi
sar r12, 6
lea rcx, [0x140000000]
and eax, 0x3f
lea r14, [rax + rax*8]
mov rax, qword [rcx + r12*8 + 0xac4a0]
mov rax, qword [rax + r14*8 + 0x28]
mov qword [rbp - 0x49], rax
mov r13d, r9d
add r13, r8
mov qword [rbp - 0x51], r13
call qword [sym.imp.KERNEL32.dll_GetConsoleOutputCP]
nop
mov dword [rbp - 0x59], eax
xor edx, edx
lea rcx, [rsp + 0x50]
call fcn.140049220
nop
mov rcx, qword [rsp + 0x58]
mov edx, dword [rcx + 0xc]
mov dword [rbp - 0x55], edx
xor r11d, r11d
mov dword [rbp - 0x69], r11d
mov ebx, r11d
mov dword [rbp - 0x65], ebx
mov ecx, r11d
mov dword [rsp + 0x40], ecx
mov rdi, r15
cmp r15, r13
jae 0x140064e20
mov rax, rsi
sar rax, 6
mov qword [rbp - 0x19], rax
mov rsi, r15
mov cl, byte [rdi]
mov byte [rsp + 0x44], cl
mov dword [rsp + 0x48], r11d
mov r15d, 1
cmp edx, 0xfde9
jne 0x140064bd1
mov edx, r11d
mov rsi, r11
lea r15, [0x140000000]
mov r8, qword [r15 + rax*8 + 0xac4a0]
lea rax, [r8 + r14*8]
cmp byte [rax + rsi + 0x3e], r11b
je 0x140064a88
inc edx
inc rsi
cmp rsi, 5
jl 0x140064a76
test rsi, rsi
jle 0x140064b74
mov rax, qword [r15 + r12*8 + 0xac4a0]
movzx ecx, byte [rax + r14*8 + 0x3e]
movsx r15d, byte [rcx + r15 + 0xa2400]
inc r15d
mov r13d, r15d
sub r13d, edx
mov r9, qword [rbp - 0x51]
sub r9, rdi
movsxd r10, r13d
cmp r10, r9
jg 0x140064d46
mov rdx, r11
lea rax, [rbp + 7]
sub r8, rax
lea r9, [r8 + r14*8]
lea rcx, [rbp + 7]
add rcx, rdx
mov al, byte [rcx + r9 + 0x3e]
mov byte [rcx], al
inc rdx
cmp rdx, rsi
jl 0x140064ad2
test r13d, r13d
jle 0x140064b03
lea rcx, [rbp + 7]
add rcx, rsi
mov r8, r10
mov rdx, rdi
call fcn.14003c3f0
nop
xor r11d, r11d
mov rdx, r11
lea r8, [0x140000000]
lea rcx, [rdx + r14*8]
mov rax, qword [r8 + r12*8 + 0xac4a0]
mov byte [rcx + rax + 0x3e], r11b
inc rdx
cmp rdx, rsi
jl 0x140064b0d
mov qword [rbp - 0x41], r11
lea rax, [rbp + 7]
mov qword [rbp - 0x39], rax
mov eax, r11d
cmp r15d, 4
sete al
inc eax
mov r15d, eax
mov r8d, eax
lea r9, [rbp - 0x41]
lea rdx, [rbp - 0x39]
lea rcx, [rsp + 0x48]
call fcn.14006c310
nop
cmp rax, 0xffffffffffffffff
je 0x140064c3b
lea eax, [r13 - 1]
movsxd rsi, eax
add rsi, rdi
mov r13, qword [rbp - 0x51]
jmp 0x140064c5e
movzx eax, byte [rdi]
movsx rsi, byte [rax + r15 + 0xa2400]
lea ecx, [rsi + 1]
mov rdx, r13
sub rdx, rdi
movsxd rax, ecx
cmp rax, rdx
jg 0x140064d81
mov qword [rbp - 0x31], r11
mov qword [rbp - 0x29], rdi
mov eax, r11d
cmp ecx, 4
sete al
inc eax
mov ebx, eax
mov r8d, eax
lea r9, [rbp - 0x31]
lea rdx, [rbp - 0x29]
lea rcx, [rsp + 0x48]
call fcn.14006c310
nop
cmp rax, 0xffffffffffffffff
je 0x140064c3b
add rsi, rdi
mov r15d, ebx
jmp 0x140064c5e
lea rax, [0x140000000]
mov rdx, qword [rax + r12*8 + 0xac4a0]
mov cl, byte [rdx + r14*8 + 0x3d]
test cl, 4
je 0x140064c05
mov al, byte [rdx + r14*8 + 0x3e]
mov byte [rbp + 0xf], al
mov al, byte [rdi]
mov byte [rbp + 0x10], al
and cl, 0xfb
mov byte [rdx + r14*8 + 0x3d], cl
lea rdx, [rbp + 0xf]
jmp 0x140064c25
call fcn.14005a948
nop
movzx ecx, byte [rdi]
xor edx, edx
cmp word [rax + rcx*2], dx
jge 0x140064c44
inc rsi
cmp rsi, r13
jae 0x140064dda
mov rdx, rdi
mov r8d, 2
lea rcx, [rsp + 0x48]
call fcn.1400608f8
nop
cmp eax, 0xffffffff
jne 0x140064c5e
cmp byte [rbp - 0x71], 0
jmp 0x140064dd4
mov r8, r15
mov rdx, rdi
lea rcx, [rsp + 0x48]
call fcn.1400608f8
nop
cmp eax, 0xffffffff
je 0x140064e12
lea rdi, [rsi + 1]
xor ebx, ebx
mov qword [rsp + 0x38], rbx
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], 5
lea rax, [rbp + 0x17]
mov qword [rsp + 0x20], rax
mov r9d, r15d
lea r8, [rsp + 0x48]
xor edx, edx
mov ecx, dword [rbp - 0x59]
call fcn.140069bc8
nop
mov esi, eax
test eax, eax
je 0x140064e74
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x4c]
mov r8d, eax
lea rdx, [rbp + 0x17]
mov rcx, qword [rbp - 0x49]
call qword [sym.imp.KERNEL32.dll_WriteFile]
nop
xor r11d, r11d
test eax, eax
je 0x140064e6a
mov ebx, edi
sub ebx, dword [rbp - 0x21]
mov r15d, dword [rsp + 0x40]
add ebx, r15d
mov dword [rbp - 0x65], ebx
cmp dword [rsp + 0x4c], esi
jb 0x140064dd0
cmp byte [rsp + 0x44], 0xa
jne 0x140064d2e
lea eax, [r11 + 0xd]
mov word [rsp + 0x44], ax
mov qword [rsp + 0x20], r11
lea r9, [rsp + 0x4c]
lea r8d, [r11 + 1]
lea rdx, [rsp + 0x44]
mov rcx, qword [rbp - 0x49]
call qword [sym.imp.KERNEL32.dll_WriteFile]
nop
xor r11d, r11d
test eax, eax
je 0x140064e08
cmp dword [rsp + 0x4c], 1
jb 0x140064dd0
inc r15d
mov dword [rsp + 0x40], r15d
inc ebx
mov dword [rbp - 0x65], ebx
mov rsi, rdi
cmp rdi, r13
jae 0x140064e1c
mov rax, qword [rbp - 0x19]
mov edx, dword [rbp - 0x55]
jmp 0x140064a40
mov r8d, r11d
test r9, r9
jle 0x140064d7c
sub rdi, rsi
lea rbx, [0x140000000]
lea rdx, [rsi + r14*8]
mov rcx, qword [rbx + r12*8 + 0xac4a0]
mov al, byte [rdi + rsi]
mov byte [rdx + rcx + 0x3e], al
inc r8d
inc rsi
movsxd rax, r8d
cmp rax, r9
jl 0x140064d58
mov ebx, dword [rbp - 0x65]
add ebx, r9d
jmp 0x140064dcd
mov r9d, r11d
test rdx, rdx
jle 0x140064dcb
mov r8, r11
mov r13, qword [rbp - 0x11]
mov r10, r13
sar r10, 6
and r13d, 0x3f
lea r11, [r13*8]
add r11, r13
mov rcx, qword [r15 + r10*8 + 0xac4a0]
add rcx, r8
mov al, byte [r8 + rdi]
mov byte [rcx + r11*8 + 0x3e], al
inc r9d
inc r8
movsxd rax, r9d
cmp rax, rdx
jl 0x140064da6
xor r11d, r11d
add ebx, edx
mov dword [rbp - 0x65], ebx
cmp byte [rbp - 0x71], r11b
mov ecx, dword [rsp + 0x40]
jmp 0x140064e24
lea r8, [0x140000000]
mov rcx, qword [r8 + r12*8 + 0xac4a0]
mov al, byte [rdi]
mov byte [rcx + r14*8 + 0x3e], al
mov rax, qword [r8 + r12*8 + 0xac4a0]
or byte [rax + r14*8 + 0x3d], 4
inc ebx
mov dword [rbp - 0x65], ebx
cmp byte [rbp - 0x71], dl
jmp 0x140064dd4
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop
mov dword [rbp - 0x69], eax
mov ecx, dword [rsp + 0x40]
cmp byte [rbp - 0x71], 0
jmp 0x140064e24
mov ecx, dword [rsp + 0x40]
cmp byte [rbp - 0x71], r11b
je 0x140064e32
mov rax, qword [rsp + 0x50]
and dword [rax + 0x3a8], 0xfffffffd
movsd xmm0, qword [rbp - 0x69]
mov rax, qword [rbp - 9]
movsd qword [rax], xmm0
mov dword [rax + 8], ecx
mov rcx, qword [rbp + 0x1f]
xor rcx, rsp
call fcn.140037490
nop
mov rbx, qword [rsp + 0x140]
add rsp, 0x100
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop
mov dword [rbp - 0x69], eax
mov ecx, dword [rsp + 0x40]
cmp byte [rbp - 0x71], bl
jmp 0x140064e24