Function at 0x140011710
Capabilities:
Encode data using xor
Write file on windows

Disassembly:
test rdx, rdx
je 0x140011a9a
mov rax, rsp
mov qword [rax + 0x20], r9
mov qword [rax + 8], rcx
push rbp
push rbx
push r14
lea rbp, [rax - 0x3b8]
sub rsp, 0x4a0
mov r14, r8
mov rbx, rdx
test r8, r8
je 0x140011a8f
cmp r9, 0x400000
ja 0x140011a8f
mov r9, qword [0x14021afb8]
lea rdx, [0x1401c1840]
mov r8, qword [0x14021ad98]
lea rcx, [rsp + 0x60]
mov qword [rax + 0x18], rsi
mov rsi, 0xffffffffffffffff
mov qword [rax - 0x28], r15
lea rax, [rsp + 0x78]
mov qword [rsp + 0x68], rax
xor r15d, r15d
lea rax, [0x1401b6698]
mov dword [rsp + 0x70], r15d
mov qword [rsp + 0x60], rax
lea rax, [0x14021c2d0]
mov qword [rsp + 0x20], rax
mov dword [rsp + 0x74], 0x104
mov word [rsp + 0x78], r15w
mov dword [rsp + 0x50], 0x50000
call fcn.140003670
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x140011a49
mov qword [rsp + 0x30], r15
lea r8d, [rsi + 4]
mov dword [rsp + 0x28], 0x80
xor r9d, r9d
mov edx, 0xc0000000
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rsi, rax
cmp rax, 0xffffffffffffffff
je 0x140011a49
lea r9d, [r15 + 2]
mov qword [rsp + 0x498], rdi
lea r8, [rsp + 0x5c]
mov qword [rsp + 0x58], r15
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [rsp + 0x58], eax
cmp eax, 0xffffffff
jne 0x140011832
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r9, [rbp + 0x3c8]
mov dword [rbp + 0x3c8], r15d
mov r8d, 4
mov qword [rsp + 0x20], r15
lea rdx, [rsp + 0x50]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x140011868
mov eax, r15d
mov dword [rbp + 0x3c8], eax
jmp 0x14001186e
mov eax, dword [rbp + 0x3c8]
lock add qword [0x1401f3d68], rax
mov rax, 0xffffffffffffffff
nop dword [rax]
inc rax
cmp word [rbx + rax*2], r15w
jne 0x140011880
inc eax
mov dword [rsp + 0x40], r15d
lea r9, [rsp + 0x40]
mov dword [rsp + 0x48], eax
mov r8d, 4
mov qword [rsp + 0x20], r15
lea rdx, [rsp + 0x48]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1400118c0
mov eax, r15d
mov dword [rsp + 0x40], eax
jmp 0x1400118c4
mov eax, dword [rsp + 0x40]
lock add qword [0x1401f3d68], rax
mov r9, 0xffffffffffffffff
lea rcx, [rbp + 0x180]
mov r8, rbx
mov edx, 0x104
call fcn.14003c218
mov eax, dword [rsp + 0x48]
lea rbx, [0x1401bd1e0]
lea r8d, [rax + rax]
test r8d, r8d
je 0x14001195c
xor dl, dl
mov r10d, r8d
lea rcx, [rbp + 0x180]
mov r9, r15
nop word [rax + rax]
mov rax, r9
lea rcx, [rcx + 1]
and eax, 0xf
inc r9
add dl, byte [rbx + rax*4]
xor byte [rcx - 1], dl
movzx edx, byte [rcx - 1]
sub r10, 1
jne 0x140011910
lea r9, [rbp + 0x3c0]
mov dword [rbp + 0x3c0], r15d
lea rdx, [rbp + 0x180]
mov qword [rsp + 0x20], r15
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x14001195c
mov eax, dword [rbp + 0x3c0]
jmp 0x140011965
mov eax, r15d
mov dword [rbp + 0x3c0], eax
lock add qword [0x1401f3d68], rax
mov r9, qword [rbp + 0x3d8]
mov rcx, r15
test r9, r9
je 0x14001199a
xor dl, dl
nop
mov rax, rcx
and eax, 0xf
add dl, byte [rbx + rax*4]
xor byte [rcx + r14], dl
movzx edx, byte [rcx + r14]
inc rcx
cmp rcx, r9
jb 0x140011980
lea r9, [rsp + 0x44]
mov dword [rsp + 0x44], r15d
mov r8d, 4
mov qword [rsp + 0x20], r15
lea rdx, [rbp + 0x3d8]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1400119cc
mov eax, r15d
mov dword [rsp + 0x44], eax
jmp 0x1400119d0
mov eax, dword [rsp + 0x44]
lock add qword [0x1401f3d68], rax
mov rbx, qword [rbp + 0x3d8]
mov rdi, r15
test rbx, rbx
je 0x140011a29
nop word [rax + rax]
mov r8d, 0xfffffff
mov dword [rsp + 0x4c], r15d
cmp rbx, r8
mov qword [rsp + 0x20], r15
lea rdx, [rdi + r14]
mov rcx, rsi
cmovb r8d, ebx
lea r9, [rsp + 0x4c]
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x140011a29
mov eax, dword [rsp + 0x4c]
add rdi, rax
sub rbx, rax
jne 0x1400119f0
lock add qword [0x1401f3d68], rdi
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdi, qword [rsp + 0x498]
mov rsi, 0xffffffffffffffff
mov r8, qword [rbp + 0x3d8]
xor edx, edx
mov rcx, r14
call fcn.14014d290
mov qword [rsp + 0x68], r15
lea rax, [0x1401b6738]
mov dword [rsp + 0x70], r15d
mov r15, qword [rsp + 0x490]
mov qword [rsp + 0x60], rax
cmp rsi, 0xffffffffffffffff
je 0x140011a87
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rsi, qword [rsp + 0x4d0]
add rsp, 0x4a0
pop r14
pop rbx
pop rbp
ret